azalea-rs / azalea

A collection of Rust crates for making Minecraft bots, clients, and tools.
https://azalea.matdoes.dev
MIT License
361 stars 48 forks source link

Determine rust channel by parsing rustc output if env vars do not exist #163

Closed itsCryne closed 1 month ago

itsCryne commented 1 month ago

The RUSTUP_TOOLCHAIN environment variable might not always be present. This is the case for e.g. NixOS where rust is routinely not installed via rustup, thus not setting this env var, causing build failures. Instead, build.rs will now run rustc -V and check if the output contains the word "nightly".

EightFactorial commented 1 month ago

The copy of rustc in your path, if there even is one, isn't necessarily the version being used to build the project.

Maybe use RUSTUP_TOOLCHAIN or fall back to the RUSTC environment variable?

itsCryne commented 1 month ago

This will now also give an error if the beta channel is used

itsCryne commented 1 month ago

Is there anything left to do before this can get reviewed/merged?