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

Test GAP.Packages.install/remove in a temporary directory #584

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

Fixes #574

@fingolfin
Copy link
Member Author

This works locally on my computer (????) but not in the CI tests, and also not on an Ubuntu server I tried.

Looking at it, the IO package is compiled fine (and I separately verified that the io.so loadable module is functional. But for some reason, GAP fails to ever "see" this additional copy of the IO package in a temp directory. Instead it insists on wanting to use the copy in ~/.julia/artifacts/848f0f318405266896d24d11e4baf5cf7bf3f203/gap-4.11.0/. Even if I put the temp dir first in the list of GAPROOTS, this does not change.

So this looks as if it is a problem in the GAP library itself, and/or in PackageManager...

@ThomasBreuer
Copy link
Member

ThomasBreuer commented Apr 21, 2022

I have tried the test locally, and GAP.Packages.install("io", interactive = false, pkgdir = pkgdir) returns true --this seems to be the problem.
In my local setup, version 4.7.1 of io is already loaded before the test. Then the above command first downloads and unpacks version 4.7.2;
Afterwards PKGMAN_CheckPackage is called, which runs the compilation script.
In the final check, TestPackageAvailability(info.PackageName, info.Version) returns fail but since io is already loaded (here the version number is not tested!) the function returns true.

With the following input, Julia installs io in the temporary directory, and the package can be loaded afterwards.

__GAP_ARGS__ = [ "-r", "-A" ]; # make sure that io is not loaded before the test
using GAP
tmproot = mktempdir()
pkgdir = joinpath(tmproot, "pkg")
mkpath(pkgdir)
GAP.Globals.ExtendRootDirectories(GapObj([tmproot * "/"]; recursive=true))
GAP.Packages.install("io", interactive = false, pkgdir = pkgdir) # yields true
GAP.Packages.load("io") # yields true
GAP.Globals.GAPInfo.PackagesLoaded.io # belongs to version 4.7.2, installed in the temp. dir.

(Changing the list GAPInfo.RootPaths by hand is dangerous, ExtendRootDirectories takes care about the caches for DirectoriesLibrary.)

(Setting __GAP_ARGS__ in the Julia session before loading GAP is dangerous, this variable is used also to indicate "stand-alone mode" in the initialize function of GAP.jl.)

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.

Don't install&remove GAP "io" package globally as part of the test suite
2 participants