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

pallet-revive: Use RUSTUP_TOOLCHAIN if set #6365

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions prdoc/pr_6365.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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
5 changes: 3 additions & 2 deletions substrate/frame/revive/fixtures/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down
Loading