Commit Graph

6 Commits

Author SHA1 Message Date
Fabian Boehm
205d80c75a findrust: Simplify (#11328)
FindRust is too clever by half. It tries to do rustup's job for it.

See b38551dde9 for how that can break.

So we simplify it, and only let it check three things:

- Where's rustc? Look in $PATH and ~/.cargo/bin
- Where's cargo? Look in $PATH and ~/.cargo/bin
- What is the rust target (because we pass it explicitly)?

If any of these aren't that simple, we'll ask the user to tell us,
by setting Rust_COMPILER, Rust_CARGO or Rust_CARGO_TARGET.

None of the other things are helpful to us - we do not support windows
or whatever a "unikraft" is, and if the rust version doesn't work
it'll print its own error.

We could add a rustc version check, but that will become less and less
useful because rustc versions since 1.56 (released October 2021) will check rust-version in
Cargo.toml. So even at this point it's only pretty old rust versions already.
2025-03-30 19:47:09 +02:00
Peter Ammon
b38551dde9 Drag FindRust.cmake back into the land of the living
rustup has changed its output for 'rustup toolchain list --verbose`.
Teach FindRust.cmake about it, so that it may shamble on.

This was reported against BSD and also affects macOS and ALSO affects Linux; our
CI just doesn't have a new enough rustup. Anyways we can't have nice things.
2025-03-05 21:53:54 -08:00
ccoVeille
0047abbe7a Fix typo in code 2025-01-26 20:30:48 -08:00
Fabian Boehm
2d1ad1c3cc Mostly Revert "cmake: Remove code to resolve rustup toolchains"
Apparently needed on our FreeBSD CI setup.

This reverts commit 281df5daad.
2024-11-28 20:00:34 +01:00
Fabian Boehm
281df5daad cmake: Remove code to resolve rustup toolchains
We turned it off, but for some reason (cmake version?) that stopped working on my system.

So instead we just remove all the code that does it.

To be honest I do not know why this exists anyway.
2024-11-27 22:29:13 +01:00
David Adam
7d33f6706f Import FindRust from Corrosion 2024-01-30 18:18:55 +08:00