Open Bug 1316735 Opened 8 years ago Updated 2 years ago

Relative symlinks in the dist directory

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: nottheoilrig, Unassigned)

References

()

Details

Attachments

(1 file)

I followed these instructions [1] to build Firefox, but when I run it, I get the following error:

> $ ./mach run
> [...]
> XPCOMGlueLoad error for file .../mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/libnssutil3.so:
> .../mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/libnssutil3.so: cannot open shared object file: No such file or directory
> $ 

This happens because mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/libnssutil3.so is an absolute symlink, so if I relocate the source tree to another filesystem location, I get this error.
What do you think about making the symlinks in the dist directory relative instead of absolute?

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build
FWIW, symbolic links are only the tip of the iceberg. There are many things that are not symbolic links and that reference absolute paths.
I'm happy to take a look at the other things, as part of this issue or another.
So far I'm able to successfully run Firefox after addressing just the symlinks.
Comment on attachment 8809624 [details]
Bug 1316735 - Relative symlinks in the dist directory.

https://reviewboard.mozilla.org/r/92148/#review94712

This looks good to me.

I've scheduled a Try build to make sure automation is still happy after this change, just to be on the safe side. If that comes back green, we can land this.
Attachment #8809624 - Flags: review?(gps) → review+
Comment on attachment 8809624 [details]
Bug 1316735 - Relative symlinks in the dist directory.

https://reviewboard.mozilla.org/r/92148/#review94774

This broke a number of unit tests. Changing review flag accordingly.
Attachment #8809624 - Flags: review+ → review-
Comment on attachment 8809624 [details]
Bug 1316735 - Relative symlinks in the dist directory.

https://reviewboard.mozilla.org/r/92148/#review98620

This looks good.

Sorry for the high latency on the review. Holidays and I was traveling all last week. I triggered a Try build on this and will land this if it comes back OK.
Attachment #8809624 - Flags: review?(gps) → review+
Comment on attachment 8809624 [details]
Bug 1316735 - Relative symlinks in the dist directory.

https://reviewboard.mozilla.org/r/92148/#review98620

Great, thank you for reviewing this!
Pushed by gszorc@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/349a316ed0f7
Relative symlinks in the dist directory. r=gps
Backed out in https://hg.mozilla.org/integration/autoland/rev/5945dbd8d20c

Don't know yet how many other builds plan on failing, but Mac static analysis has already failed in packaging, https://treeherder.mozilla.org/logviewer.html#?job_id=7845558&repo=autoland
Status: UNCONFIRMED → NEW
Ever confirmed: true
All Mac builds, and only Mac builds, apparently.
This is likely because we take the contents of $(DIST)/bin as well as some other stuff and create $(DIST)/$(MOZ_MACBUNDLE_NAME) (so like $(DIST)/Firefox.app) by mostly rsyncing the contents of the former to the latter:
https://dxr.mozilla.org/mozilla-central/rev/8103c612b79c2587ea4ca1b0a9f9f82db4b185b8/browser/app/Makefile.in#93

If the symlinks have relative paths they're going to wind up broken. We don't want to copy files here, since that wastes space (and breaks developer expectations). Ideally we'd put the symlinks directly into the bundle paths instead of $(DIST)/bin (bug 1223748) but nobody has fixed that yet.
Thanks for the summary, Ted.

Welcome to the rabbit hole of the Firefox build system, Jack :/
Component: Build Config → General
Product: Firefox → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: