Skip to content

Commit 5a23475

Browse files
committed
fix rustc_bootstrap for crates_vendor
1 parent 19423de commit 5a23475

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crate_universe/private/crates_vendor.bzl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,22 @@ def _sys_runfile_env(ctx, name, file, is_windows):
151151
"_ENVIRON+=({0}=\"${{{0}}}\")".format(name),
152152
])
153153

154+
def _sys_env(ctx, name, value, is_windows):
155+
if is_windows:
156+
return "set \"{}\" {}".format(
157+
name,
158+
value,
159+
)
160+
161+
return "\n".join([
162+
"export {}=\"{}\"".format(
163+
name,
164+
value,
165+
),
166+
"_ENVIRON+=({0}=\"${{{0}}}\")".format(name),
167+
])
168+
169+
154170
def _expand_env(value, is_windows):
155171
if is_windows:
156172
return "%{}%".format(value)
@@ -406,6 +422,9 @@ def _crates_vendor_impl(ctx):
406422
_sys_runfile_env(ctx, "RUSTC", toolchain.rustc, is_windows),
407423
]
408424

425+
if ctx.attr.stable_as_nightly:
426+
environ.append(_sys_env(ctx, "RUSTC_BOOTSTRAP", "1", is_windows))
427+
409428
args = ["vendor"]
410429

411430
cargo_bazel_runfiles = []

0 commit comments

Comments
 (0)