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

Fix deprecated use of cc::Build::compile in build.rs #59

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Fix deprecated use of cc::Build::compile in build.rs #59

merged 1 commit into from
Aug 7, 2023

Conversation

NobodyXu
Copy link
Contributor

@NobodyXu NobodyXu commented Jul 9, 2023

and fixed the path to assemblies on windows.

I encountered link time failure when compiling on Windows locally and on CI:

  error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\arm64\\lib.exe" "-out:C:\\Users\\nobodyxu\\cargo-binstall\\target\\aarch64-pc-windows-msvc\\debug\\build\\sha1-asm-600eae65c368c0c1\\out\\libsha1.a" "-nologo" "C:\\Users\\nobodyxu\\cargo-binstall\\target\\aarch64-pc-windows-msvc\\debug\\build\\sha1-asm-600eae65c368c0c1\\out\\src/aarch64.o" with args "lib.exe" did not execute successfully (status code exit code: 1181).

I think this might have something to do with use of deprecated feature of cc::Build::compile:

For backwards compatibility, if output starts with “lib” and ends with “.a”, a second “lib” prefix and “.a” suffix do not get added on, but this usage is deprecated; please omit lib and .a in the argument that you pass.

It should pass just a name instead and msvc would deal with that:

The output string argument determines the file name for the compiled library. The Rust compiler will create an assembly named “lib”+output+“.a”. MSVC will create a file named output+“.lib”.

Also, the build.rs are using / on windows, this might also be the cause of failure.

Related issue Byron/gitoxide#917

Signed-off-by: Jiahao XU Jiahao_XU@outlook.com

@newpavlov
Copy link
Member

Looks good! Could you fix the MacOS CI failure by bumping its MSRV? Also, it would be nice to check if Windows builds are indeed fixed, otherwise we can remove the MAIN_SEPARATOR workaround.

and also bump MacOS msrv to 1.52.0 to fix CI failure

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@NobodyXu
Copy link
Contributor Author

Looks good! Could you fix the MacOS CI failure by bumping its MSRV?

I've bumped the MacOS MSRV to 1.54.0 to fix the error.

It's unfortunate that bumping it to other 1.4x.0 versions doesn't work.

Also, it would be nice to check if Windows builds are indeed fixed, otherwise we can remove the MAIN_SEPARATOR workaround.

I've tested it in CI and it doesn't fix the error, so I've reverted it.

@newpavlov newpavlov merged commit b4cf01b into RustCrypto:master Aug 7, 2023
36 checks passed
@NobodyXu NobodyXu deleted the fix/msvc branch August 8, 2023 01:11
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.

2 participants