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

Build breaks after Cargo 1.79 #423

Closed
pylasnier opened this issue Aug 7, 2024 · 4 comments
Closed

Build breaks after Cargo 1.79 #423

pylasnier opened this issue Aug 7, 2024 · 4 comments

Comments

@pylasnier
Copy link
Contributor

Cargo 1.79 has changed behaviour where dashes are replaced with underscores in lib names, as listed in their changelog. This appears to have broken the Ishiiruka build by causing CMake to generate an incorrectly hyphenated arguments, with it failing at linking for not finding the slippi_rust_extensions lib. I have not tried to build for any version beyond Rust 1.79, but the linker argument generated (listed below) is still hyphenated in nightly.

Expected Behavior

Build (normal behaviour with Cargo 1.78). -lslippi_rust_extensions with underscores is passed to the linker.

Current Behavior

With Cargo 1.79, build fails with:

[100%] Linking CXX executable ../../../Binaries/dolphin-emu
/nix/store/qsx2xqqm0lp6d8hi86r4y0rz5v9m62wn-binutils-2.42/bin/ld: cannot find -lslippi-rust-extensions: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [Source/Core/DolphinWX/CMakeFiles/dolphin-emu.dir/build.make:1434: Binaries/dolphin-emu] Error 1
make[1]: *** [CMakeFiles/Makefile2:1426: Source/Core/DolphinWX/CMakeFiles/dolphin-emu.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

where -lslippi-rust-extensions with hyphens is passed to the linker.

Steps to Reproduce

  1. Install rustc and Cargo with Rust version 1.79
  2. Follow Ishiiruka build instructions

Environment

NixOS, built in nix-shell environment.

@pylasnier
Copy link
Contributor Author

A note that this Cargo change introduces swaps of hyphens and underscores for the lib file in many places throughout the generate CMake files, and simply changing the linker argument back is not enough to fix the build.

@ryanmcgrath
Copy link
Collaborator

Huh, it's likely a simple-ish fix of just changing the crate name to use underscores for consistency. It's not like it gets uploaded or distributed outside the project.

I'll see about poking at this over the weekend since the way Windows finds the lib is a bit custom.

(I don't suppose there's a way to force the Cargo 1.78 behavior anywhere, is there?)

@pylasnier
Copy link
Contributor Author

(I don't suppose there's a way to force the Cargo 1.78 behavior anywhere, is there?)

This comment from the offending pull request implies that backwards compatibility is retained, but that isn't the case for Ishiiruka or even other projects, it seems.

it's likely a simple-ish fix of just changing the crate name to use underscores for consistency.

This seems to be what other projects with similar failures are doing, though corrosion (which seems to be where the mismatch arises from) also fixes this in v0.5.0 without requiring a name change.

I can confirm that replacing all (non-URL) instances of slippi-rust-extensions with slippi_rust_extensions in the main repo and the Rust submodule (there's not many instances, only 2 total) builds successfully with Cargo 1.79.0 on Linux.

@pylasnier
Copy link
Contributor Author

I can confirm that replacing all (non-URL) instances of slippi-rust-extensions with slippi_rust_extensions in the main repo and the Rust submodule (there's not many instances, only 2 total) builds successfully with Cargo 1.79.0 on Linux.

I've written a small PR which adds these changes

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

No branches or pull requests

2 participants