-
Notifications
You must be signed in to change notification settings - Fork 71
Building aws-lc-sys under MSVC is brittle #780
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
Comments
Regarding the broken CMake compiler detection, here's the associated build log: https://gitlab.freedesktop.org/amyspark/cerbero/-/jobs/74700636 Snippet
|
Our build should succeed with whichever generator is automatically selected by This potentially could be an issue we could file with cmake-rs were it failing to locate require build tooling in an environment where it should be able to.
I'm not sure this is fixable given that the crypto operations in AWS-LC are written in C/Assembly. I'm assuming that compiling C-code to an |
Hi @justsmth !
The build context is enough, we're already running under a developer shell. For some reason CMake (not cmake-rs) breaks down when trying to initialize the shell again, which happens when forcing the VS2022 generator as is currently done.
Preferring Ninja would aid in debugging build failures, as the compiler line gets printed upon failure. It is easy to detect the developer shell and do so too, as in the linked CMake code.
We build both for MSVC and for MinGW. The MinGW build is prone to failure for multiple reasons: apart from the PATH_MAX issue, the use of Makefiles means also a hard require for a MSYS2 environment or similar. The workaround here was to force Ninja (as we have it available for all OSes, and we run with appropriate PATH entries set for each compiler) and compress the path to make extra space.
The workaround was meant only to support CMake's setup process, while also C/Assembly works just fine, we have been able to continue targeting all platforms even with the recent changes, and NASM compilation has not introduced any issues either. |
Problem:
During the past few days, I've been wrestling build issues around upstream crates switching to aws-lc-rs.
This particular report concerns aws-lc-sys's usage of MSVC inside Docker:
cmake-rs
does not consider whether we are already running inside a developer shell ie. doesn't set any generator. In particular, leavingcmake-rs
to its own devices results in CMake settingVisual Studio 17 2022
as generator, and with our Build Tools installed in a non-standard location, results in a build failure.CMAKE_GENERATOR
environment variable toNinja
, possibly after detecting the presence of these variables: https://github.com/Kitware/CMake/blob/7c15231c4fdcd58816f7d584db8edee7445cd15e/Source/cmVSSetupHelper.cxx#L417-L419PATH_MAX
Relevant details
AWS-LC for Rust versions or commit: 0.28.0
System information: for linux, below info can be collected by running
uname -srvmp
Build log: https://gitlab.freedesktop.org/amyspark/cerbero/-/jobs/74703026#L678
Snippet
The text was updated successfully, but these errors were encountered: