Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

code-insider change the PATH env every day invalidating bazel cache #1453

Closed
bhack opened this issue May 17, 2022 · 4 comments
Closed

code-insider change the PATH env every day invalidating bazel cache #1453

bhack opened this issue May 17, 2022 · 4 comments

Comments

@bhack
Copy link
Contributor

bhack commented May 17, 2022

Steps to Reproduce:

  1. Build a project with bazel inside a container
  2. Install a new vscode sider version
  3. The PATH env is alterated every day with the (nightly hash) e.h. PATH=/vscode/vscode-server-insiders/bin/linux-x64/<daily-sha>-insider/bin/remote-cli
  4. This is going do invalidate the whole project cache and it requires to rebuild large programs from scratch every day after a code-insider update as many projects use PATH env in --action_env:
    https://docs.bazel.build/versions/4.1.0/remote-caching.html#known-issues

Environment variables leaking into an action
An action definition contains environment variables. This can be a problem for sharing remote cache hits across machines. For example, environments with different $PATH variables won’t share cache hits. Only environment variables explicitly whitelisted via --action_env are included in an action definition. Bazel’s Debian/Ubuntu package used to install /etc/bazel.bazelrc with a whitelist of environment variables including $PATH. If you are getting fewer cache hits than expected, check that your environment doesn’t have an old /etc/bazel.bazelrc file.

@bhack
Copy link
Contributor Author

bhack commented May 17, 2022

P.s. It is not only for code-insider it is reproducible also every VsCode stable release as the sha in the PATH it also used for stable releases.

Please migrate this ticket to https://github.com/microsoft/vscode-remote-release if it fits better.

@bhack
Copy link
Contributor Author

bhack commented May 17, 2022

I don't know if we could handle also this with the May plan as it has already some activity on the PATH env handling:
microsoft/vscode-remote-release#6625 (comment) /cc @aeschli

@bhack
Copy link
Contributor Author

bhack commented May 17, 2022

Another side effect is that with the same devcontainer image we will have two incompatible caches running the container from Vscode and using docker run from the terminal as the two PATH envs will not match

@bhack
Copy link
Contributor Author

bhack commented May 21, 2022

I've moved this ticket to microsoft/vscode-remote-release#6746

@bhack bhack closed this as completed May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant