Closed Bug 1290040 Opened 3 years ago Closed 3 years ago

"The linker major version, , does not match the compiler suite version, 14." under msys2

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox51 fixed)

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(3 files)

With the patches from bug 1289949 and bug 1290026 applied, we should be close to being able to do a full build with msys2 without setting PATHs and such, but at the moment it still fails during configure with the message in the bug summary.

The reason this happens is that contrary to mozilla-build, msys2 comes with a link.exe tool in /usr/bin, from GNU coreutils, conflicting with MSVC's link.exe. The way the PATH is set with the autodetection from bug 1289286, /usr/bin always ends up before MSVC's detected path (because we actually want any MSVC that was in the PATH prior to our autodetection to still be used).
Now that check_prog, through find_program, returns paths that the build
system can handle, we don't need MT to just be "mt.exe".

However, we still need the PATH to be altered for the other tools we're
not checking in python configure yet (e.g. midl). We also still need
PATH altered for the compiler itself, because for e.g. the amd_x86
version, a necessary DLL is in the amd directory, which means PATH
always needs to be altered for cl.exe.

Review commit: https://reviewboard.mozilla.org/r/68086/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/68086/
This ensures we have a full path to link.exe from MSVC in LD, avoiding
to use /usr/bin/link on msys2.

Review commit: https://reviewboard.mozilla.org/r/68088/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/68088/
Comment on attachment 8776182 [details]
Bug 1290040 - Make find_program return short paths automatically when paths contain spaces on Windows.

https://reviewboard.mozilla.org/r/68084/#review65212

::: build/moz.configure/util.configure:74
(Diff revision 1)
> +        def GetShortPathNameW():
> +            wintypes = ctypes.wintypes
> +            GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW
> +            GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR,
> +                                          wintypes.DWORD]
> +            GetShortPathNameW.restype = wintypes.DWORD
> +            return GetShortPathNameW
> +
> +        GetShortPathNameW = GetShortPathNameW()

There are 3 uses for the `GetShortPathNameW` symbol here. This is horrible to read.

Can you eliminate the inline function and just do a `GetShortPathNameW = GetShortPathNameW()` at the end?

::: build/moz.configure/util.configure:75
(Diff revision 1)
> +    # Until the build system can properly handle programs that need quoting,
> +    # transform those paths into their short version on Windows (e.g.
> +    # c:\PROGRA~1...).
> +    if platform.system() == 'Windows':
> +        def GetShortPathNameW():
> +            wintypes = ctypes.wintypes

Apparently this fails on automation...
Attachment #8776182 - Flags: review?(gps) → review-
Comment on attachment 8776183 [details]
Bug 1290040 - Use full path for mt.exe.

https://reviewboard.mozilla.org/r/68086/#review65214
Attachment #8776183 - Flags: review?(gps) → review+
Comment on attachment 8776184 [details]
Bug 1290040 - Find link.exe from python configure.

https://reviewboard.mozilla.org/r/68088/#review65216
Attachment #8776184 - Flags: review?(gps) → review+
Comment on attachment 8776182 [details]
Bug 1290040 - Make find_program return short paths automatically when paths contain spaces on Windows.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68084/diff/1-2/
Attachment #8776182 - Flags: review- → review?(gps)
Comment on attachment 8776183 [details]
Bug 1290040 - Use full path for mt.exe.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68086/diff/1-2/
Comment on attachment 8776184 [details]
Bug 1290040 - Find link.exe from python configure.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68088/diff/1-2/
Comment on attachment 8776182 [details]
Bug 1290040 - Make find_program return short paths automatically when paths contain spaces on Windows.

https://reviewboard.mozilla.org/r/68084/#review65220
Attachment #8776182 - Flags: review?(gps) → review+
Comment on attachment 8776182 [details]
Bug 1290040 - Make find_program return short paths automatically when paths contain spaces on Windows.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68084/diff/2-3/
Comment on attachment 8776183 [details]
Bug 1290040 - Use full path for mt.exe.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68086/diff/2-3/
Comment on attachment 8776184 [details]
Bug 1290040 - Find link.exe from python configure.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68088/diff/2-3/
Comment on attachment 8776182 [details]
Bug 1290040 - Make find_program return short paths automatically when paths contain spaces on Windows.

I do want an additional review, but mozreview won't let me ask for it.
Attachment #8776182 - Flags: review+ → review?(gps)
Comment on attachment 8776182 [details]
Bug 1290040 - Make find_program return short paths automatically when paths contain spaces on Windows.

https://reviewboard.mozilla.org/r/68084/#review65490
Attachment #8776182 - Flags: review?(gps) → review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b42227688f5
Make find_program return short paths automatically when paths contain spaces on Windows. r=gps
https://hg.mozilla.org/integration/mozilla-inbound/rev/ebbc013514ac
Use full path for mt.exe. r=gps
https://hg.mozilla.org/integration/mozilla-inbound/rev/61c7ee616ee5
Find link.exe from python configure. r=gps
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.