Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UWP build fails if both VS2017 and VS2019 are installed #25845

Open
asajeffrey opened this issue Feb 25, 2020 · 11 comments
Open

UWP build fails if both VS2017 and VS2019 are installed #25845

asajeffrey opened this issue Feb 25, 2020 · 11 comments

Comments

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Feb 25, 2020

Doing a UWP build when both VS2017 and VS2019 are installed can fail:

   Compiling simpleservo_capi v0.0.1 (C:\Users\ajeffrey\github\asajeffrey\servo\ports\libsimpleservo\capi)
error: linking with `lld-link.exe` failed: exit code: 1
  |
  = note: "lld-link.exe" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64\\store"
...

Most of the build uses the 2019 build environment, but rustc's linker uses the 2017 LIBPATH, which causes link errors such as:

          lld-link: error: undefined symbol: __CxxFrameHandler4
          >>> referenced by libfontsan-0dc9c0455f62c486.rlib(woff2_dec.obj):($unwind$??$_Emplace_reallocate@PEAUTable@woff2@@@?$vector@PEAUTable@woff2@@V?$allocator@PEAUTable@woff2@@@std@@@std@@QEAAPEAPEAUTable@woff2@@QEAPEAU23@$$QEAPEAU23@@Z)

Uninstalling VS2017 fixes the problem, but that's not ideal.

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Feb 26, 2020

I don't have this issue. And I have both 2017 and 2019 installed.
But I build with 2017, not 2019.

I'm actually surprised to hear that it builds with 2019 at all.

@asajeffrey
Copy link
Member Author

@asajeffrey asajeffrey commented Feb 26, 2020

That's what the --features vslatestinstalled is for!

@rib
Copy link
Contributor

@rib rib commented Apr 29, 2020

Just to mention that I've hit this same build issue, although this is after I resolved an earlier build issue by ensuring I had VS2017 installed so I don't expect uninstalling VS2017 is going to fix my build. Uninstalling VS2019 would also be really awkward.

@jdm
Copy link
Member

@jdm jdm commented Apr 29, 2020

Our CI builds without any trace of 2017. only 2029 is a supported configuration at this point.

@rib
Copy link
Contributor

@rib rib commented Apr 29, 2020

ok, I'll try again after removing VS2017. The issue might have come from something being out-of-date from the last time I experimented with Servo earlier in the year.

@rib
Copy link
Contributor

@rib rib commented Apr 29, 2020

@jdm can you maybe point me at how the CI handles Windows builds since I'm currently stuck with build problems here. I've completely scrubbed my repo (git clean -xdf) and uninstalled VS2017 + VS2017 build tools from my system and now with ./mach build --dev I'm getting a build failure at:

checking for 64-bit OS... yes
checking for Windows SDK... 0x0a00 in 'C:\Program Files (x86)\Windows Kits\10\'
checking for Universal CRT SDK... 10.0.18362.0 in 'C:\Program Files (x86)\Windows Kits\10\'
checking for the Debug Interface Access SDK... C:\PROGRA~2\MICROS~1\2019\BUILDT~1\DIA SDK

</snip>

INFO: 0x0a00 in 'C:\Program Files (x86)\Windows Kits\10\'
INFO: checking for Universal CRT SDK...
INFO: 10.0.18362.0 in 'C:\Program Files (x86)\Windows Kits\10\'
INFO: checking for the Debug Interface Access SDK...
INFO: C:\PROGRA~2\MICROS~1\2019\BUILDT~1\DIA SDK
ERROR: Cannot find the ATL/MFC headers in the Visual C++ directory (C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1425~1.286). Please install them.

--- stderr
which: python2.7: unknown command
ERROR: Cannot find the ATL/MFC headers in the Visual C++ directory (C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1425~1.286). Please install them.
mozmake: *** [C:\Users\Robert\.cargo\git\checkouts\mozjs-fa11ffc7d4f1cc2d\9a6d8fc\makefile.cargo:194: maybe-configure] Error 1
thread 'main' panicked at 'assertion failed: result.success()', C:\Users\Robert\.cargo\git\checkouts\mozjs-fa11ffc7d4f1cc2d\9a6d8fc\build.rs:177:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I can see that there used to be an appveyor.yml that built with VS2017 removed in November last year but couldn't see where CI for windows was handled now.

As far as I can tell I do have ATL/MFC headers installed with VS2019 so not exactly sure what the real failure is here - maybe I have the wrong version of these installed? Also seems odd seeing the which: python2.7: unknown command error here when which is a Linux command (hopefully that one is a benign error and it's the issue with the headers that's the main problem).

This was the original build issue I hit that prompted me to make sure I had VS2017 installed according to the README.md instructions.

@jdm
Copy link
Member

@jdm jdm commented Apr 29, 2020

When I've seen the ATL/MFC error, I was missing the appropriate components from the VS installer. This is the list of components and workloads that we install in VS on CI, which corresponds with the list at https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019.

@rib
Copy link
Contributor

@rib rib commented Apr 29, 2020

Ah it looks like I only had MFC/ATL headers installed for Visual Studio itself not for the build tools. Now that I've installed these headers for the build tools I've got past the above build failure. Still could be helpful to know where the CI for Windows is configured to have an authorative reference to compare with the README instructions.

@rib
Copy link
Contributor

@rib rib commented Apr 29, 2020

oops I hadn't refreshed this issue to see your latest comment but thanks for the pointer!

@rib
Copy link
Contributor

@rib rib commented Apr 29, 2020

Incidentally then, it looks like CI does use VS2017 build tools since that script fetches the version 15 build tools installer from: "https://aka.ms/vs/15/release/vs_buildtools.exe"? At least when I fetched the same installer and used the same options from the windows-first-boot.ps1 script it started installing the VS2017 tools on my machine. If the /16/ release is fetched instead that seems to correspond to VS2019 build tools.

Either way my build (with the VS2019 build tools) has completed now, yay :) thanks again for the pointer.

@jdm
Copy link
Member

@jdm jdm commented Apr 29, 2020

Oh, we haven't merged servo/taskcluster-config#27 yet, but that's what is actually deployed on CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.