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

New toolchain list format in 1.28.0 breaks Corrosion toolchain detection #4127

Closed
2 tasks done
kanru opened this issue Dec 23, 2024 · 3 comments
Closed
2 tasks done
Labels

Comments

@kanru
Copy link

kanru commented Dec 23, 2024

Verification

Problem

While testing the 1.28.0 beta I found my project with Corrosion reported error when invoking rustup

CMake Warning (dev) at build/_deps/corrosion-src/cmake/FindRust.cmake:363 (message):
  Unexpected output from `rustc --version` for Toolchain
  `stable-x86_64-unknown-linux-gnu`: ``.

  Ignoring this toolchain.
Call Stack (most recent call first):
  build/_deps/corrosion-src/cmake/Corrosion.cmake:63 (find_package)
  build/_deps/corrosion-src/CMakeLists.txt:73 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Rust Toolchain: 
CMake Error at build/_deps/corrosion-src/cmake/FindRust.cmake:23 (message):
  Could not find toolchain ''

  Available toolchains:

    `nightly-x86_64-unknown-linux-gnu`
    `nightly-2024-03-10-x86_64-unknown-linux-gnu`
    `1.70-x86_64-unknown-linux-gnu`
    `1.77-x86_64-unknown-linux-gnu`

Call Stack (most recent call first):
  build/_deps/corrosion-src/cmake/FindRust.cmake:469 (_findrust_failed)
  build/_deps/corrosion-src/cmake/Corrosion.cmake:63 (find_package)
  build/_deps/corrosion-src/CMakeLists.txt:73 (include)

Steps

  1. Setup a minimum corrosion project https://corrosion-rs.github.io/corrosion/quick_start.html
  2. Run cmake --build

Possible Solution(s)

Corrosion matches against the output of rustup toolchain list --verbose to find the toolchain path

https://github.com/corrosion-rs/corrosion/blob/master/cmake/FindRust.cmake#L337-L350

Either revert the rustup change, or Corrosion needs to detect the new output format. Though this will leave old projects broken.

Perhaps the new format can be (default) (active) instead of (active, default) to be more backwards compatible.

Notes

No response

Rustup version

rustup 1.28.0 (7ccf717e6 2024-12-23)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.83.0 (90b35a623 2024-11-26)`

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/kanru/.rustup

installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu (active, default)
nightly-x86_64-unknown-linux-gnu
nightly-2024-03-10-x86_64-unknown-linux-gnu
1.70-x86_64-unknown-linux-gnu
1.77-x86_64-unknown-linux-gnu

active toolchain
----------------
name: stable-x86_64-unknown-linux-gnu
compiler: rustc 1.83.0 (90b35a623 2024-11-26)
active because: it's the default toolchain
installed targets:
  wasm32-unknown-unknown
  x86_64-unknown-linux-gnu

OS version

Fedora 41
@kanru kanru added the bug label Dec 23, 2024
@djc
Copy link
Contributor

djc commented Dec 23, 2024

Maybe we should add a --message-format=json switch? And start by getting a fix into Corrosion?

@rami3l
Copy link
Member

rami3l commented Dec 24, 2024

Maybe we should add a --message-format=json switch?

@djc We have #3434 to track this.

And start by getting a fix into Corrosion?

I do think fixing corrosion would be the right way to go, although should we also take into account old projects (with old corrosion) + old toolchains + new rustup, which will eventually break as @kanru has mentioned, or should we just warn the users if possible?

@rami3l
Copy link
Member

rami3l commented Dec 28, 2024

Closing in favor of corrosion-rs/corrosion#590 and #4129, as it has become apparent that the real issue lies in the lack of a way to get the active toolchain's installation path.

@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants