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

Use JLLs to provide compiled binaries for some GAP packages #1076

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

fingolfin
Copy link
Member

@fingolfin fingolfin commented Dec 10, 2024

  • Stop autoloading for most GAP packages
  • Use JLLs to provide compiled binaries for some GAP packages
  • HACK HACK HACK do not merge

Resolves #1064
Resolves #928
Resolves #852

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.55%. Comparing base (1992296) to head (c6380a1).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1076      +/-   ##
==========================================
+ Coverage   75.43%   75.55%   +0.11%     
==========================================
  Files          55       55              
  Lines        4580     4585       +5     
==========================================
+ Hits         3455     3464       +9     
+ Misses       1125     1121       -4     
Files with missing lines Coverage Δ
pkg/JuliaInterface/read.g 100.00% <100.00%> (ø)
src/GAP.jl 86.20% <ø> (-0.24%) ⬇️
src/GAP_pkg.jl 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@fingolfin fingolfin force-pushed the mh/use-package-JLLs branch 2 times, most recently from 75a4cb8 to 69c4581 Compare December 10, 2024 23:37
@@ -69,18 +69,14 @@ jobs:
- name: "GAP tests"
run: |
julia --project=. -e 'import GAP; GAP.create_gap_sh("/tmp")'
export GAP="/tmp/gap.sh -A --quitonbreak --norepl"
export GAP="/tmp/gap.sh --quitonbreak --norepl"
Copy link
Member Author

Choose a reason for hiding this comment

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

So this is a nasty hack: because we specify -A now any places that already specifies -A needs to remove it... But IMHo that solution doesn't scale well.

Alternative ideas for resolving this:

  1. we filter the args being passed in to remove any -A arguments
  2. we don't use -A to reduce the loaded packages, but rather --bare
    • optionally we could afterwards "manually" load the required packages gapdoc/smallgrp/transgrp/primgrp
  3. we don't use -A nor --bare and instead patch the GAP library directly to support the "overrides" (i.e. GAP_lib_jll for now and possibly later upstream GAP)
    • if we do it right then DirectoriesPackageProgramsOverrides exists by the time gap/systemfile.g is executed and we can fill it then.
    • this would also allow us to load the default set of GAP packages again (I am torn whether we want that, or want --bare, or -A ...)
  4. as a variant of that we could also use another dirty hack and run the code from gap/pkg.g (which patches DirectoriesPackagePrograms) from inside pkg/JuliaInterface/PackageInfo.g after making sure that JuliaInterface is the first package to be loaded...

Copy link
Member

Choose a reason for hiding this comment

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

Currently my point of view is:

When starting GAP from GAP.jl then we should load JuliaInterface but no other GAP packages.
This way we allow Oscar.jl (or others) to prepare special settings that will influence what happens when certain GAP packages will get loaded, and it is possible to provide/prescribe special packages versions and perhaps to load these packages.

We can provide a small function in GAP.jl that triggers GAP's LoadPackages for those packages that are "wanted by GAP" and that have not yet been loaded.
The question is then how this function can be called automatically but late enough such that the above order of package loading does not get distorted.

@fingolfin fingolfin marked this pull request as ready for review December 12, 2024 09:05
@fingolfin fingolfin marked this pull request as draft December 12, 2024 10:41
@fingolfin
Copy link
Member Author

Summary discussion with @ThomasBreuer: we plan to let GAP.jl use the equivalent of --bare for GAP, i.e. doing using GAP will only load JuliaInterface (and maybe GAPDoc to enable help? or maybe we delay this until someone accesses the help, dunno).

For the gap.sh scripts we could still load the default "autoload" packages, to be decided.

This PR however does not do that right now, it is as close as possible to the current status quo -- my idea here being that we can merge this independently from the other change, this is simpler to review and may also help to bisect issues.

@fingolfin fingolfin marked this pull request as ready for review December 12, 2024 16:52
@fingolfin
Copy link
Member Author

I think this is ready for merging now

@lgoettgens
Copy link
Member

I don't understand enough about GAP package loading to give educated feedback on this.

Maybe a stupid question: The long term plan is still to have GAP_pkg_foo.jl packages that wrap GAP_pkg_foo_jll.jl, right? And this here is more of an intermediate solution

@fingolfin
Copy link
Member Author

The long term plan still is to introduce GAP_pkg_foo.jl, but there are known problems with that (the Julia and GAP package system are very different), so it makes sense to have this "intermediate" solution -- it may be what we use for a year or longer; and perhaps we come up with a completely different solution; we'll see. But most likely whatever we use will use the same artifacts and JLLs, which is good.

@fingolfin
Copy link
Member Author

Since I discussed this at length with @ThomasBreuer today I feel pretty confident. So I'll merge this now so that I can continue working, but of course there is still time for feedback and changes if there are any problems

@fingolfin fingolfin merged commit 850b179 into master Dec 12, 2024
21 checks passed
@fingolfin fingolfin deleted the mh/use-package-JLLs branch December 12, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants