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

Add rustc env to rust toolchain #822

Closed
Closed
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
2 changes: 1 addition & 1 deletion prelude/rust/build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ def _rustc_invoke(

toolchain_info = compile_ctx.toolchain_info

plain_env, path_env = process_env(compile_ctx, ctx.attrs.env, exec_is_windows)
plain_env, path_env = process_env(compile_ctx, toolchain_info.rustc_env |ctx.attrs.env, exec_is_windows)

more_plain_env, more_path_env = process_env(compile_ctx, env, exec_is_windows)
plain_env.update(more_plain_env)
Expand Down
2 changes: 2 additions & 0 deletions prelude/rust/rust_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ rust_toolchain_attrs = {
# FIXME(JakobDegen): Can't use `list[str]` here, because then the default is wrong, but can't
# use a non-empty list as the default because lists are mutable
"rustc_coverage_flags": provider_field(typing.Any, default = ("-Cinstrument-coverage",)),
# Extra env variables that should be made available to the rustc executable.
"rustc_env": provider_field(dict[str, typing.Any], default = {}),
# Extra env variables that should be made available to the rustdoc executable.
"rustdoc_env": provider_field(dict[str, typing.Any], default = {}),
# Extra flags for rustdoc invocations
Expand Down