Skip to content

Conversation

@davehorner
Copy link

… precompiled header processing with MSVC

this fixed #2415 for me.

cargo build
   Compiling ring v0.17.9 (C:\working\rust\ring)
error: failed to run custom build command for `ring v0.17.9 (C:\working\rust\ring)`

Caused by:
  process didn't exit successfully: `c:\working\rust\ring\target\debug\build\ring-183a1fdc65207a18\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_MANIFEST_DIR
  cargo:rerun-if-env-changed=CARGO_PKG_NAME
  cargo:rerun-if-env-changed=CARGO_PKG_VERSION_MAJOR
  cargo:rerun-if-env-changed=CARGO_PKG_VERSION_MINOR
  cargo:rerun-if-env-changed=CARGO_PKG_VERSION_PATCH
  cargo:rerun-if-env-changed=CARGO_PKG_VERSION_PRE
  cargo:rerun-if-env-changed=CARGO_MANIFEST_LINKS
  cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
  cargo:rerun-if-env-changed=OUT_DIR
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ENV
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ENDIAN
  cargo:rerun-if-env-changed=DEBUG
  cargo:rerun-if-env-changed=PERL_EXECUTABLE

  --- stderr
  running "perl" "c:/\\/working/rust/ring/crypto/chacha/asm/chacha-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/chacha-x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/aes/asm/aesni-gcm-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/aesni-gcm-x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/aes/asm/aesni-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/aesni-x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/aes/asm/ghash-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/ghash-x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/aes/asm/vpaes-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/vpaes-x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/bn/asm/x86_64-mont.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/x86_64-mont-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/bn/asm/x86_64-mont5.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/x86_64-mont5-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/p256-x86_64-asm-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/sha/asm/sha512-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/sha512-x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/cipher/asm/chacha20_poly1305_x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/chacha20_poly1305_x86_64-nasm.asm"
  running "perl" "c:/\\/working/rust/ring/crypto/fipsmodule/sha/asm/sha512-x86_64.pl" "nasm" "c:/\\/working/rust/ring/target/debug/build/ring-4d38d14482dcbc2e/out/sha256-x86_64-nasm.asm"
  running "./target/tools/windows/nasm/nasm" "-o" "c:\\working\\rust\\ring\\target\\debug\\build\\ring-4d38d14482dcbc2e\\out\\chacha-x86_64-nasm.o" "-f" "win64" "-i" "include/" "-i" "c:\\working\\rust\\ring\\target\\debug\\build\\ring-4d38d14482dcbc2e\\out\\" "-Xgnu" "-gcv8" "c:\\working\\rust\\ring\\target\\debug\\build\\ring-4d38d14482dcbc2e\\out\\chacha-x86_64-nasm.asm"
  thread 'main' panicked at build.rs:648:9:
  failed to execute ["./target/tools/windows/nasm/nasm" "-o" "c:\\working\\rust\\ring\\target\\debug\\build\\ring-4d38d14482dcbc2e\\out\\chacha-x86_64-nasm.o" "-f" "win64" "-i" "include/" "-i" "c:\\working\\rust\\ring\\target\\debug\\build\\ring-4d38d14482dcbc2e\\out\\" "-Xgnu" "-gcv8" "c:\\working\\rust\\ring\\target\\debug\\build\\ring-4d38d14482dcbc2e\\out\\chacha-x86_64-nasm.asm"]: The system cannot find the path specified. (os error 3)
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I applied this fix to my working crate out of .cargo. above are the errors when I try to just build the crate locally; so I can't test further. Let me know if you know what to do to get cargo build to work on latest. This patch maybe helpful to others.

@davehorner
Copy link
Author

davehorner commented Feb 20, 2025

20000 worked for me. I swear but when I tried using my patched crate from my application I found that cl kicked out the parameter as invalid. I need more than 2000. It was accepting of this large value at one point. I'm not sure what else to do.

if you look in the PR I added some code to use the env nasm on the machine if the developer hasn't pulled your specific windows tools.

my patched ring cargo builds just fine. when consuming it via local or git reference; I get fatal error C1056: cannot update the time date stamp field even with the /Zm2000

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.

crypto\fipsmodule\aes\aes_nohw.c : fatal error C1056: cannot update the time date stamp field

1 participant