Closed Bug 1436255 Opened 2 years ago Closed 2 years ago

Make the vswhere integration play nice with lld-link

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set

Tracking

(firefox60 fixed)

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: dmajor, Assigned: dmajor)

Details

Attachments

(1 file)

Right now, if I do `export LINKER=lld-link` locally, configure fails:

 0:15.87 checking for linker... not found
 0:15.87 DEBUG: linker: Trying lld-link
 0:15.87 ERROR: Cannot find linker

because the vswhere auto-setup has configure looking for lld-link in (only) my MSVC bin directory.

(Process explorer shows: python.exe 2884 QueryOpen C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\Hostx64\x64\lld-link)

This isn't an issue in automation where we hardcode paths rather than using vswhere. As a hackaround I do the same thing on my machine, I stub out `def vc_compiler_path` and set my PATH/INCLUDE/LIB the hard way. It would be great if I didn't have to resort to this.
Try passing a full path as LINKER.
Effectively speaking, I think the only problem here is that we're only looking in the MSVC paths for the LINKER check_prog, and not in $PATH at all.
Yeah that sounds about right. It agrees with my surprising results in process explorer that it was checking only in a single directory and not a search of multiple places.

The full path got me around the LINKER issue but now I just remembered that I'm still left with bug 1402915.
Is this as simple as removing `paths=...` from this line?
link = check_prog('LINKER', ('link.exe',), paths=vc_compiler_path)
(In reply to David Major [:dmajor] from comment #4)
> Is this as simple as removing `paths=...` from this line?
> link = check_prog('LINKER', ('link.exe',), paths=vc_compiler_path)

Or perhaps replacing it with toolchain_search_path?
(In reply to David Major [:dmajor] from comment #5)
> (In reply to David Major [:dmajor] from comment #4)
> > Is this as simple as removing `paths=...` from this line?
> > link = check_prog('LINKER', ('link.exe',), paths=vc_compiler_path)
> 
> Or perhaps replacing it with toolchain_search_path?

Sounds about right.
Attached patch linkerpathSplinter Review
Seems to work. Tested with and without custom LINKER, with and without vswhere auto-detection.
Assignee: nobody → dmajor
Attachment #8949203 - Flags: review?(mh+mozilla)
Attachment #8949203 - Flags: review?(mh+mozilla) → review+
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5d9cab23db67
Allow check_prog('LINKER') to fall back to $PATH. r=glandium
https://hg.mozilla.org/mozilla-central/rev/5d9cab23db67
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.