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

a problem with GAP package loading mechanism #287

Closed
mohamed-barakat opened this issue Sep 12, 2019 · 6 comments
Closed

a problem with GAP package loading mechanism #287

mohamed-barakat opened this issue Sep 12, 2019 · 6 comments
Labels
help wanted Extra attention is needed kind: bug Something isn't working

Comments

@mohamed-barakat
Copy link
Contributor

mohamed-barakat commented Sep 12, 2019

@ChrisJefferson's packages json fails to load:

julia> using GAP
julia> LoadPackageAndExposeGlobals( "json", Main, all_globals = true )
ERROR: cannot load package json
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] #LoadPackageAndExposeGlobals#9(::Bool, ::Bool, ::typeof(LoadPackageAndExposeGlobals), ::String, ::Module) at /Users/mo/.julia/dev/GAP/src/gap2.jl:116
 [3] (::getfield(GAP, Symbol("#kw##LoadPackageAndExposeGlobals")))(::NamedTuple{(:all_globals,),Tuple{Bool}}, ::typeof(LoadPackageAndExposeGlobals), ::String, ::Module) at ./none:0
 [4] top-level scope at REPL[2]:1
@mohamed-barakat mohamed-barakat added kind: bug Something isn't working help wanted Extra attention is needed labels Sep 12, 2019
@ChrisJefferson
Copy link

Is there any way for me to understand what's actually going wrong? :)

@ThomasBreuer
Copy link
Member

@mohamed-barakat I cannot reproduce this behaviour.
The error message comes from a call GAP.EvalString( "LoadPackage( \"json\" )" ).
If you start the GAP in question directly and call LoadPackage( "json" ), does the package load?
If not then perhaps recompiling the package helps.

@mohamed-barakat
Copy link
Contributor Author

Thank you @ThomasBreuer for your comment. The package json properly loads in ~/.julia/dev/GAP/gap.sh but fails in julia:

~/.julia/dev/GAP (master)$ ./gap.sh
 ┌───────┐   GAP 4.10dev-2263-g9f330be of today
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-apple-darwin18.6.0-julia64-kv7
 Configuration:  gmp 6.1.2, Julia GC, Julia 1.2.0
 Loading the library and packages ...
 Packages:   AClib 1.3.1, Alnuth 3.1.1, AtlasRep 2.1.0, AutoDoc 2019.07.24, AutPGrp 1.10.1, Browse 1.8.8, Carat 2.2.3, CRISP 1.4.4, Cryst 4.1.20, CrystCat 1.1.9,
             CTblLib 1.2.2, FactInt 1.6.2, FGA 1.4.0, Forms 1.2.5, GAPDoc 1.6.3, genss 1.6.6, IO 4.7.0, IRREDSOL 1.4, LAGUNA 3.9.3, orb 4.8.2, Polenta 1.3.8,
             Polycyclic 2.14, PrimGrp 3.3.2, RadiRoot 2.8, recog 1.3.2, ResClasses 4.7.2, SmallGrp 1.3, Sophus 1.24, SpinSym 1.5.1, TomLib 1.2.8, TransGrp 2.0.4,
             utils 0.65
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'
gap> LoadPackage( "json" );
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading  json 2.0.0 (Reading and Writing JSON)
by Christopher Jefferson (http://caj.host.cs.st-andrews.ac.uk/).
Homepage: https://gap-packages.github.io/json/
Report issues at https://github.com/gap-packages/json/issues
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
true
julia> using GAP
 ┌───────┐   GAP 4.10dev-2263-g9f330be of today
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-apple-darwin18.6.0-julia64-kv7
 Configuration:  gmp 6.1.2, Julia GC, Julia 1.2.0
 Loading the library and packages ...
 Packages:   GAPDoc 1.6.3, PrimGrp 3.3.2, SmallGrp 1.3, TransGrp 2.0.4
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'

julia> GAP.Globals.SetInfoLevel(GAP.Globals.InfoPackageLoading,4);

julia> GAP.Globals.LoadPackage( GAP.julia_to_gap("json") )
#I  json: entering LoadPackage
#I  json: PackageAvailabilityInfo for version 2.0.0
#I  json: kernel functions for json are not available.
#I  json: PackageAvailabilityInfo: the AvailabilityTest function returned false
#I  json: PackageAvailabilityInfo: no installed version fits
#I  json: return from LoadPackage, package is not available
GAP: fail

@mohamed-barakat mohamed-barakat changed the title the GAP package Json fails to load a problem with GAP package loading mechanism Sep 13, 2019
@mohamed-barakat
Copy link
Contributor Author

Together with @ThomasBreuer we figured out that GAP in julia is trying to load json from another path which was compiled for a different GAP although both versions of json coincide and the path for the correct json version is appearing first in EXTRA_GAPROOT.

I will therefore change the title of this issue.

@fingolfin
Copy link
Member

If you have two copies of the same GAP package, with the same version in each, then GAP will pick one, and ignore the other, period. There is nothing GAP.jl can do about this. If at all, this is a GAP issue. But frankly, I am not sure how I'd deal with it on the GAP side either -- in the end, this is a very rare issue that only affects people who dabble with custom GAP root paths -- that's a tiny fraction of our user base, and all "power users".

I.e.: "Then don't do that!" ;-)

That said, if people have suggestions how to deal with this, then opening an issue at the GAP repository for this would be worthwhile.

But this is out of scope for GAP.jl

@mohamed-barakat
Copy link
Contributor Author

I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants