updater: build on linux with musl libc (no FTS)
Categories
(Toolkit :: Application Update, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox74 | --- | fixed |
People
(Reporter: felix.janda, Assigned: mforney)
References
Details
Attachments
(4 files)
Compilation of the updater fails on linux systems with musl libc (http://musl-libc.org) because the version of add_dir_entries used for Linux in /toolkit/mozapps/update/updater/updater.cpp uses the FTS interface for transversing the file hierarchy and FTS is not supported by musl. On the other hand, with https://bugzilla.mozilla.org/show_bug.cgi?id=674478 the updater was ported to Solaris and a version of add_dir_entries, which uses dirent instead of FTS. dirent is specified in the POSIX standard and in fact the code used by the Solaris version looks portable to most POSIX like systems. In particular it (almost, see patch) compiles also on linux with musl libc. I would like to see whether the Solaris version of add_dir_entries could be used everywhere except for Windows. Perhaps the code needs minor adjustments (like for MAXNAMLEN in the patch), but overall such a change should reduce code duplication.
Comment 1•2 years ago
|
||
If someone provides a patch that works and is ready for review then we can revisit this but until then this is wontfix.
fts.h is also missing on musl. Since the Solaris fallback implementation
does not use any non-standard functions, use that as the fallback
when the FTS interface is not available.
PATH_MAX and NAME_MAX are both POSIX standard macros available in
limits.h, so use them instead of MAXPATHLEN and MAXNAMLEN.
Depends on D61407
Updated•1 year ago
|
I submitted a couple patches for review which essentially do as Felix Janda suggested. The first patch adds a configure check for the fts.h header, and then makes the FTS implementation conditional on the availability of that header, falling back to the readdir version if it is not. The second patch switches to the PATH_MAX and NAME_MAX macros instead of MAXPATHLEN and MAXNAMLEN.
Prevent leaking actions when Parse() fails.
Remove store of rv which is never read.
Pushed by mhowell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7758b0ec9fca Fix pre-existing reviewbot issues in add_dir_entries r=mhowell https://hg.mozilla.org/integration/autoland/rev/7c6f9f854cfc Use portable add_dir_entries() implementation when fts.h is missing r=mhowell https://hg.mozilla.org/integration/autoland/rev/12788bbdf6bf Use portable path/filename size limit macros r=mhowell
Comment 7•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7758b0ec9fca
https://hg.mozilla.org/mozilla-central/rev/7c6f9f854cfc
https://hg.mozilla.org/mozilla-central/rev/12788bbdf6bf
Description
•