Firefox should allow building without gtk2
Categories
(Firefox Build System :: General, defect)
Tracking
(Root Cause:Infrastructure/Build Error, firefox90 fixed)
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: Marc-Antoine, Assigned: code)
References
Details
Attachments
(4 files, 1 obsolete file)
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 7•7 years ago
|
||
Updated•7 years ago
|
Comment 10•5 years ago
|
||
Perhaps revisit this after bug #1455897 is over with?
Comment 11•5 years ago
|
||
Configuring things so NPAPI is optional is probably about as hard as
removing support entirely; you can get a sense of the scope of the problem
by looking at bug 1381916, which removed ~5k lines of code for a single
platform.
As a preparation for code drop, would make sense to mark NPAPI code with #ifdef and adding build option like --disable-npapi .
Then, at December 2020 can be simply dropped content of #ifdef and build option without additional effort.
Same amount of work will be (earlier) and possible benefit is that people or distribution who doesn't prefer to use flash or/and GTK2 will be able to cut it sooner.
Comment 12•5 years ago
|
||
Well, 2020 is here. Any chance of build able to build ff w/o gtk2 libs now that flash can get EoL?
Comment 13•5 years ago
|
||
Would be thrilled to see gtk2 made optional.
Comment 15•4 years ago
|
||
Depends on: #1661450
Comment 16•4 years ago
|
||
IIUC we can repurpose this bug to simply "Drop remaining GTK2 code", no? AFAIK plugin support was the last remaining user of it.
Comment 17•4 years ago
|
||
Sure
DUP bug 1626103 makes it clear that this bug here breaks building on Ubuntu: GTK 2 is no longer available and installable on Ubuntu 20.04.
Comment 18•4 years ago
|
||
I think this bug can be closed as a duplicate of #1661450
Assignee | ||
Comment 19•4 years ago
|
||
Likely a lot more can be removed but figured starting with the minimum to build without gtk2 makes sense.
Tested with a fresh clobber and it still builds fine.
Comment 20•4 years ago
|
||
Bug 1682030 just removed a whole lot more of NPAPI code - so it's probably a good timing to land this.
Bryan, thanks for the patch! The old review format via patch is not really used any more - can you submit it as phabricator revision using the moz-phab
tool? Simply run moz-phab submit -s
in your hg or git folder.
If it's too much of a struggle to set everything up, I can also submit it for you.
Updated•4 years ago
|
Comment 21•4 years ago
|
||
A tutorial about it: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Comment 22•4 years ago
|
||
b, please use Phabricator for the patch, Thanks.
Updated•4 years ago
|
Assignee | ||
Comment 23•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
Backed out for causing bustage due to missing file. (gtk2/libmozgtk.so)
backout: https://hg.mozilla.org/integration/autoland/rev/ce196f921c311a361711d3b07725adedbde5598a
failure log: https://treeherder.mozilla.org/logviewer?job_id=335803598&repo=autoland&lineNumber=68445
[task 2021-04-08T07:59:59.498Z] 07:59:59 INFO - package> /builds/worker/workspace/obj-build/_virtualenvs/init_py3/bin/python /builds/worker/checkouts/gecko/toolkit/mozapps/installer/packager.py -DPKG_LOCALE_MANIFEST=/builds/worker/workspace/obj-build/browser/installer/locale-manifest.in -DMOZ_APP_NAME=firefox -DPREF_DIR=defaults/preferences -DMOZ_GTK=1 -DJAREXT= -DMOZ_ENABLE_SKIA_PDF=1 -DMOZ_CHILD_PROCESS_NAME=plugin-container -DNECKO_WIFI -DMOZ_BACKGROUNDTASKS=1 -DDLL_PREFIX=lib -DDLL_SUFFIX=.so -DBIN_SUFFIX= -DDIR_MACOS= -DDIR_RESOURCES= -DBINPATH='bin' -DRESPATH='bin' -DLPROJ_ROOT=en -DCLANG_CXX -DLLVM_SYMBOLIZER=llvm-symbolizer -DENABLE_MARIONETTE=1 -DACCESSIBILITY=1 -DATK_MAJOR_VERSION=2 -DATK_MINOR_VERSION=14 -DATK_REV_VERSION=0 -DBROWSER_CHROME_URL=chrome://browser/content/browser.xhtml -DBROWSER_CHROME_URL_QUOTED='"chrome://browser/content/browser.xhtml"' -DBUILD_CTYPES=1 -DCROSS_COMPILE='' -DEARLY_BETA_OR_EARLIER=1 -DEDITLINE=1 -DENABLE_MARIONETTE=1 -DENABLE_REMOTE_AGENT=1 -DENABLE_SHARED_MEMORY=1 -DENABLE_SPIDERMONKEY_TELEMETRY=1 -DENABLE_SYSTEM_EXTENSION_DIRS=1 -DENABLE_TESTS=1 -DENABLE_WASM_EXCEPTIONS=1 -DENABLE_WASM_FUNCTION_REFERENCES=1 -DENABLE_WASM_GC=1 -DENABLE_WASM_MULTI_VALUE=1 -DENABLE_WASM_REFTYPES=1 -DENABLE_WASM_SIMD=1 -DENABLE_WASM_SIMD_WORMHOLE=1 -DENABLE_WASM_TYPE_REFLECTIONS=1 -DFORCE_PR_LOG=1 -DFUNCPROTO=15 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_14 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_42 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_42 -DGL_PROVIDER_EGL=1 -DGTEST_HAS_RTTI=0 -DHAVE_64BIT_BUILD=1 -DHAVE_ALLOCA_H=1 -DHAVE_BYTESWAP_H=1 -DHAVE_CLOCK_MONOTONIC=1 -DHAVE_CPUID_H=1 -DHAVE_DIRENT_H=1 -DHAVE_DLADDR=1 -DHAVE_DLOPEN=1 -DHAVE_FONTCONFIG_FCFREETYPE_H=1 -DHAVE_FTS_H=1 -DHAVE_FT_BITMAP_SIZE_Y_PPEM=1 -DHAVE_FT_GLYPHSLOT_EMBOLDEN=1 -DHAVE_FT_LOAD_SFNT_TABLE=1 -DHAVE_GETCONTEXT=1 -DHAVE_GETOPT_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_GMTIME_R=1 -DHAVE_INTTYPES_H=1 -DHAVE_LCHOWN=1 -DHAVE_LINUX_IF_ADDR_H=1 -DHAVE_LINUX_PERF_EVENT_H=1 -DHAVE_LINUX_QUOTA_H=1 -DHAVE_LINUX_RTNETLINK_H=1 -DHAVE_LOCALECONV=1 -DHAVE_LOCALTIME_R=1 -DHAVE_LSTAT64=1 -DHAVE_LUTIMES=1 -DHAVE_MALLINFO=1 -DHAVE_MALLOC_H=1 -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MEMALIGN=1 -DHAVE_MEMMEM=1 -DHAVE_NETINET_IN_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_POSIX_FALLOCATE=1 -DHAVE_POSIX_MEMALIGN=1 -DHAVE_PTHREAD_H=1 -DHAVE_RES_NINIT=1 -DHAVE_SETPRIORITY=1 -DHAVE_STAT64=1 -DHAVE_STATFS=1 -DHAVE_STATFS64=1 -DHAVE_STATVFS=1 -DHAVE_STATVFS64=1 -DHAVE_STDINT_H=1 -DHAVE_STRERROR=1 -DHAVE_STRNDUP=1 -DHAVE_SYSCALL=1 -DHAVE_SYS_MOUNT_H=1 -DHAVE_SYS_QUEUE_H=1 -DHAVE_SYS_QUOTA_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_THREAD_TLS_KEYWORD=1 -DHAVE_TRUNCATE64=1 -DHAVE_UNISTD_H=1 -DHAVE_VALGRIND_VALGRIND_H=1 -DHAVE_VALLOC=1 -DHAVE_VA_COPY=1 -DHAVE_VA_LIST_AS_ARRAY=1 -DHAVE_VISIBILITY_ATTRIBUTE=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE__UNWIND_BACKTRACE=1 -DHAVE___CXA_DEMANGLE=1 -DJS_64BIT=1 -DJS_CODEGEN_X64=1 -DJS_DEFAULT_JITREPORT_GRANULARITY=3 -DJS_HAS_CTYPES=1 -DJS_HAS_INTL_API=1 -DJS_PUNBOX64=1 -DJS_TRACE_LOGGING=1 -DMALLOC_H='<malloc.h>' -DMALLOC_USABLE_SIZE_CONST_PTR='' -DMOZILLA_UAVERSION='"89.0"' -DMOZILLA_VERSION='"89.0a1"' -DMOZILLA_VERSION_U=89.0a1 -DMOZ_AARCH64_JSCVT=0 -DMOZ_ACCESSIBILITY_ATK=1 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OZ_UPDATE_CHANNEL=default -DMOZ_USER_DIR='".mozilla"' -DMOZ_USING_WASM_SANDBOXING=1 -DMOZ_VALGRIND=1 -DMOZ_VERIFY_MAR_SIGNATURE=1 -DMOZ_VORBIS=1 -DMOZ_WASM_SANDBOXING_GRAPHITE=1 -DMOZ_WASM_SANDBOXING_OGG=1 -DMOZ_WAYLAND=1 -DMOZ_WEBM_ENCODER=1 -DMOZ_WEBRTC=1 -DMOZ_WEBRTC_ASSERT_ALWAYS=1 -DMOZ_WEBRTC_SIGNALING=1 -DMOZ_WEBSPEECH=1 -DMOZ_WEBSPEECH_TEST_BACKEND=1 -DMOZ_WIDGET_GTK=1 -DMOZ_X11=1 -DMOZ_XUL=1 -DNECKO_WIFI=1 -DNIGHTLY_BUILD=1 -DNO_NSPR_10_SUPPORT=1 -DNS_PRINTING=1 -DNS_PRINT_PREVIEW=1 -DSTATIC_JS_API=1 -DSTDC_HEADERS=1 -DTARGET_XPCOM_ABI='"x86_64-gcc3"' -DUSE_SKIA=1 -DU_STATIC_IMPLEMENTATION=1 -DU_USING_ICU_NAMESPACE=0 -DVA_COPY=va_copy -DWASM_PRIVATE_REFTYPES=1 -DXP_LINUX=1 -DXP_UNIX=1 -D_REENTRANT=1 -DAB_CD=en-US \
[task 2021-04-08T07:59:59.498Z] 07:59:59 INFO - package> --format omni \
[task 2021-04-08T07:59:59.498Z] 07:59:59 INFO - package> --removals /builds/worker/checkouts/gecko/browser/installer/removed-files.in \
[task 2021-04-08T07:59:59.498Z] 07:59:59 INFO - package> \
[task 2021-04-08T07:59:59.498Z] 07:59:59 INFO - package> \
[task 2021-04-08T07:59:59.499Z] 07:59:59 INFO - package> --minify \
[task 2021-04-08T07:59:59.499Z] 07:59:59 INFO - package> \
[task 2021-04-08T07:59:59.499Z] 07:59:59 INFO - package> \
[task 2021-04-08T07:59:59.499Z] 07:59:59 INFO - package> --compress none \
[task 2021-04-08T07:59:59.499Z] 07:59:59 INFO - package> /builds/worker/checkouts/gecko/browser/installer/package-manifest.in '../../dist' '../../dist'/firefox \
[task 2021-04-08T07:59:59.499Z] 07:59:59 INFO - package>
[task 2021-04-08T07:59:59.499Z] 07:59:59 ERROR - package> Error: $SRCDIR/browser/installer/package-manifest.in:108: Missing file(s): bin/gtk2/libmozgtk.so
[task 2021-04-08T07:59:59.499Z] 07:59:59 ERROR - package> Traceback (most recent call last):
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> File "/builds/worker/checkouts/gecko/toolkit/mozapps/installer/packager.py", line 300, in <module>
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> main()
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> File "/builds/worker/checkouts/gecko/toolkit/mozapps/installer/packager.py", line 257, in main
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> copier.add(mozpath.join(respath, "removed-files"), removals)
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> File "/usr/lib/python3.7/contextlib.py", line 119, in __exit__
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> next(self.gen)
[task 2021-04-08T07:59:59.500Z] 07:59:59 INFO - package> File "/builds/worker/checkouts/gecko/python/mozbuild/mozpack/errors.py", line 132, in accumulate
[task 2021-04-08T07:59:59.501Z] 07:59:59 INFO - package> raise AccumulatedErrors()
[task 2021-04-08T07:59:59.501Z] 07:59:59 INFO - package> mozpack.errors.AccumulatedErrors
[task 2021-04-08T07:59:59.501Z] 07:59:59 ERROR - package> make[5]: *** [/builds/worker/checkouts/gecko/toolkit/mozapps/installer/packager.mk:25: stage-package] Error 1
Comment 26•4 years ago
|
||
So, I'm almost done with a more thorough patch, but I'm hitting a problem with BFD ld not liking the weak symbol for atk_bridge_adaptor_init
. That was done back in bug 1138845 because of reasons essentially outlined in bug 1110211 comment 7 and following. Things have evolved since, though: we require Gtk+ 3.14. Gtk+ has been requiring atk-bridge since 3.6 but still had an option to disable it at build time until 3.10, at which point it became always enabled.... when building Gtk+ with the X11 backend. Martin, what's the Atk story with the wayland backend? Does a11y just not work with gtk3 running with the wayland backend? Would it be a problem if we hard-depend on atk-bridge? (I suspect it might be a problem for the people who use a gtk3 with only the wayland backend enabled?)
Comment 27•4 years ago
|
||
I don't know about atk-bridge/Wayland but I'm sure gtk3 build with Wayland backend only may be a very rare and seen on Gentoo custom builds only. You may run Gtk/Wayland applications without XWayland which is supported and XWayland is started on demand when a Gtk application asks for it, but that still needs Gtk with X11 backend enabled.
AFAIK we don't even support to build Firefox wihout X11 backend (or when X11 backend is disabled by Gtk) so I think it's safe to depend on atk-bridge as we depend on other X11/Gtk libraries.
Comment 28•4 years ago
|
||
I really hope X isn't mandatory for firefox (running a wayland only gentoo build as you pointed out).. It would additionally block https://bugzilla.mozilla.org/show_bug.cgi?id=1661450 which aims to support just that
Comment 29•4 years ago
|
||
Currently, we use a weak symbol to call atk_bridge_adaptor_init, but for
some reason, this stops working when removing the mozgtk stub library
(which we can do now that we don't need gtk+2 support at all), in a way
similar to bug 1368363.
We've been using a weak symbol because atk-bridge 2.0 was not guaranteed
to be enabled in gtk+3 back when this was added, but things have changed
since then, and gtk+3 always requires atk-bridge 2.0... ... on X11.
Unfortunately, that's not the case on Wayland, and a gtk+3 built with
Wayland support only will not depend on atk-bridge 2.0. So all in all,
we're back to square one, and because this fails to build, we need
another approach.
It turns out that other approach was in place for gtk+2, in the form of
dlopen/dlsym, the code for which somehow survived the years despite
libatk-bridge.so not having been a thing for years, and despite Firefox
itself not actually using gtk+2 for accessibility.
So we repurpose that code to load atk-bridge 2.0.
Comment 30•4 years ago
|
||
Comment 31•4 years ago
|
||
Comment 32•4 years ago
|
||
Comment 33•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/44d676a26d1a
https://hg.mozilla.org/mozilla-central/rev/0ce69d9f596b
https://hg.mozilla.org/mozilla-central/rev/f8eb1926bfdb
Comment 34•4 years ago
|
||
Comment 35•4 years ago
|
||
Mike, this unfortunately broke the Wayland backend (we really need to get the CI for it in place).
glxtest: Could not connect to wayland socket
The issue appears to be that wl_display_connect
(and all other Wayland API) now uses the stubs in mozwayland.c. Normally the proper symbols where loaded via Gtk3 IIUC. Can you look into it?
Martin, also NIing you here.
Comment 36•4 years ago
|
||
(In reply to Robert Mader [:rmader] from comment #35)
The issue appears to be that
wl_display_connect
(and all other Wayland API) now uses the stubs in mozwayland.c. Normally the proper symbols where loaded via Gtk3 IIUC. Can you look into it?
Fix in bug 1706452
Updated•4 years ago
|
Description
•