>=thunderbird-140 uses dbus crate despite --disable-dbus

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

>=thunderbird-140 uses dbus crate despite --disable-dbus

Post by colo-des »

[Administrator edit: Changed title to try to attract relevant answers. Original title was thunderbird error in nsUserInfoUnix.cpp? -Hu]

Hi, I'm on the stable amd64 branch.
Up to version thunderbird-128.14.0, I could emerge by editing its ebuild in my local repository, changing --enable-dbus to --disable-dbus
I've been trying all versions (140.3.1, 140.4.0, 140.5.0) and all compilers with gcc-13, gcc-14, gcc-15, and clang-20, and always end up in the same place with the same error.
My system is free of dbus and at-spi2.

Has anyone solved this or created a patch?

Code: Select all

6:59.11 /usr/bin/g++ -o nsUserInfoUnix.o -c  -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/stl_wrappers -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/system_wrappers -include /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fstrict-flex-arrays=1 -DNDEBUG=1 -DTRIMMED=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DMOZ_SUPPORT_LEAKCHECKING -DSTATIC_EXPORTABLE_JS_API -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/comm/mailnews/base/src -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/dom/base -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/netwerk/base -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/toolkit/components/jsoncpp/include -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/ipc/ipdl/_ipdlheaders -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/ipc/chromium/src -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include -I/usr/include/nspr -I/usr/include/nss -I/usr/include/nspr -I/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nss -I/usr/include/libpng16 -I/usr/include/pixman-1 -DMOZILLA_CLIENT -include /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/mozilla-config.h -fno-rtti -pthread -fno-sized-deallocation -fno-aligned-new -ffunction-sections -fdata-sections -fno-math-errno -fno-exceptions -pipe -fPIC -march=native -mtune=native -pipe -O2 -fomit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wcomma-subscript -Wvolatile -Wno-deprecated-enum-enum-conversion -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-security -Wformat-overflow=2 -Wno-psabi -Wno-error=builtin-macro-redefined -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/nsUserInfoUnix.o.pp  -fdiagnostics-color  /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsUserInfoUnix.cpp
 6:59.32 In file included from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsTArray.h:3375,
 6:59.32                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsIMsgDBView.h:13,
 6:59.33                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgDBView.h:9,
 6:59.33                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgGroupView.h:9,
 6:59.33                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgSearchDBView.h:9,
 6:59.34                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgXFVirtualFolderDBView.h:9,
 6:59.34                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp:7:
 6:59.35 In member function 'void nsTArray_base<Alloc, RelocationStrategy>::ShrinkCapacityToZero(size_type, size_t) [with Alloc = nsTArrayInfallibleAllocator; RelocationStrategy = nsTArray_RelocateUsingMemutils]',
 6:59.36     inlined from 'void nsTArray_base<Alloc, RelocationStrategy>::ShiftData(index_type, size_type, size_type, size_type, size_t) [with ActualAlloc = nsTArrayInfallibleAllocator; Alloc = nsTArrayInfallibleAllocator; RelocationStrategy = nsTArray_RelocateUsingMemutils]' at /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsTArray-inl.h:338:25,
 6:59.37     inlined from 'typename ActualAlloc::ResultTypeProxy nsTArray_base<Alloc, RelocationStrategy>::InsertSlotsAt(index_type, size_type, size_type, size_t) [with ActualAlloc = nsTArrayInfallibleAllocator; Alloc = nsTArrayInfallibleAllocator; RelocationStrategy = nsTArray_RelocateUsingMemutils]' at /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsTArray-inl.h:423:25,
 6:59.38     inlined from 'nsTArray_Impl<E, Alloc>::value_type* nsTArray_Impl<E, Alloc>::InsertElementsAtInternal(index_type, size_type) [with ActualAlloc = nsTArrayInfallibleAllocator; E = unsigned int; Alloc = nsTArrayInfallibleAllocator]' at /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsTArray.h:2321:75,
 6:59.38     inlined from 'typename ActualAlloc::ResultType nsTArray_Impl<E, Alloc>::SetLength(size_type) [with ActualAlloc = nsTArrayInfallibleAllocator; E = unsigned int; Alloc = nsTArrayInfallibleAllocator]' at /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsTArray.h:2250:48,
 6:59.39     inlined from 'void nsMsgXFVirtualFolderDBView::UpdateCacheAndViewForPrevSearchedFolders(nsIMsgFolder*)' at /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp:207:22:
 6:59.39 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsTArray-inl.h:315:19: warning: array subscript 1 is outside array bounds of 'nsTArray<unsigned int> [1]' [-Warray-bounds=]
 6:59.39   315 |     mHdr->mLength = 0;
 6:59.39       |     ~~~~~~~~~~~~~~^~~
 6:59.40 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp: In member function 'void nsMsgXFVirtualFolderDBView::UpdateCacheAndViewForPrevSearchedFolders(nsIMsgFolder*)':
 6:59.40 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp:206:24: note: at offset 8 into object 'newHits' of size 8
 6:59.41   206 |     nsTArray<nsMsgKey> newHits;
 6:59.41       |                        ^~~~~~~
 7:02.22 In file included from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsIFrame.h:52,
 7:02.22                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/dom/base/nsFrameLoader.h:36,
 7:02.22                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/dom/base/nsFrameLoaderOwner.h:11,
 7:02.22                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/mozilla/dom/XULFrameElement.h:19,
 7:02.22                  from /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/mailnews/base/src/nsMsgWindow.cpp:29:
 7:02.22 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/FrameProperties.h: In instantiation of 'static mozilla::FrameProperties::PropertyType<T> mozilla::FrameProperties::ReinterpretHelper<T>::FromInternalValue(uint64_t) [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; uint64_t = long unsigned int]':
 7:02.23 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/FrameProperties.h:202:51:   required from 'mozilla::FrameProperties::PropertyType<T> mozilla::FrameProperties::Get(Descriptor<T>, bool*) const [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; PropertyType<T> = mozilla::FrameBidiData; Descriptor<T> = const mozilla::FramePropertyDescriptor<mozilla::SmallValueHolder<mozilla::FrameBidiData> >*]'
 7:02.23   202 |     return ReinterpretHelper<T>::FromInternalValue(v);
 7:02.23       |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
 7:02.23 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsIFrame.h:4451:27:   required from 'mozilla::FrameProperties::PropertyType<T> nsIFrame::GetProperty(mozilla::FrameProperties::Descriptor<T>, bool*) const [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; mozilla::FrameProperties::Descriptor<T> = const mozilla::FramePropertyDescriptor<mozilla::SmallValueHolder<mozilla::FrameBidiData> >*]'
 7:02.23  4451 |     return mProperties.Get(aProperty, aFoundResult);
 7:02.23       |            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
 7:02.23 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsIFrame.h:1542:50:   required from here
 7:02.24  1542 |     mozilla::FrameBidiData bidiData = GetProperty(BidiDataProperty(), &exists);
 7:02.24       |                                       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 7:02.24 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/FrameProperties.h:302:13: warning: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'mozilla::FrameProperties::PropertyType<mozilla::SmallValueHolder<mozilla::FrameBidiData> >' {aka 'struct mozilla::FrameBidiData'} from an array of 'uint64_t' {aka 'long unsigned int'} [-Wclass-memaccess]
 7:02.24   302 |       memcpy(&value, &aInternalValue, sizeof(value));
 7:02.24       |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 7:02.24 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/dist/include/nsIFrame.h:413:8: note: 'mozilla::FrameProperties::PropertyType<mozilla::SmallValueHolder<mozilla::FrameBidiData> >' {aka 'struct mozilla::FrameBidiData'} declared here
 7:02.24   413 | struct FrameBidiData {
 7:02.25       |        ^~~~~~~~~~~~~
 7:05.52 gmake[4]: Leaving directory '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/comm/mailnews/base/src'
 7:05.52 gmake[3]: Leaving directory '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build'
 7:05.52 gmake[2]: *** [/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/config/recurse.mk:34: compile] Error 2
 7:05.52 gmake[2]: Leaving directory '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build'
 7:05.52 gmake[1]: *** [/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/config/rules.mk:359: default] Error 2
 7:05.53 gmake[1]: Leaving directory '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build'
 7:05.53 gmake: *** [client.mk:60: build] Error 2
 7:05.63 W 0 compiler warnings present.
 * ERROR: mail-client/thunderbird-140.5.0::repo_local failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 143:  Called src_compile
 *   environment, line 4104:  Called die
 * The specific snippet of code:
 *       ${virtx_cmd} ./mach build --verbose || die
 * 
 * If you need support, post the output of `emerge --info '=mail-client/thunderbird-140.5.0::repo_local'`,
 * the complete build log and the output of `emerge -pqv '=mail-client/thunderbird-140.5.0::repo_local'`.
 * The complete build log is located at '/var/log/portage/mail-client:thunderbird-140.5.0:20251207-183703.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/mail-client/thunderbird-140.5.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/mail-client/thunderbird-140.5.0/temp/environment'.
 * Working directory: '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0'
 * S: '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0'

>>> Failed to emerge mail-client/thunderbird-140.5.0, Log file:
Last edited by colo-des on Sat Dec 13, 2025 3:29 am, edited 1 time in total.
User avatar
sam_
Developer
Developer
Posts: 2808
Joined: Fri Aug 14, 2020 12:33 am

Post by sam_ »

The log does not show the actual error. Please provide untruncated build.log.
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

The log is big, 7.8MB
I followed this guide
https://wiki.gentoo.org/wiki/Wgetpaste

To download

Code: Select all

1 - click to https://dpaste.com/DCLVYD4YH and button -> COPY TO CLIPBOARD
2 - open am edit and paste
3 - save as 'mail-client:thunderbird-140.5.0:20251213-003417.log.gz.base64'
4 - $ base64 -d 'mail-client:thunderbird-140.5.0:20251213-003417.log.gz.base64' > 'mail-client:thunderbird-140.5.0:20251213-003417.log.gz'
5 - $ gunzip 'mail-client:thunderbird-140.5.0:20251213-003417.log.gz'
6 - $ less mail-client:thunderbird-140.5.0:20251213-003417.log
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

Post by Hu »

It would be easier to click if the URL were a link. Please do not wrap URLs in code tags. For this case, it's easier to save the content directly by fetching https://dpaste.com/DCLVYD4YH.txt[b][/b], which avoids the trip through the clipboard and editor. Assuming one wanted only the final result, discarding intermediate results, this could be collapsed to wget -O - https://dpaste.com/DCLVYD4YH.txt | base64 -d | gunzip > mail-client:thunderbird-140.5.0:20251213-003417.log.

As for the actual error, there are several false hits due to Rust's unfortunate use of error: in lines that are not, in fact, errors at all.[1] However, one real error appears to be:

Code: Select all

78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2] pkg_config failed: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" PKG_CONFIG_PATH="/var/tmp/portage/mail-client/thunderbird-140.5.0/temp/python3.14/pkgconfig" "/usr/bin/x86_64-pc-linux-gnu-pkg-config" "--libs" "--cflags" "dbus-1" "dbus-1 >= 1.6"` did not exit successfully: exit status: 1[m(B[m(B
78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2] error: could not find system library 'dbus-1' required by the 'libdbus-sys' crate[m(B[m(B
78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2][m(B[m(B
78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2] --- stderr[m(B[m(B
78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2] Package dbus-1 was not found in the pkg-config search path.[m(B[m(B
78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2] Perhaps you should add the directory containing `dbus-1.pc'[m(B[m(B
78[1G[K[38;5;4m 3:42.60[m(B [libdbus-sys 0.2.2] to the PKG_CONFIG_PATH environment variable[m(B[m(B
78[1G[K[38;5;4m 3:42.61[m(B [libdbus-sys 0.2.2] Package 'dbus-1' not found[m(B[m(B
This starts at line 17554. It is consistent with your original note that your system lacks dbus. It seems that you will need to work a bit harder to make Thunderbird not try to use dbus.

[1]: For example, this use of error: in a description string advertising what the dtolnay crate is meant to do is not an error, but matches the search for error:.

Code: Select all

78[1G[K[38;5;4m 1:32.46[m(B [1m[32m     Running[0m `CARGO=/usr/lib/rust/1.89.0/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/third_party/rust/anyhow CARGO_MANIFEST_PATH=/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/third_party/rust/anyhow/Cargo.toml CARGO_PKG_AUTHORS='David Tolnay <dtolnay@gmail.com>' CARGO_PKG_DESCRIPTION='Flexible concrete Error type built on std::error::Error' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=anyhow CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/dtolnay/anyhow' CARGO_PKG_RUST_VERSION=1.39 CARGO_PKG_VERSION=1.0.69 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=69 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH=/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/release/deps /usr/lib/rust/1.89.0/bin/rustc --crate-name build_script_build --edition=2018 /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/third_party/rust/anyhow/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("backtrace", "default", "std"))' -C metadata=47acd35e1deb90c6 -C extra-filename=-5978a4d387f3ca11 --out-dir /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/release/build/anyhow-5978a4d387f3ca11 -C linker=/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/build/cargo-linker -C strip=debuginfo -L dependency=/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/release/deps --cap-lints warn`[m(B[m(B
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

Thanks Hu, and also for changing the thread title to something more relevant to the problem.
When I'm a grown man... (it'll be a while)... I'll have the mental capacity to use two pipes and a redirect in the same command... hehe... the -O- in wget is excellent.

This is crazy!! It won't let me patch the crate /thunderbird-140.5.0/comm/third_party/rust/libdbus-sys/build.rs
Cargo keeps track of the checksum of each crate in thunderbird-140.5.0/Cargo.lock

Code: Select all

[[package]]
name = "libdbus-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b"
dependencies = [
 "pkg-config",
]

Code: Select all

 * ======================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying without-panic-libdbus-sys.patch ...                    [ ok ]
 * User patches applied.
 * ======================================================================

Code: Select all

 1:15.45 error: the listed checksum of `/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/comm/third_party/rust/libdbus-sys/build.rs` has changed:
 1:15.45 expected: ad8091de7621ddfba2df83267a33e6eb5762d9daa100b6fb2b7dce75c4aee56d
 1:15.45 actual:   d59a4f48d2bbea2345dcfca8823004e82a691765b427b9b80d0593c29fabd6f3
 1:15.45 directory sources are not intended to be edited, if modifications are required then it is recommended that `[patch]` is used with a forked copy of the source
 1:15.54 gmake[4]: *** [/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/config/makefiles/rust.mk:530: force-cargo-library-build] Error 101
 1:15.55 gmake[4]: Leaving directory '/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird_build/comm/rust/gkrust'
 1:15.55 gmake[3]: *** [/var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/config/recurse.mk:72: comm/rust/gkrust/target-objects] Error 2
 1:15.55 gmake[3]: *** Waiting for unfinished jobs....
I can't figure out how to calculate that checksum. I've tried many methods, but none return the same hash.
I'm investigating the official patching mechanism with Cargo using the [patch.crates-io] tag in the thunderbird-140.5.0/Cargo.toml file.

Regards
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

I've tried modifying the libdbus-sys crate in a local copy, but it tells me I need to remove the `--frozen` flag and use `--offline` instead.
If only I knew where to pass the `--offline` flag, maybe a rust programmer could help... just so you know, I'm a complete novice when it comes
to rust, in case you haven't noticed. 8)

Code: Select all

# cat /etc/portage/patches/mail-client/thunderbird/without-panic-libdbus-sys.patch 

Code: Select all

--- a/Cargo.toml	2025-12-08 20:46:27.322314384 -0300
+++ b/Cargo.toml	2025-12-14 12:53:17.717468634 -0300
@@ -109,6 +109,9 @@
 cmake = { path = "build/rust/cmake" }
 vcpkg = { path = "build/rust/vcpkg" }

+# Disable panic! at /comm/third_party/rust/libdbus-sys/build.rs
+libdbus-sys = { path = "/home/my-user/adm/thunderbird/thunderbird-140.5.0/comm/third_party/rust/libdbus-sys" }
+
 # Helper crate for integration in the gecko build system.
 mozbuild = { path = "build/rust/mozbuild" }

Code: Select all

 * =================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying without-panic-libdbus-sys.patch ...               [ ok ]
 * User patches applied.
 * =================================================================

Code: Select all

error: the lock file /var/tmp/portage/mail-client/thunderbird-140.5.0/work/thunderbird-140.5.0/Cargo.lock needs to be updated but --frozen was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --frozen flag and use --offline instead.
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

I managed to do quite a bit of research on this, but I've been short on time with the holidays.
Just wanted to share this recent, interesting video about dbus.

https://www.youtube.com/watch?v=upKM5mViQrY
It's Time To Make A Major Change On Linux

Best wishes for a happy new year.
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

I couldn't find a way to patch libdbus-sys, but the way to trick the checker
"/comm/third_party/rust/libdbus-sys/build.rs" was by creating a fake pkg-config file:

Code: Select all

# nvim /usr/share/pkgconfig/dbus-1.pc
Name: dbus-1
Description: Fake dbus for building without dbus
Version: 1.16.2
Libs:
Cflags:

# pkg-config --modversion dbus-1
1.16.2
In addition, I've added and removed things from the ebuild in my local tree:

Code: Select all

$ nvim /usr/local/portage/mail-client/thunderbird/thunderbird-140.5.0.ebuild

$ meld /usr/local/portage/mail-client/thunderbird/thunderbird-140.5.0.ebuild /usr/portage/mail-client/thunderbird/thunderbird-140.5.0.ebuild

++ IUSE="dbus"
COMMON_DEPEND="${TB_ONLY_DEPEND}
--	>=app-accessibility/at-spi2-core-2.46.0:2

	# Set Gentoo defaults
	mozconfig_add_options_ac 'Gentoo default' \
--     --enable-dbus \
++     --disable-dbus \
After 1:05hr of smooth compilation, and now in the final stages, it throws an error again when trying to link the static library libgkrust.a
So I compared both Cargo.toml files, the one from thunderbird-128.14.0 with this thunderbird-140.5.0, and I found that several root crates
were added to the project, one of which is for the new MLS encryption system: "security/mls/mls_gk".
I'm trying to create a patch to remove this crate and its dependent crates... we'll see if I have any luck.

Code: Select all

69:17.85 /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: ../../../x86_64-unknown-linux-gnu/release/libgkrust.a(sys_tray-374cd8ce461c296a.sys_tray.a771107dfade3db3-cgu.0.rcgu.o): in function `dbus::arg::array_impl::<impl dbus::arg::msgarg::Append for std::collections::hash::map::HashMap<K,V,S>>::append_by_ref':
69:17.85 sys_tray.a771107dfade3db3-cgu.0:(.text._ZN4dbus3arg10array_impl109_$LT$impl$u20$dbus..arg..msgarg..Append$u20$for$u20$std..collections..hash..map..
HashMap$LT$K$C$V$C$S$GT$$GT$13append_by_ref17h25d7eec6b16d4b0cE+0x1e9): undefined reference to `dbus_message_iter_open_container'
69:17.86 /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: sys_tray.a771107dfade3db3-cgu.0:(.text._ZN4dbus3arg10array_impl109_$LT$impl$u20$dbus..arg..msgarg..Append$u20$for$u20$std..collections..hash..map..
HashMap$LT$K$C$V$C$S$GT$$GT$13append_by_ref17h25d7eec6b16d4b0cE+0x28b): undefined reference to `dbus_message_iter_open_container'
69:17.86 /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: sys_tray.a771107dfade3db3-cgu.0:(.text._ZN4dbus3arg10array_impl109_$LT$impl$u20$dbus..arg..msgarg..Append$u20$for$u20$std..collections..hash..map..
HashMap$LT$K$C$V$C$S$GT$$GT$13append_by_ref17h25d7eec6b16d4b0cE+0x2e2): undefined reference to `dbus_message_iter_close_container'
69:17.87 /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: sys_tray.a771107dfade3db3-cgu.0:(.text._ZN4dbus3arg10array_impl109_$LT$impl$u20$dbus..arg..msgarg..Append$u20$for$u20$std..collections..hash..map..
HashMap$LT$K$C$V$C$S$GT$$GT$13append_by_ref17h25d7eec6b16d4b0cE+0x320): undefined reference to `dbus_message_iter_close_container'
69:17.87 /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: ../../../x86_64-unknown-linux-gnu/release/libgkrust.a(sys_tray-374cd8ce461c296a.sys_tray.a771107dfade3db3-cgu.0.rcgu.o): in function `dbus::arg::array_impl::<impl dbus::arg::msgarg::RefArg for std::collections::hash::map::HashMap<K,V,S>>::append':
Regards
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

Finally, after much trial and error, I managed to patch and compile thunderbird without dbus
with great help from google's ai, which clarified many things about rust and cargo...a long
learning process of how mozilla build system works and how rust/cargo handles dependencies.

The required documentation to read is located in: build/docs/rust.rst
There you will find instructions on how to add crates to the project and in which files, which are:
toolkit/library/rust/shared/Cargo.toml
toolkit/library/rust/shared/lib.rs

The mozilla conditionals are located in the file toolkit/library/rust/gkrust-features.mozbuild, and among them is ["with_dbus"]

Code: Select all

66  if CONFIG["MOZ_ENABLE_DBUS"]:
67      gkrust_features += ["with_dbus"]
The problem is that they've added the sys_tray crate to the [workspace] of the main crate "mozilla-central-workspace-hack" in
comm/rust/Cargo.toml, and sys_tray uses dbus as a direct dependency to access the system bar.

Code: Select all

In thunderbird-128.14.0
[workspace]
members = ['xpcom_async', 'moz_http', 'gkrust', 'ews_xpcom', 'gtest']

In thunderbird-140.5.0
[workspace]
members = ['xpcom_async', 'moz_http', 'gkrust', 'ews_xpcom', 'gtest', 'sys_tray']
The `sys_tray` crate is used to add an icon to the system tray and has a hard and enforced dependency on `dbus`.
It's literally impossible to remove `sys_tray` from the workspace because other crates use it.
Furthermore, when `cargo` detects a change in any `.toml` file by comparing its `.lock`, it triggers a scan and
check of all dependencies in the tree.
The `cargo update --offline` parameter is ineffective for this, as it still wants to connect to `crate.io` and
can't, or it wants to run `--offline`.
I created a user patch to patch the `sys_tray` crate in its source file `comm/rust/sys_tray/src/lib.rs` by creating
empty functions that break the dependencies.

Code: Select all

$ cat /etc/portage/patches/mail-client/thunderbird/without-sys_tray.patch 
--- a/comm/rust/sys_tray/src/lib.rs	2025-11-08 01:45:27.000000000 -0300
+++ b/comm/rust/sys_tray/src/b-lib.rs	2026-02-02 05:06:59.099621675 -0300
@@ -1,12 +1,28 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+// comm/rust/sys_tray/src/lib.rs
+// Empty content for systems without D-Bus
-#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
-pub mod actions;
-#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
-pub mod linux;
-#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
-pub use actions::*;
-#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
-pub mod locales;
+pub struct SysTray {}
+
+impl SysTray {
+    pub fn new() -> Self {
+        SysTray {}
+    }
+
+    pub fn set_icon(&self, _name: &str) {}
+    pub fn set_tooltip(&self, _text: &str) {}
+    pub fn set_menu(&self, _menu: Vec<String>) {}
+    pub fn update(&self) {}
+}
+
+// Global functions that could be called from C++ (Gkrust)
+#[no_mangle]
+pub extern "C" fn sys_tray_init() -> *mut SysTray {
+    Box::into_raw(Box::new(SysTray::new()))
+}
+
+#[no_mangle]
+pub extern "C" fn sys_tray_shutdown(_ptr: *mut SysTray) {
+    if !_ptr.is_null() {
+        unsafe { drop(Box::from_raw(_ptr)); }
+    }
+}
After this, thunderbird compiles almost to completion, but when it tries to statically link the library `/release/libgkrust.a`,
it looks for the functions in the `libdbus-1.so.3` library.
Since it's not installed, it lists all the objects from `libdbus-1.so.3` that it needs.
What I did was change `--disable-dbus` back to `--enable-dbus` and create an empty `libdbus-1.so.3` library.
I based this on the `fake-dbus` library from stefan11111, but I changed the contents of `libdbus-1.c`.

Code: Select all

$ git clone https://github.com/stefan11111/fake-dbus.git

Code: Select all

$ cat ~/adm/dbus/fake-dbus/libdbus-1.c
/* libdbus-1.c */
#include <stdint.h>

void dbus_message_iter_get_arg_type() {}
void dbus_message_iter_get_basic() {}
void dbus_message_iter_recurse() {}
void dbus_message_iter_get_signature() {}
void dbus_message_unref() {}
void dbus_message_iter_next() {}
void dbus_message_iter_open_container() {}
void dbus_message_iter_close_container() {}
void dbus_message_iter_append_basic() {}
void dbus_message_iter_init_append() {}
void dbus_message_new_method_call() {}
void dbus_message_ref() {}
void dbus_message_get_type() {}
void dbus_message_iter_init() {}
void dbus_error_init() {}
void dbus_error_free() {}
void dbus_watch_get_unix_fd() {}
void dbus_watch_get_enabled() {}
void dbus_watch_get_flags() {}
void dbus_connection_close() {}
void dbus_connection_unref() {}
void dbus_connection_set_exit_on_disconnect() {}
void dbus_connection_add_filter() {}
void dbus_connection_set_watch_functions() {}
void dbus_connection_send_with_reply_and_block() {}
void dbus_validate_path() {}
void dbus_validate_member() {}
void dbus_validate_interface() {}
void dbus_validate_bus_name() {}
void dbus_free() {}
void dbus_bus_get_private() {}
void dbus_set_error_from_message() {}
void dbus_set_error() {}
void dbus_signature_validate_single() {}
void dbus_threads_init_default() {}
void dbus_error_is_set() {}
void dbus_message_set_no_reply() {}
void dbus_connection_send() {}
void dbus_connection_get_is_connected() {}
void dbus_connection_flush() {}

/* Stub for the rust component that we removed from the workspace */
__attribute__((visibility("default")))
void nsLinuxSysTrayHandlerConstructor() {
    // nothing
}

Code: Select all

Compile:
$ gcc -shared -fPIC -o libdbus-1.so.3 libdbus-1.c -Wl,--export-dynamic

Code: Select all

Install:
# cp -f libdbus-1.so.3 /usr/lib64
# ln -rsf /usr/lib64/libdbus-1.so.3 /usr/lib64/libdbus-1.so
# cp -f dbus-1.pc /usr/share/pkgconfig
# mkdir -p /usr/include/dbus-1.0/dbus
# cp -rf headers/* /usr/include/dbus-1.0/dbus

Code: Select all

Check:
$ ls -l /usr/lib64/libdbus-1.so.*
lrwxrwxrwx 1 root root    14 feb  3 03:03 /usr/lib64/libdbus-1.so -> libdbus-1.so.3
-rwxr-xr-x 1 root root 15424 feb  3 03:03 /usr/lib64/libdbus-1.so.3

$ ls -l /usr/include/dbus-1.0/dbus/
total 152
-rw-r--r-- 1 root root  2868 feb  3 03:03 dbus-address.h
-rw-r--r-- 1 root root  2167 feb  3 03:03 dbus-arch-deps.h
-rw-r--r-- 1 root root  3529 feb  3 03:03 dbus-bus.h
-rw-r--r-- 1 root root 27295 feb  3 03:03 dbus-connection.h
-rw-r--r-- 1 root root  2968 feb  3 03:03 dbus-errors.h
-rw-r--r-- 1 root root  4020 feb  3 03:03 dbus.h
-rw-r--r-- 1 root root  6766 feb  3 03:03 dbus-macros.h
-rw-r--r-- 1 root root  2020 feb  3 03:03 dbus-memory.h
-rw-r--r-- 1 root root 15621 feb  3 03:03 dbus-message.h
-rw-r--r-- 1 root root  1869 feb  3 03:03 dbus-misc.h
-rw-r--r-- 1 root root  3868 feb  3 03:03 dbus-pending-call.h
-rw-r--r-- 1 root root 24015 feb  3 03:03 dbus-protocol.h
-rw-r--r-- 1 root root  5471 feb  3 03:03 dbus-server.h
-rw-r--r-- 1 root root  5451 feb  3 03:03 dbus-shared.h
-rw-r--r-- 1 root root  3106 feb  3 03:03 dbus-signature.h
-rw-r--r-- 1 root root  2418 feb  3 03:03 dbus-syntax.h
-rw-r--r-- 1 root root  8564 feb  3 03:03 dbus-threads.h
-rw-r--r-- 1 root root  4839 feb  3 03:03 dbus-types.h

$ pkg-config --cflags --libs dbus-1
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -ldbus-1

$ pkg-config --modversion dbus-1
1.15.8

$ objdump -T /usr/lib64/libdbus-1.so.3

/usr/lib64/libdbus-1.so.3:     file format elf64-x86-64

DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*	0000000000000000  Base        _ITM_deregisterTMCloneTable
0000000000000000  w   D  *UND*	0000000000000000  Base        __gmon_start__
0000000000000000  w   D  *UND*	0000000000000000  Base        _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*	0000000000000000 (GLIBC_2.2.5) __cxa_finalize
0000000000001111 g    DF .text	0000000000000007  Base        dbus_message_unref
0000000000001142 g    DF .text	0000000000000007  Base        dbus_message_ref
00000000000010fc g    DF .text	0000000000000007  Base        dbus_message_iter_get_basic
000000000000120d g    DF .text	0000000000000007  Base        nsLinuxSysTrayHandlerConstructor
000000000000111f g    DF .text	0000000000000007  Base        dbus_message_iter_open_container
00000000000011b9 g    DF .text	0000000000000007  Base        dbus_validate_bus_name
00000000000011ea g    DF .text	0000000000000007  Base        dbus_error_is_set
00000000000011c7 g    DF .text	0000000000000007  Base        dbus_bus_get_private
00000000000011a4 g    DF .text	0000000000000007  Base        dbus_validate_path
00000000000011ab g    DF .text	0000000000000007  Base        dbus_validate_member
00000000000011f1 g    DF .text	0000000000000007  Base        dbus_message_set_no_reply
000000000000112d g    DF .text	0000000000000007  Base        dbus_message_iter_append_basic
0000000000001165 g    DF .text	0000000000000007  Base        dbus_watch_get_unix_fd
0000000000001118 g    DF .text	0000000000000007  Base        dbus_message_iter_next
0000000000001196 g    DF .text	0000000000000007  Base        dbus_connection_set_watch_functions
00000000000010f5 g    DF .text	0000000000000007  Base        dbus_message_iter_get_arg_type
000000000000110a g    DF .text	0000000000000007  Base        dbus_message_iter_get_signature
0000000000001206 g    DF .text	0000000000000007  Base        dbus_connection_flush
000000000000113b g    DF .text	0000000000000007  Base        dbus_message_new_method_call
000000000000115e g    DF .text	0000000000000007  Base        dbus_error_free
0000000000001173 g    DF .text	0000000000000007  Base        dbus_watch_get_flags
000000000000116c g    DF .text	0000000000000007  Base        dbus_watch_get_enabled
0000000000001188 g    DF .text	0000000000000007  Base        dbus_connection_set_exit_on_disconnect
00000000000011f8 g    DF .text	0000000000000007  Base        dbus_connection_send
0000000000001157 g    DF .text	0000000000000007  Base        dbus_error_init
000000000000118f g    DF .text	0000000000000007  Base        dbus_connection_add_filter
00000000000011d5 g    DF .text	0000000000000007  Base        dbus_set_error
0000000000001150 g    DF .text	0000000000000007  Base        dbus_message_iter_init
0000000000001126 g    DF .text	0000000000000007  Base        dbus_message_iter_close_container
00000000000011c0 g    DF .text	0000000000000007  Base        dbus_free
000000000000119d g    DF .text	0000000000000007  Base        dbus_connection_send_with_reply_and_block
0000000000001149 g    DF .text	0000000000000007  Base        dbus_message_get_type
00000000000011dc g    DF .text	0000000000000007  Base        dbus_signature_validate_single
0000000000001181 g    DF .text	0000000000000007  Base        dbus_connection_unref
0000000000001103 g    DF .text	0000000000000007  Base        dbus_message_iter_recurse
0000000000001134 g    DF .text	0000000000000007  Base        dbus_message_iter_init_append
00000000000011ce g    DF .text	0000000000000007  Base        dbus_set_error_from_message
000000000000117a g    DF .text	0000000000000007  Base        dbus_connection_close
00000000000011b2 g    DF .text	0000000000000007  Base        dbus_validate_interface
00000000000011e3 g    DF .text	0000000000000007  Base        dbus_threads_init_default
00000000000011ff g    DF .text	0000000000000007  Base        dbus_connection_get_is_connected
After this, thunderbird compiles without problems; this is the part of the log where the user patch is applied
and where dbus is detected as active, now using --enable-dbus in the ebuild.

Code: Select all

 * ============================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying without-sys_tray.patch ...                   [ ok ]
 * User patches applied.
 * ============================================================

 0:10.77 checking for dbus-1 >= 0.60... yes
 0:10.77 checking MOZ_DBUS_CFLAGS... -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
 0:10.77 checking MOZ_DBUS_LIBS... -ldbus-1

Code: Select all

$ eix -Ic mail-client/thunderbird
[I] mail-client/thunderbird (140.5.0(0/esr)[1]@03/02/26): Thunderbird Mail Client
[1] "repo_local" /usr/local/portage
To energe thunderbird on this pc, it takes more than 1:15h, the way to resume launching from the point where compilation fails is with:

Code: Select all

# ebuild /usr/local/portage/mail-client/thunderbird-140.5.0.ebuild compile
And finally, if the compilation completes successfully, it can be installed with:

Code: Select all

# ebuild /usr/local/portage/mail-client/thunderbird-140.5.0.ebuild merge
In small packages it's not a problem, but with monsters like thunderbird or firefox it's very useful.

Regards.
colo-des
Tux's lil' helper
Tux's lil' helper
Posts: 107
Joined: Fri May 20, 2011 3:51 pm

Post by colo-des »

Update to Thunderbird version 140.7.1 and the method works flawlessly.
Regarding the public knowledge being discussed these days, I came across
this gem, which explains how they want to make DBus mandatory.
Specifically in this part of the video: https://youtu.be/bfj0wzclY0M?t=405

https://www.youtube.com/watch?v=bfj0wzclY0M&t=417s
Linux Distros Respond to Age Verification..

Regards.
Post Reply