Skip to content
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

msys2-runtime: restore blocking mode of read pipe on close() #187

Conversation

dscho
Copy link
Member

@dscho dscho commented Sep 15, 2024

The Cygwin runtime (and for that reason, the MSYS2 runtime, too), change pipes from blocking to non-blocking, which is a problem when the pipe is actually opened by something like Git when it asks a credential helper for information. Git, not expecting the pipe mode to be changed behind its back, will then error out with "fatal: read error: Invalid argument".

To address this, this patch was proposed in the Cygwin project as https://inbox.sourceware.org/cygwin-patches/20240830141553.12128-1-takashi.yano@nifty.ne.jp/

Ideally, Cygwin would not even try to fiddle with the pipe mode, therefore this patch was not applied as-is. At time of writing, there is no consensus on any replacement patch, but I have to prepare something for the already-late Git for Windows v2.46.1 (which is likely the last Git for Windows version to support Windows 7 and Windows 8, hence the urgency). And this patch at least improves the situation.

This patch will be dropped when Git for Windows will upgrade to MSYS2 runtime v3.5, and hopefully consensus will have been reached about a better fix by that time.

This commit corresponds to
git-for-windows/msys2-runtime#72 which fixes git-for-windows/git#5115.

@dscho dscho self-assigned this Sep 15, 2024
The Cygwin runtime (and for that reason, the MSYS2 runtime, too), change
pipes from blocking to non-blocking, which is a problem when the pipe is
actually opened by something like Git when it asks a credential helper
for information. Git, not expecting the pipe mode to be changed behind
its back, will then error out with "fatal: read error: Invalid
argument".

To address this, this patch was proposed in the Cygwin project as
https://inbox.sourceware.org/cygwin-patches/20240830141553.12128-1-takashi.yano@nifty.ne.jp/

Ideally, Cygwin would not even _try_ to fiddle with the pipe mode,
therefore this patch was not applied as-is. At time of writing, there is
no consensus on any replacement patch, but I have to prepare _something_
for the already-late Git for Windows v2.46.1 (which is likely the last
Git for Windows version to support Windows 7 and Windows 8, hence the
urgency). And this patch at least improves the situation.

This patch will be dropped when Git for Windows will upgrade to MSYS2
runtime v3.5, and hopefully consensus will have been reached about a
better fix by that time.

This commit corresponds to
git-for-windows/msys2-runtime#72 which fixes
git-for-windows/git#5115.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the work-around-msys2-runtime-being-overzealous-marking-pipe-as-non-blocking branch from b7cb5e6 to 1d376fb Compare September 15, 2024 14:42
@dscho
Copy link
Member Author

dscho commented Sep 15, 2024

/deploy msys2-runtime

The workflow run was started.

@dscho dscho merged commit 276d49d into git-for-windows:main Sep 15, 2024
4 checks passed
@dscho dscho deleted the work-around-msys2-runtime-being-overzealous-marking-pipe-as-non-blocking branch September 15, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git commands inside vscode fail when using basic authentication
1 participant