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

cargo install s3s-fs --features binary fails on Windows MSVC #52

Closed
amunra opened this issue May 26, 2023 · 4 comments · Fixed by #53
Closed

cargo install s3s-fs --features binary fails on Windows MSVC #52

amunra opened this issue May 26, 2023 · 4 comments · Fixed by #53

Comments

@amunra
Copy link
Contributor

amunra commented May 26, 2023

We use s3s-fs's binary in our project to test our logic during unit testing.

Today I was setting up CIs across platforms and the Windows MSVC one failed to cargo install s3s-fs --features binary.

Digging a little bit, the cause of the issue is the following:

From: crates/s3s-fs/Cargo.toml

[features]
binary = ["tokio/full", "md-5/asm", "dep:clap", "dep:tracing-subscriber", "dep:hyper"]
                        ^______ here

Exposes the following bug: RustCrypto/hashes#315

Which in turn manifests as the following build error:

PS C:\Users\Adam> cargo install s3s-fs --features binary
...
error: failed to run custom build command for `md5-asm v0.5.0`

Caused by:
  process didn't exit successfully: `C:\Users\Adam\AppData\Local\Temp\cargo-installbglGW6\release\build\md5-asm-82c27e24c0779d0f\build-script-build` (exit code: 1)
  --- stdout
...
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-W4" "-c" "-FoC:\\Users\\Adam\\AppData\\Local\\Temp\\cargo-installbglGW6\\release\\build\\md5-asm-5cb33a4a3b3b8b97\\out\\src/x64.o" "-c" "src/x64.S"
  cargo:warning=cl : Command line warning D9024 : unrecognized source file type 'src/x64.S', object file assumed
  cargo:warning=cl : Command line warning D9027 : source file 'src/x64.S' ignored
  cl : Command line warning D9021 : no action performed
...
  LINK : fatal error LNK1181: cannot open input file 'C:\Users\Adam\AppData\Local\Temp\cargo-installbglGW6\release\build\md5-asm-5cb33a4a3b3b8b97\out\src\x64.o'
  exit code: 1181
...

The good news is that disabling md5-asm, (i.e. binary = ["tokio/full", "dep:clap", "dep:tracing-subscriber", "dep:hyper"]) resolves the issue and it all builds just fine.

I couldn't really figure out a way to this in a way that is platform-specific: rust-lang/cargo#1197

The only other way of getting this to work, as far as I know, is to split the binary from s3s-fs into its own separate crate s3s-fs-bin and change the install docs to:

cargo install s3s-fs-bin

I think that's pretty complicated though.

Would you take a quick PR to remove the md-5/asm feature?

Thanks!

@Nugine
Copy link
Owner

Nugine commented May 26, 2023

It's suprising that there is no warning in md-5. I think they should document this.

Would you take a quick PR to remove the md-5/asm feature?

Welcome!

@amunra
Copy link
Contributor Author

amunra commented May 26, 2023

Yeah, they've got an open issue to add support for MSVC asm, but I don't understand why they just don't make the feature a no-op in the meantime. Doesn't matter too much I guess.

You'll be getting an PR from me soon :-)

@amunra
Copy link
Contributor Author

amunra commented May 26, 2023

See the PR. I've added Windows/MacOS CI too.

@amunra
Copy link
Contributor Author

amunra commented May 26, 2023

Assuming this gets merged, I'd be very very grateful for a new 0.6.0 release :-).

@Nugine Nugine added this to the v0.6.0 milestone May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants