Skip to content

[20.10] builder: fix running git commands on Windows#44332

Merged
thaJeztah merged 2 commits into
moby:20.10from
corhere:backport-20.10/fix-git-windows-environ
Oct 20, 2022
Merged

[20.10] builder: fix running git commands on Windows#44332
thaJeztah merged 2 commits into
moby:20.10from
corhere:backport-20.10/fix-git-windows-environ

Conversation

@corhere

@corhere corhere commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

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]

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@corhere
corhere requested a review from tonistiigi as a code owner October 20, 2022 00:24
@corhere corhere changed the title builder: fix running git commands on Windows [20.10] builder: fix running git commands on Windows Oct 20, 2022
Comment thread builder/remotecontext/git/gitutils.go Outdated
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]>
@corhere
corhere force-pushed the backport-20.10/fix-git-windows-environ branch from 6ae1657 to 05e25f7 Compare October 20, 2022 17:42
@thaJeztah

Copy link
Copy Markdown
Member

Failures are unrelated, and will be addressed separately.

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants