-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[engine] Support static env var pass-throughs
Allow users to selectively poke holes in the subprocess sandbox by specifying `pass_through_env` in shac.textproto. `pass_through_env` is a list of environment variables that should be passed through the sandbox, along with bits indicating whether the variable's value represents a file that should also be mounted and, if so, whether it should be writeable by subprocesses. We can immediately use this feature to grant Go checks in this repository access to $HOME so they can share the same go cache with the rest of the system (ideally we could use $GOCACHE, but it's not guaranteed to be set, and if it's not set it's inferred from $HOME). Same for tests that run `go run` since they can make use of the cache instead of doing a full recompile on every test run; as a result, the runtime of `go test ./internal/engine` went from ~4.2 seconds to ~1.2 seconds on my workstation. This is a medium-term workaround until we support declaring pass-throughs in Starlark, which would allow things like running `go env GOCACHE` to obtain and pass through just the $GOCACHE directory, while omitting the rest of $HOME. Change-Id: I0bcc9956c4c4e2e9cca292925c66f6aed6f07524
- Loading branch information
Showing
16 changed files
with
489 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.