Skip to content

Upstream Git vs OpenSSL 4, who will win? - #774

Merged
dscho merged 2 commits into
mainfrom
upstream-git-vs-openssl-4
Nov 20, 2026
Merged

dscho merged 2 commits into
mainfrom
upstream-git-vs-openssl-4

Conversation

@dscho

@dscho dscho commented Nov 20, 2026

Copy link
Copy Markdown
Member

Since the MSYS2 project upgraded mingw-w64-openssl to v4.1, Git for Windows' ci-artifacts workflow is failing. The reason is that imap-send.c uses a function that was deprecated in v4.1 (after being introduced in v4.0...):

      [...]
      imap-send.c: In function 'host_matches':
      imap-send.c:230:9: error: 'ASN1_STRING_length' is deprecated:
          Since OpenSSL 4.1; use ASN1_STRING_get_length()
          [-Werror=deprecated-declarations]
        230 |         if (memchr(pattern, '\0', ASN1_STRING_length(asn1_str)))
            |         ^~
      In file included from [...]/ucrt64/include/openssl/objects.h:21,
                       from [...]/ucrt64/include/openssl/evp.h:48,
                       from [...]/ucrt64/include/openssl/x509.h:31,
                       from [...]/ucrt64/include/openssl/ssl.h:34,
                       from compat/mingw.h:12,
                       from git-compat-util.h:160,
                       from imap-send.c:27:
      [...]/ucrt64/include/openssl/asn1.h:794:5: note: declared here
        794 | int ASN1_STRING_length(const ASN1_STRING *x);
            |     ^~~~~~~~~~~~~~~~~~
      cc1.exe: all warnings being treated as errors
      make: *** [Makefile:2965: imap-send.o] Error 1

Since the ci-artifacts workflow not only produces the minimal-sdk CI artifact (which is used by Git in its CI runs, which is why there is this guard to ensure that that has a chance of working successfully), but also the build-installers CI artifact, which is used to build Git for Windows' installers (using the same guard to ensure that Git for Windows' installers have a chance of delivering a working Git to the users), we cannot currently release Git for Windows.

There is already a topic branch (bb/imap-send-openssl-set-verify) that would address this (by removing the function call altogether), but it is still cooking in seen.

To work around that build error without having to wait for that topic branch to advance to master, we'll just "un-deprecate" that function in Git for Windows' SDK, for the time being.

Here is a run that proves that this work-around works around the issue as intended.

Upstream Git takes its sweet little time integrating a fix for a
function that has been introduced in OpenSSL v4.0 but already been
deprecated in OpenSSL v4.1.

See https://github.com/git/git/blob/3802183aaaee/whats-cooking.txt#L1473
for details.

In the meantime, the `ci-artifacts` job (and hence the build of the
`build-installers` CI artifact, used to build Git for Windows'
installer) is failing, see e.g.
https://github.com/git-for-windows/git-sdk-64/actions/runs/43847033970/job/133229681817#step:8:267:

  imap-send.c: In function 'host_matches':
  imap-send.c:230:9: error: 'ASN1_STRING_length' is deprecated:
      Since OpenSSL 4.1; use ASN1_STRING_get_length()
      [-Werror=deprecated-declarations]
    230 |         if (memchr(pattern, '\0', ASN1_STRING_length(asn1_str)))
        |         ^~
  In file included from [...]/ucrt64/include/openssl/objects.h:21,
                   from [...]/ucrt64/include/openssl/evp.h:48,
                   from [...]/ucrt64/include/openssl/x509.h:31,
                   from [...]/ucrt64/include/openssl/ssl.h:34,
                   from compat/mingw.h:12,
                   from git-compat-util.h:160,
                   from imap-send.c:27:
  [...]/ucrt64/include/openssl/asn1.h:794:5: note: declared here
    794 | int ASN1_STRING_length(const ASN1_STRING *x);
        |     ^~~~~~~~~~~~~~~~~~
  cc1.exe: all warnings being treated as errors
  make: *** [Makefile:2965: imap-send.o] Error 1

Let's work around this by ignoring that particular deprecation for now.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
dscho requested review from mjcheetham and rimrul November 20, 2026 14:22
@dscho dscho self-assigned this Nov 20, 2026
@dscho dscho changed the title Upstream git vs openssl 4 Upstream Git vs OpenSSL 4, who will win? Nov 20, 2026

@mjcheetham mjcheetham 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.

a function that was deprecated in v4.1 (after being introduced in v4.0...)

Lovely...

@dscho

dscho commented Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

/deploy git-extra

The i686, the x86_64, the mingw64 and the arm64 workflow runs were started.

@dscho
dscho merged commit 02536c2 into main Nov 20, 2026
11 checks passed
@dscho
dscho deleted the upstream-git-vs-openssl-4 branch November 20, 2026 16:37
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.

2 participants