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

[Runner] Define some environment variables needed by Rust toolchain #302

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,10 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString;
"CARGO_BUILD_TARGET" => map_rust_target(platform),
"CARGO_HOME" => "/opt/$(host_target)",
"RUSTUP_HOME" => "/opt/$(host_target)",
# `TARGET` and `HOST` are needed in some build systems:
# <https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts>.
"TARGET" => map_rust_target(platform),
"HOST" => map_rust_target(host_platform),
))
if rust_version !== nothing
merge!(mapping, Dict(
Expand Down Expand Up @@ -1206,6 +1210,10 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString;
end
end

if :rust in compilers
mapping["HOST_CC"] = mapping["HOSTCC"]
end

# There is no easy way to automatically determine the version of glibc for
# all platforms, but some build systems want to know it. Let's emulate with
# the `GNU_LIBC_VERSION` environment variable what `getconf
Expand Down