Closed Bug 1797714 Opened 2 years ago Closed 2 years ago

undefined references to tabs_4d51_TabsBridgedEngine_* and tabs_4d51_TabsStore_*

Categories

(Toolkit :: UniFFI Bindings, defect)

Firefox 108
Other
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1805809
Tracking Status
firefox-esr102 --- unaffected
firefox106 --- unaffected
firefox107 --- unaffected
firefox108 --- wontfix
firefox109 --- fixed
firefox110 --- fixed

People

(Reporter: dan, Unassigned)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [fxsync-])

An update in the last day is causing build/linking failure on s390x due undefined references to tabs_4d51_TabsBridgedEngine_* and tabs_4d51_TabsStore_* in the final phase.

...
toolkit/library/build/libxul.so
rm -f libxul.so
/usr/bin/g++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-sized-deallocation -fno-aligned-new -g1 -fno-exceptions -fPIC -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -freorder-blocks -O2 -fno-omit-frame-pointer -funwind-tables  -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so /home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/toolkit/library/build/libxul_so.list   -lpthread -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -fstack-protector-strong -Wl,-rpath-link,/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/bin -Wl,-rpath-link,/usr/local/lib  ../../../security/nss/lib/crmf/crmf_crmf/libcrmf.a ../../../js/src/build/libjs_static.a /home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/s390x-unknown-linux-gnu/release/libgkrust.a ../../../config/external/nspr/pr/libnspr4.so ../../../config/external/nspr/libc/libplc4.so ../../../config/external/nspr/ds/libplds4.so ../../../config/external/lgpllibs/liblgpllibs.so ../../../security/nss/lib/nss/nss_nss3/libnss3.so ../../../security/nss/lib/util/util_nssutil3/libnssutil3.so ../../../security/nss/lib/smime/smime_smime3/libsmime3.so ../../../config/external/sqlite/libmozsqlite3.so ../../../security/nss/lib/ssl/ssl_ssl3/libssl3.so ../../../widget/gtk/mozgtk/libmozgtk.so ../../../widget/gtk/mozwayland/libmozwayland.so -Wl,--version-script,symverscript  -lasound -lpthread -ldl -lc -L/usr/lib64/../lib64 -lffi -lm -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lrt -ldbus-glib-1 -ldbus-1 -lxcb-shm -lX11-xcb -lX11 -lxcb -lXext -lXrandr
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_new'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_new'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_get_all'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:132: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_reset'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:128: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_sync_finished'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:120: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_apply'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:116: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_store_incoming'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:112: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_sync_started'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:108: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_prepare_for_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:100: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_reset_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:96: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:76: error: undefined reference to 'tabs_4d51_TabsStore_reset'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:72: error: undefined reference to 'tabs_4d51_TabsStore_register_with_sync_manager'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:136: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_wipe'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_set_local_tabs'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_set_local_tabs'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_last_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_set_uploaded'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_set_uploaded'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_set_last_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsStore_bridged_engine'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_ensure_current_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:78: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_ensure_current_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:236: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_reset'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:231: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_sync_finished'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_set_uploaded'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:221: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_apply'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:216: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_store_incoming'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:211: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_sync_started'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:206: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_prepare_for_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_ensure_current_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:196: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_reset_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:191: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_sync_id'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_set_last_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_last_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsStore_bridged_engine'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsStore_sync'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsStore_set_local_tabs'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:166: error: undefined reference to 'tabs_4d51_TabsStore_reset'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsStore_new'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:241: error: undefined reference to 'tabs_4d51_TabsBridgedEngine_wipe'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/dist/include/mozilla/dom/ScaffoldingCall.h:198: error: undefined reference to 'tabs_4d51_TabsStore_get_all'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp:161: error: undefined reference to 'tabs_4d51_TabsStore_register_with_sync_manager'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/toolkit/library/build/../../components/uniffi-js/Unified_cpp_uniffi-js0.o:Unified_cpp_uniffi-js0.cpp:mozilla::uniffi::kTabsTabsStorePointerType: error: undefined reference to 'ffi_tabs_4d51_TabsStore_object_free'
/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/toolkit/library/build/../../components/uniffi-js/Unified_cpp_uniffi-js0.o:Unified_cpp_uniffi-js0.cpp:mozilla::uniffi::kTabsTabsBridgedEnginePointerType: error: undefined reference to 'ffi_tabs_4d51_TabsBridgedEngine_object_free'
collect2: error: ld returned 1 exit status
gmake[4]: *** [/home/jenkins/workspace/Firefox-default/label/s390x/firefox/config/rules.mk:540: libxul.so] Error 1
gmake[4]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu/toolkit/library/build'
gmake[3]: *** [/home/jenkins/workspace/Firefox-default/label/s390x/firefox/config/recurse.mk:72: toolkit/library/build/target] Error 2
gmake[3]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu'
gmake[2]: *** [/home/jenkins/workspace/Firefox-default/label/s390x/firefox/config/recurse.mk:34: compile] Error 2
gmake[2]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu'
gmake[1]: *** [/home/jenkins/workspace/Firefox-default/label/s390x/firefox/config/rules.mk:361: default] Error 2
gmake[1]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/s390x/firefox/obj-s390x-ibm-linux-gnu'
gmake: *** [client.mk:63: build] Error 2

probably related to bug #1791851

Regressed by: 1791851

the build from "Bug 1796758 - Don't try to use waitid on OpenBSD. r=nika" (f9aff9e98efcaef74c32887aaa266799e2efce31) is OK, with patches from 1791851 it fails

Based on bug 1791851 I believe this belongs to Sync.

Component: General → Sync
Product: Core → Firefox

Set release status flags based on info from the regressing bug 1791851

:skhamis, since you are the author of the regressor, bug 1791851, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Component: Sync → UniFFI Bindings
Flags: needinfo?(skhamis)
Product: Firefox → Toolkit
Whiteboard: [fxsync-]
Version: unspecified → Firefox 108
Assignee: nobody → skhamis

Thanks for making the report. Technically it was caused by Sync landing a patch but it was using the underlying UniFFI to generate the bindings so moving it to the toolkit this is a build failure.

Since this is not happening on central, I'll start with some baseline to see where the issue is:

  1. Are you using mach to build? Seeing the command rm -f libxul.so raises some questions about what the script is running
  2. Is there any specific mozconfig options that are used here?
  3. Is there a way for us to reliably repro this? (a try command or anything) so we can see the more detailed logs of why it's not being built?

If s390x is using some custom scripts/builds -- the UniFFi work was tracked in this bug https://bugzilla.mozilla.org/show_bug.cgi?id=1766045 which may give insight of any specific script/build changes that will need to happen for s390x

Flags: needinfo?(dan)

(In reply to Sammy Khamis [:skhamis] from comment #5)

Thanks for making the report. Technically it was caused by Sync landing a patch but it was using the underlying UniFFI to generate the bindings so moving it to the toolkit this is a build failure.

Since this is not happening on central, I'll start with some baseline to see where the issue is:

  1. Are you using mach to build? Seeing the command rm -f libxul.so raises some questions about what the script is running

yes, mach build is used

  1. Is there any specific mozconfig options that are used here?

the .mozconfig is pretty minimal

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
export PATH=/home/jenkins/.cargo/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin

ac_add_options --enable-linker=gold
ac_add_options --without-wasm-sandboxed-libraries
export CFLAGS=-g1
export CXXFLAGS=-g1
export RUSTFLAGS="-Cdebuginfo=1"
  1. Is there a way for us to reliably repro this? (a try command or anything) so we can see the more detailed logs of why it's not being built?

right now I am doing a local build on my Fedora/s390x machine

If s390x is using some custom scripts/builds -- the UniFFi work was tracked in this bug https://bugzilla.mozilla.org/show_bug.cgi?id=1766045 which may give insight of any specific script/build changes that will need to happen for s390x

I think this should be some buildsystem mis-configuration issue, like skipping s390x (or big endian platforms or ...) for some reason, I will look closer on the patches from bug 1791851 and from 1766045 as well

Flags: needinfo?(dan)

Similar issue on Solaris SPARC:

146:03.46 Undefined                     first referenced
146:03.46  symbol                           in file
146:03.47 tabs_4d51_TabsBridgedEngine_set_uploaded ../../components/uniffi-js/Unified_cpp_uniffi-js0.o  (symbol scope specifies local binding)
146:03.47 tabs_4d51_TabsBridgedEngine_set_last_sync ../../components/uniffi-js/Unified_cpp_uniffi-js0.o  (symbol scope specifies local binding)
146:03.47 tabs_4d51_TabsStore_register_with_sync_manager ../../components/uniffi-js/Unified_cpp_uniffi-js0.o  (symbol scope specifies local binding)
..
146:03.50 ld: fatal: symbol referencing errors
146:09.63 collect2: error: ld returned 1 exit status
146:09.64 gmake[4]: *** [/builds2/psumbera/mozilla-central-build/config/rules.mk:540: libxul.so] Error 1

(In reply to Petr Sumbera from comment #7)

Similar issue on Solaris SPARC:

The first bad revision is:
changeset: 639262:6b591feffdb3
user: Sammy Khamis <skhamis@mozilla.com>
date: Tue Oct 25 13:03:22 2022 -0700
description:
Bug 1791851 - Add tabs as a uniffi component r=teshaq,LougeniaBailey,bdk

Differential Revision: https://phabricator.services.mozilla.com/D157979

I am not very familiar with the Rust buildsystem, but it looks to me that it simply skips the Tabs module (crate?) when compiling the Rust code from third_party/rust. There is no tabs-$hash directory in obj-s390x-ibm-linux-gnu/s390x-unknown-linux-gnu/release/incremental, but there is obj-s390x-ibm-linux-gnu/s390x-unknown-linux-gnu/release/build/tabs-1236483eb50f9367. Is there any condition that control when Tabs will be built?

interestingly, running
nm obj-s390x-ibm-linux-gnu/s390x-unknown-linux-gnu/release/libgkrust.a | grep TabsStore
returns

0000000000000000 T tabs_af8e_TabsStore_bridged_engine
0000000000000000 T tabs_af8e_TabsStore_get_all
0000000000000000 T tabs_af8e_TabsStore_new
0000000000000000 T tabs_af8e_TabsStore_register_with_sync_manager
0000000000000000 T tabs_af8e_TabsStore_reset
0000000000000000 T tabs_af8e_TabsStore_set_local_tabs
0000000000000000 T tabs_af8e_TabsStore_sync

So the undefined functions/methods are there, but with the a different "id" (af8e vs 4d51) ...

I have reproduced the failure on our public s390x machine, where I can provide access if needed.

This all points to a different version of uniffi, but I don't see how that could happen accidentally. The references to these symbols comes from toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp, which is generated, but checked in. Does executing ./mach uniffi generate cause this file to change and have the correct hashes?

yes, it fixes the problem. It makes me think it might be an endianess problem in the generator ...

The diff looks like

diff --git a/toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm b/toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm
index 74e528a7635..27f765e933b 100644
--- a/toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm
+++ b/toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm
@@ -323,7 +323,7 @@ class TabsBridgedEngine {
     const liftError = (data) => FfiConverterTypeTabsError.lift(data);
     const functionCall = () => {
         return UniFFIScaffolding.callAsync(
-            7, // tabs:tabs_4d51_TabsBridgedEngine_last_sync
+            7, // tabs:tabs_af8e_TabsBridgedEngine_last_sync
             FfiConverterTypeTabsBridgedEngine.lower(this),
         )
     }
...

Definitely looks like endianess problem. Solars Intel compiles just fine while Solaris SPARC fails...

It certainly seems like it. Thanks for tracking this down. I just opened an issue in UniFFI for this: https://github.com/mozilla/uniffi-rs/issues/1393.

What is the priority on this one? If all big-endian builds are failing it seems pretty high-priority to me, but I'm not sure.

I believe it's all big endian arches, I would expect big endian ppc64 BSD teams will report the same issue soon. Not sure if there are other active big endian platforms there. There is a workaround available, thus I would consider it important, but not critical.

Dan, what is the workaround for this bug? Am I missing something?

Flags: needinfo?(dan)

Hi Petr, running ./mach uniffi generate before ./mach build should do it. My CI jobs are still running, but it should help. I have run those in a standalone build.

Flags: needinfo?(dan)

The severity field is not set for this bug.
:teshaq, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(teshaq)
Severity: -- → S3
Flags: needinfo?(teshaq)

Set release status flags based on info from the regressing bug 1791851

Duplicate of this bug: 1800859

I can confirm running mach uniffi generate before mach build fixes the problem when building the firefox snap on armhf (originally reported as bug 1800859).
Is this a mere workaround, or a reasonable expectation when building firefox?

This is a workaround. The best fix is to have this stuff generated at build time, which we hope to work out how to do soonish.

This is a workaround until we're able to get UniFFi generating the bindings at compile time (rather than checking it in).

Assignee: skhamis → nobody

(In reply to Dan Horák from comment #17)

I believe it's all big endian arches, I would expect big endian ppc64 BSD teams will report the same issue soon. Not sure if there are other active big endian platforms there. There is a workaround available, thus I would consider it important, but not critical.

Indeed, same error here on FreeBSD/powerpc64.

What files exactly need to be regenerated? FreeBSDs poudriere builds packages inside jails that dont have Internet access (meaning all the files must be download before the build process). I'd like to save the files I regenerated to copy them before build starts.

Is it just toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp and toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm? They are the only ones mentioning tabs_af8e.

More generally, anything under toolkit/components/uniffi-bindgen-gecko-js/components/generated. They are generated by ./mach generate uniffi and that command does not need internet access to work - everything it needs is in the tree.

oops, ./mach uniffi generate

Not really, it needs Internet access. Running mach uniffi generate prints:
Collecting glean-sdk==51.8.2
Downloading glean-sdk-51.8.2.tar.gz (2.3 MB)
|████████████████████████████████| 2.3 MB 1.4 MB/s

oh, right, yeah, that's unfortunate.

And there is not only a difference between big and little endian platforms, but for example 32-bit ARM (at least in Fedora 36) is also affected adding a 3rd hash. See the diff below after regenerating the bindings.

--- firefox-108.0.orig/toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm	2022-12-08 16:27:29.000000000 +0000
+++ firefox-108.0/toolkit/components/uniffi-bindgen-gecko-js/components/generated/RustTabs.jsm	2022-12-15 16:52:27.006676292 +0000
@@ -328,7 +328,7 @@ class TabsBridgedEngine {
     const liftError = (data) => FfiConverterTypeTabsError.lift(data);
     const functionCall = () => {
         return UniFFIScaffolding.callAsync(
-            7, // tabs:tabs_4d51_TabsBridgedEngine_last_sync
+            7, // tabs:tabs_1c79_TabsBridgedEngine_last_sync
             FfiConverterTypeTabsBridgedEngine.lower(this),
         )
     }
...
See Also: → 1805809
Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1805809
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.