builder: Isolate Git from local system#44324
Merged
Merged
Conversation
Member
|
BuildKit had a timeout (not sure if just flaky); let me post the output just in case trace: Details |
Member
|
Hmm... Windows failures look related (may be something in the test, or because Details |
Member
|
Some failures in the archive tests there as well ( This path looks funky though (double |
This was referenced Oct 19, 2022
corhere
force-pushed
the
fix-git-file-leak
branch
from
October 19, 2022 17:25
ee0a34b to
c134859
Compare
This comment was marked as resolved.
This comment was marked as resolved.
corhere
force-pushed
the
fix-git-file-leak
branch
from
October 20, 2022 00:17
c134859 to
66d0dca
Compare
Make the test more debuggable by logging all git command output and running each table-driven test case as a subtest. Signed-off-by: Cory Snider <[email protected]>
Keep It Simple! Set the working directory for git commands by...setting the git process's working directory. Git commands can be run in the parent process's working directory by passing the empty string. Signed-off-by: Cory Snider <[email protected]>
Prevent git commands we run from reading the user or system configuration, or cloning submodules from the local filesystem. Signed-off-by: Cory Snider <[email protected]>
While it is undesirable for the system or user git config to be used when the daemon clones a Git repo, it could break workflows if it was unconditionally applied to docker/cli as well. Signed-off-by: Cory Snider <[email protected]>
Setting cmd.Env overrides the default of passing through the parent process' environment, which works out fine most of the time, except when it doesn't. For whatever reason, leaving out all the environment causes git-for-windows sh.exe subprocesses to enter an infinite loop of access violations during Cygwin initialization in certain environments (specifically, our very own dev container image). Signed-off-by: Cory Snider <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
corhere
force-pushed
the
fix-git-file-leak
branch
from
October 20, 2022 20:47
9c02e8d to
67d010b
Compare
Member
|
The BuildKit failure is in the unit-test that were removed in #44337, so should be ignored. |
Member
|
bringing this one in 👍 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
Changed how git is invoked by builder to stop it from reading configuration from the host system and to block it from cloning submodules off the local filesystem. It is no longer possible for a specially-crafted remote repository to clone a repository on the local filesystem into the build context.
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)