Closed Bug 1844538 Opened 3 years ago Closed 3 years ago

build/cargo-linker should use os.system instead of os.execvp to handle apostrophe

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox-esr102 unaffected, firefox-esr115 wontfix, firefox115 wontfix, firefox116 wontfix, firefox117 fixed)

RESOLVED FIXED
117 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- wontfix
firefox115 --- wontfix
firefox116 --- wontfix
firefox117 --- fixed

People

(Reporter: petr.sumbera, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

I do have:

MOZ_CARGO_WRAP_LDFLAGS="-lpthread -Wl,-z,text '-Wl,-R,$ORIGIN'"

when cargo-linker was shell script it worked without problem.

After turning it into python script linker (gcc) is given '-Wl,-R,$ORIGIN' (with apostrohes) which it cannot handle and consider it as object file and tryies to load it.

This can be avoid by using os.system instead of os.execvp:

--- firefox-115.0.3/build/cargo-linker
+++ firefox-115.0.3/build/cargo-linker
@@ -54,5 +54,4 @@ args.append(f"-fsanitize={SANITIZERS[suf
             continue
     args.append(arg)
 
-wrap_ld = wrap_ld.split()
-os.execvp(wrap_ld[0], wrap_ld + args)
+os.system(wrap_ld + " " + ' '.join(args))
Keywords: regression
Regressed by: 1791476

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Firefox Build System

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

For more information, please visit BugBot documentation.

Flags: needinfo?(mh+mozilla)
Assignee: nobody → mh+mozilla
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/087853f0aeda Properly split environment variables in cargo-linker. r=firefox-build-system-reviewers,ahochheiden
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

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

:glandium is this okay to ride the 117 trains? if so, please set 116 to wontfix. If not, just a reminder that RC builds tomorrow.

Flags: needinfo?(mh+mozilla)
Flags: needinfo?(mh+mozilla)

I'm guessing we want this on ESR115 if Petr's reporting it?

Flags: needinfo?(mh+mozilla)

I'm not sure, I feel like that -Wl,-R,$ORIGIN shouldn't even be required in the first place.

Flags: needinfo?(mh+mozilla)

(In reply to Mike Hommey [:glandium] from comment #9)

I'm not sure, I feel like that -Wl,-R,$ORIGIN shouldn't even be required in the first place.

Yes, it's not really required for Firefox itself. I just need this for our packaging system to not complain about library dependencies. Firefox libraries are installed into /usr/lib/firefox which is not default linker search path.

I can live with the patch file for version 115 time being. Thank you for fixing it!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: