microsoft / git

A fork of Git containing Microsoft-specific patches.
http://git-scm.com/
Other
761 stars 92 forks source link

update-git-for-windows seems to be broken on 2.45.2.vfs.0.0 #655

Closed tiagomacarios closed 3 months ago

tiagomacarios commented 3 months ago

z:\o2\src>git --version git version 2.45.2.vfs.0.0

z:\o2\src>git update-git-for-windows -y curl: (43) A libcurl function was given a bad argument

z:\o2\src>git --version git version 2.45.0.vfs.0.0

z:\o2\src>git update-git-for-windows -y Git 2.45.0.vfs.0.0 (64-bit) Up to date

dscho commented 3 months ago

This seems to be caused by a bug in cURL where it does not handle the --write-out option correctly:

$ sh -x $(which git-update-git-for-windows)
+ use_recently_seen=no
+ test --test-version-compare '!=' ''
+ update_git_for_windows
[...]
+ echo 'Update 2.45.2.windows.1 is available'
Update 2.45.2.windows.1 is available
++ http_get https://api.github.com/repos/git-for-windows/git/releases/latest
++ url=https://api.github.com/repos/git-for-windows/git/releases/latest
+++ mktemp -t gfw-httpget-XXXXXXXX.txt
++ output=/tmp/gfw-httpget-ruMLqjGG.txt
+++ curl --silent --show-error --output /tmp/gfw-httpget-ruMLqjGG.txt --write-out '%{http_code}' https://api.github.com/repos/git-for-windows/git/releases/latest
curl: (43) A libcurl function was given a bad argument
++ code=000
++ return 43
+ releases=
+ return

If I remove the --write-out '%{http_code}' option, the command succeeds (but of course the HTTP code is no longer reported).

https://github.com/curl/curl/issues/13845 looks closely related, and I am currently building cURL v8.8.0 with https://github.com/curl/curl/commit/9aa1d412b814a40868558da51a6ab28ce1384a58 applied on top, to see whether this fixes the bug.

dscho commented 3 months ago

I am currently building cURL v8.8.0 with curl/curl@9aa1d41 applied on top, to see whether this fixes the bug.

Sadly, it does not address the bug.

dscho commented 3 months ago

I am currently building cURL v8.8.0 with curl/curl@9aa1d41 applied on top, to see whether this fixes the bug.

Sadly, it does not address the bug.

Aha! I managed to test with the original DLL the entire time because I failed to realize that the custom build I ran in place would pick up /mingw64/bin/libcurl-4.dll instead. Once I overwrite that with the just-built binary, it does fix the bug!

derrickstolee commented 3 months ago

Reopening until new release bits can be generated.

dscho commented 3 months ago

Reopening until new release bits can be generated.

They are generated as we speak ;-)

derrickstolee commented 3 months ago
NORTHAMERICA+dstolee@stoleedesk2023 MINGW64 ~
$ git update-microsoft-git
curl: (43) A libcurl function was given a bad argument

NORTHAMERICA+dstolee@stoleedesk2023 MINGW64 ~
$ git version
git version 2.45.2.vfs.0.1

Doesn't seem to have stuck.

dscho commented 3 months ago

Doesn't seem to have stuck.

Indeed. I had to kicked off another sync run in git-sdk-64 that updated curl to the -2 version, and then I re-ran the windows_pkg job. The release workflow run is now completing, and I will test it immediately once it's done.

dscho commented 3 months ago

Now, that's better:

image

There's room for improvement (Portable Git should decline to run update-git-for-windows, for example), but the bug is gone.

derrickstolee commented 3 months ago

I confirmed this worked for me, too. In my opinion, this issue can be closed when 2.45.2.vfs.0.1 is available as a pre-release, to match the exposure of 2.45.2.vfs.0.0.

dscho commented 3 months ago

Published!