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

vcvarsall.bat can make very large env #435

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

justinwsmith
Copy link
Contributor

@justinwsmith justinwsmith commented Jun 6, 2024

Description of changes:

  • Windows/FIPS builds invoke vcvarsall.bat to acquire the environment variables required for a build. The environment is parsed from the output of printenv.bat.
  • On some hosts the output of printenv.bat can be larger than 4kb. This changes the buffer size to 16k.

Testing:

  • I was having this problem on a local Windows box. The FIPS build would fail, and I could see that the output from printenv.bat was being cutoff early. With this change the build succeeds.
> cargo build -p aws-lc-rs --no-default-features --features fips
   Compiling cc v1.0.92
   Compiling aws-lc-rs v1.7.2 (C:\Users\justi\repos\aws-lc-rs\aws-lc-rs)
   Compiling cmake v0.1.50
   Compiling aws-lc-fips-sys v0.12.8 (C:\Users\justi\repos\aws-lc-rs\aws-lc-fips-sys)
The following warnings were emitted during compilation:

warning: aws-lc-fips-sys@0.12.8: Generating bindings - internal bindgen. Platform: x86_64-pc-windows-msvc

error: failed to run custom build command for `aws-lc-fips-sys v0.12.8 (C:\Users\justi\repos\aws-lc-rs\aws-lc-fips-sys)`
...
  --- stderr
  VS Installation: "C:\Program Files\Microsoft Visual Studio\2022\Professional"
  FOUND in Installation: "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\"
  **********************************************************************
  ** Visual Studio 2022 Developer Command Prompt v17.8.9
  ** Copyright (c) 2022 Microsoft Corporation
  **********************************************************************
  [vcvarsall.bat] Environment initialized for: 'x64'
  Visual Studio environment variables set for x64.
...
  HOMEDRIVE=C:
  HOMEPATH=\Users\justi
  HOST=x86_64-pc-windows-msvc
  INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include;C:\Program Files\Microsoft Visual
  CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
...
  thread 'main' panicked at C:\Users\justi\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.50\src\lib.rs:1098:5:

  command did not execute successfully, got: exit code: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@justinwsmith justinwsmith requested a review from a team as a code owner June 6, 2024 13:57
@justsmth justsmth requested review from skmcgrail and smittals2 June 6, 2024 17:12
@justsmth justsmth merged commit 0834f65 into aws:main Jun 6, 2024
188 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants