-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
System-specific environment variables on Windows pollute remote cache #3500
Comments
I consider this a dupe of #2574. Can you try setting --experimental_strict_action_env? It may not work yet if you have actions that try to write to TMP, which defaults to c:\windows, which is not user-writable. We'd like to hear back whether or not it works. |
This affects other platforms too, not just Windows. Bazel copies envvars from the client environment to the action's environment, and if those envvars are different for each user, there's no chance for cross-user caching. The right solution is to set user-independent values for these somewhere in the execution machinery, as part of setting up the environment just before executing a spawn. |
Note that I tried I have yet to test the impact on the actual caching, I will post the results later. (E: Still running release 0.5.4rc1) |
Can you paste the console output you're seeing? |
Yes. See the attached file. |
I don't see any of these env variables on MacOS. I wonder if the ./tools/cpp/windows_cc_configure.bzl is setting them? |
Reopening - there might be an additional Windows-specific issue here. |
Without --experimental_strict_action_env:
With --experimental_strict_action_env:
|
@laszlocsomor , can you reproduce this on Windows? |
|
we do set INCLUDE and LIB for C++ toolchain, to help linker locate system libraries, such as kernel32.lib and such. That is sure unhappy, we need a better solution for those /cc @meteorcloudy |
@ulfjack You are right. It is indeed We calculate these env value by running a batch script. I think the first step to solve this problem is by cleaning But we still need to figure out what to do if MSVC is installed in different places. |
This change prevents leaking irrelevant envs to C++ actions. Before running VCVARSALL.BAT, we set PATH=<system root> INCLUDE= LIB= See #3500 Change-Id: I767a36a3be3c8c01ad5cac2a7762edd34047e1bf PiperOrigin-RevId: 164242012
I suppose this is still a problem with Bazel 0.23. @meteorcloudy , is that correct? |
Yes, I think so |
Looks lik bazel 4.2.2 still has this problem. The |
Another problem we encounter is case-senstive. On Windows, path is not case-senstive. So |
Description of the problem / feature request / question:
When building C++ rules on Windows with MSVC, system-specific environment variables are part of the inputs, i.e.
For remote caching, this prevents sharing outputs between different systems.
Environment info
Operating System: Windows 10
Bazel version (output of
bazel info release
): release 0.5.4rc1Have you found anything relevant by searching the web?
https://groups.google.com/forum/#!topic/bazel-discuss/4GV8lJzfeGQ
The text was updated successfully, but these errors were encountered: