mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
* Use workspace `Cargo.toml` for dependencies and package atributes * Fix a couple clippy warnings * Update bevy, update build script, move deps to workspace, and fix clippy warnings * Remove carrots from crate versions The default behavior is the same * Remove unused dependencies Compiles and all tests pass, so it should be fine * Update codegen to use `std::sync::LazyLock` instead of `once_cell::sync::Lazy` * Update Bevy to `0.15.0-rc.3` Surprisingly little needed to be changed * Update to bevy 0.15.0 * Fix leftover merge issues * Clarify the reason the swarm can't connect * Fix duplicate lint, remove `log` dependency
31 lines
1.3 KiB
Rust
31 lines
1.3 KiB
Rust
use std::env;
|
|
use std::process::Command;
|
|
|
|
fn main() {
|
|
// If using `rustup`, check the toolchain via `RUSTUP_TOOLCHAIN`
|
|
if let Ok(toolchain) = env::var("RUSTUP_TOOLCHAIN") {
|
|
if toolchain.contains("nightly") {
|
|
return;
|
|
} else {
|
|
panic!("Azalea currently requires nightly Rust. You can run `rustup override set nightly` to set the toolchain for this directory.");
|
|
}
|
|
}
|
|
|
|
// Get the path to the Rust compiler, defaulting to `rustc`
|
|
let rustc_path = env::var("RUSTC")
|
|
.or_else(|_| env::var("CARGO_BUILD_RUSTC"))
|
|
.unwrap_or(String::from("rustc"));
|
|
|
|
// Run `rustc -V` to check the toolchain version
|
|
let rustc_command = Command::new(&rustc_path).arg("-V").output().unwrap();
|
|
|
|
if rustc_command.status.success() {
|
|
let rustc_output = String::from_utf8(rustc_command.stdout).unwrap();
|
|
if !rustc_output.contains("nightly") {
|
|
panic!("Azalea currently requires nightly Rust. Please check the documentation for your installation method and ensure you are using the nightly toolchain.");
|
|
}
|
|
} else {
|
|
let rustc_output = String::from_utf8(rustc_command.stderr).unwrap();
|
|
panic!("Failed to run `{rustc_path} -V` to check the toolchain version, {rustc_output}");
|
|
}
|
|
}
|