Skip to content

LibGit2: Update to 1.9.1 #58731

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

Merged
merged 10 commits into from
Jun 23, 2025
Merged

Conversation

eschnett
Copy link
Contributor

No description provided.

@eschnett eschnett requested a review from giordano as a code owner June 14, 2025 19:22
@giordano giordano added building Build system, or building Julia or its dependencies libgit2 The libgit2 library or the LibGit2 stdlib module external dependencies Involves LLVM, OpenBLAS, or other linked libraries merge me PR is reviewed. Merge when all tests are passing JLLs labels Jun 14, 2025
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Jun 14, 2025
Copy link
Member

Choose a reason for hiding this comment

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

Ah, right, zlib and pcre2 must be specified as dependencies here, and loaded in jll package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about JLLWrappers? Should that also be listed as dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And what about CompilerSupportLibraries_jll? Can that dependency be removed?

https://github.com/JuliaBinaryWrappers/LibGit2_jll.jl/blob/main/Project.toml

Copy link
Member

Choose a reason for hiding this comment

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

What about JLLWrappers? Should that also be listed as dependency?

That's not an stdlib, so no.

And what about CompilerSupportLibraries_jll? Can that dependency be removed?

https://github.com/JuliaBinaryWrappers/LibGit2_jll.jl/blob/main/Project.toml

It was added by @IanButterworth in #58560.

Copy link
Member

@IanButterworth IanButterworth Jun 14, 2025

Choose a reason for hiding this comment

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

It was added because libgcc_s seems to be needed on windows.

The good thing is tests should catch what's needed or unnecessary here.

@giordano

This comment was marked as resolved.

@eschnett eschnett marked this pull request as draft June 15, 2025 13:34
@eschnett eschnett marked this pull request as ready for review June 15, 2025 13:34
@eschnett
Copy link
Contributor Author

@giordano @IanButterworth Please retrigger the build, there was a spurious failure.

@giordano
Copy link
Member

I think you need to update all manifests anyway

@eschnett
Copy link
Contributor Author

This fails because there is a test using Revise, and Revise does not have a correct list of all Julia stdlibs. Revise does not know about PCRE2_jll nor about Zlib_jll, and thus Revise's selftests fail. PR timholy/Revise.jl#929 will fix this.

@eschnett
Copy link
Contributor Author

Revise has been updated in PR timholy/Revise.jl#930. Please retrigger the build.

@eschnett
Copy link
Contributor Author

The Windows build failure is spurious; can you restart that job?

@IanButterworth
Copy link
Member

IanButterworth commented Jun 19, 2025

Seems like windows (both 32 and 64 bit) has dependency issues

From worker 12:	┌ Warning: Dependency mismatch
--
  | From worker 12:	│   jll = "LibGit2_jll"
  | From worker 12:	│   library = "libgit2"
  | From worker 12:	│   missing_deps = "libpcre2-8"
  | From worker 12:	│   extraneous_deps = "libpcre2"
  | From worker 12:	│   actual_deps = "libpcre2-8, libgcc_s_sjlj, libz, libssh2"
  | From worker 12:	└ @ Main.Test66Main_stdlib_dependencies C:\buildkite-agent\builds\win2k22-amdci6-5\julialang\julia-master\julia-db2dcd5fde\share\julia\test\stdlib_dependencies.jl:237

@eschnett
Copy link
Contributor Author

This is the current problem:

      From worker 12:	┌ Warning: Dependency mismatch
      From worker 12:	│   jll = "LibGit2_jll"
      From worker 12:	│   library = "libgit2"
      From worker 12:	│   missing_deps = "libpcre2-8"
      From worker 12:	│   extraneous_deps = "libpcre2"
      From worker 12:	│   actual_deps = "libpcre2-8, libgcc_s_sjlj, libz, libssh2"

The library name is libpcre2-8. That works fine on Unix. On Windows, a suffix starting with a dash denotes the library version number. So we think (on Windows) that this is the library libpcre2, soversion 8.

I don't think there is a good way to fix that. I'll introduce a special case in the stdlib_dependencies.jl test.

@eschnett
Copy link
Contributor Author

The regex for the Windows case in base/binaryplatforms.jl looks fishy:

        dlregex = r"^(.*?)(?:-((?:[\.\d]+)*))?\.dll$"isa

It contains the subexpression (?:[\.\d]+)*. This allows an arbitrary sequence of dots, and digits. This different from the MacOS and Unix cases where only the \d is inside the square brackets, requiring a sequence of dots and digits where the digits cannot be missing.

Also, the + operator is superfluous since it's followed by a * operators.

@eschnett
Copy link
Contributor Author

@IanButterworth There were no dependency issues, this was a problem in Julia stripping dash suffixes from library names on Windows. My recent commit added a work-around.

@IanButterworth
Copy link
Member

Ok! I defer to @giordano or @staticfloat about whether the fix is the right one here

Comment on lines +223 to +234
# The library name is `libpcre2-8`, with a dash in
# its name. That works fine on Unix. On Windows, a
# suffix starting with a dash denotes the
# library's soversion. So we think (on Windows)
# that this is the library `libpcre2`, soversion
# 8, and things don't match.
if Sys.iswindows()
if "libpcre2-8" in missing_deps && "libpcre2" in extraneous_deps
missing_deps = setdiff(missing_deps, ["libpcre2-8"])
extraneous_deps = setdiff(extraneous_deps, ["libpcre2"])
end
end
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure Windows has concept of soversion at all, libraries tend to append numbers to the basename to mimic soversions like in other platforms, but that's custom, not very standard. Instead of special-casing libpcre2 here, wouldn't it be possible to list multiple values of library name when libpcre2 is used? That's what BinaryBuilderBase.LibraryProduct does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The library name is libpcre2-8. It contains a dash and a number. This has nothing to do with Windows. The 8 indicates the character encoding (UTF-8). There are also libpcre2-16 and libpcre2-32, although we don't use them.

We can't really say that PCRE2_jll provides libpcre2 as a library – that wouldn't work on Linux and macOS, and would lead to a conflict on Windows where we'd then provide three different libraries with the same name.

All is fine on Linux, where dashes in library names do not pose problems. On Windows we (Julia) get confused, and when we extract the library name from the string libpcre2-8.DLL, we cut off the -8, although we really shouldn't in this case.

So we need to either fix this in base/binaryplatforms.jl, where we cut off the dash-suffix, or here in the test. Either way we need an exception for libpcre2-8.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@giordano Please expand on your idea to list multiple library names. The library name is libpcre2-8. Do you suggest intentionally listing wrong library names?

This is what we currently have:

    LibraryProduct("libpcre2-8", :libpcre2_8),
    LibraryProduct("libpcre2-16", :libpcre2_16),
    LibraryProduct("libpcre2-32", :libpcre2_32)

How should we change this? Are you suggesting adding libpcre2 as alternative name for all three libraries?

@giordano giordano merged commit a595ea4 into JuliaLang:master Jun 23, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries JLLs libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants