From 6c8875ae6ad46f5468b493ec7f71d16e97b5117d Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Thu, 6 May 2021 22:25:21 +0200 Subject: [PATCH] .bazelrc: pass ProgramData into action env, instead of hacking luajit build stuff --- .bazelrc | 9 ++++++++- .../vendor/luajit-src-210.1.3+restyfe08842/src/lib.rs | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index 2065358..544cf1d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,2 +1,9 @@ startup --windows_enable_symlinks -build --enable_runfiles \ No newline at end of file +build --enable_runfiles + +# This is needed by cc::windows_registry::find_tool et. al. It calls out into a +# MSVC COM DLL used to find MSVC installations, and that apparently relies on +# the env var being set. For some reason, just doing --action_env=ProgramData +# doesn't work, so we hardcode things to assume that it lives in C:\. We also +# pollute non-Windows build envs with this, but whatever. +build --action_env=ProgramData=C:\\ProgramData \ No newline at end of file diff --git a/third_party/cargo/vendor/luajit-src-210.1.3+restyfe08842/src/lib.rs b/third_party/cargo/vendor/luajit-src-210.1.3+restyfe08842/src/lib.rs index 236a215..25390fc 100644 --- a/third_party/cargo/vendor/luajit-src-210.1.3+restyfe08842/src/lib.rs +++ b/third_party/cargo/vendor/luajit-src-210.1.3+restyfe08842/src/lib.rs @@ -147,8 +147,6 @@ impl Build { msvcbuild.current_dir(build_dir.join("src")); msvcbuild.arg("static"); - // HACK: without this, the MSVC COM DLL used to find cl.exe/link.exe/... fails. - std::env::set_var("ProgramData", "C:\\ProgramData"); let cl = cc::windows_registry::find_tool(&target, "cl.exe").expect("failed to find cl"); for (k, v) in cl.env() { msvcbuild.env(k, v);