Skip to content
Snippets Groups Projects
Unverified Commit 6f078d18 authored by Alexander Theißen's avatar Alexander Theißen Committed by GitHub
Browse files

pallet-revive: Use `RUSTUP_TOOLCHAIN` if set (#6365)


We were not passing through the `RUSTUP_TOOLCHAIN` variable to the
`build.rs` script of our fixtures. This means that setting the toolchain
like `cargo +1.81 build` had no effect on the fixture build. It would
always fall back to the default toolchain.

---------

Co-authored-by: default avatarGitHub Action <action@github.com>
parent 76f297da
No related merge requests found
Pipeline #504364 waiting for manual action with stages
in 33 minutes and 55 seconds
title: 'pallet-revive: Use `RUSTUP_TOOLCHAIN` if set'
doc:
- audience: Runtime Dev
description: We were not passing through the `RUSTUP_TOOLCHAIN` variable to the
`build.rs` script of our fixtures. This means that setting the toolchain like
`cargo +1.81 build` had no effect on the fixture build. It would always fall back
to the default toolchain.
crates:
- name: pallet-revive-fixtures
bump: major
......@@ -120,6 +120,7 @@ fn invoke_build(target: &Path, current_dir: &Path) -> Result<()> {
.env("CARGO_ENCODED_RUSTFLAGS", encoded_rustflags)
.env("RUSTC_BOOTSTRAP", "1")
.env("RUSTUP_HOME", env::var("RUSTUP_HOME").unwrap_or_default())
.env("RUSTUP_TOOLCHAIN", env::var("RUSTUP_TOOLCHAIN").unwrap_or_default())
.args([
"build",
"--release",
......@@ -147,8 +148,8 @@ fn invoke_build(target: &Path, current_dir: &Path) -> Result<()> {
/// Post-process the compiled code.
fn post_process(input_path: &Path, output_path: &Path) -> Result<()> {
let strip = std::env::var(OVERRIDE_STRIP_ENV_VAR).map_or(false, |value| value == "1");
let optimize = std::env::var(OVERRIDE_OPTIMIZE_ENV_VAR).map_or(true, |value| value == "1");
let strip = env::var(OVERRIDE_STRIP_ENV_VAR).map_or(false, |value| value == "1");
let optimize = env::var(OVERRIDE_OPTIMIZE_ENV_VAR).map_or(true, |value| value == "1");
let mut config = polkavm_linker::Config::default();
config.set_strip(strip);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment