-
Notifications
You must be signed in to change notification settings - Fork 22
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
GAPTypes are added to the main environment #305
Comments
So first of, I agree with this in principle, and would love to get rid of it, and @sebasguts had a hard time to convince me to add it in the first place; but back then we couldn't come up with a better solution to the problem(s) this is meant to help work around, and frankly needed to make progress, so went with the ugly hack in the end. It certainly is possible that one can come up with a better solution if one has a better understanding of Julia package management; I am hoping it is! Before I go on, let me point out that also GAP's I'll now try to explain from the top of my head why I think we do this. However, it's been some time, and while I asked @sebasguts to please write down the reasoning somewhere for future discussions like this one, I don't think it ever happened :-/ (but if it did and I just can't find it, then hopefully Sebastian will let us know ;-). The start of it all is that we wanted to enable precompilation of (at least parts of) OK problem solved, except we have a new one: now the GAP kernel code, which defines Except: remember that
And what I just described only was concerned with setting 1. In setting 2, we now face a chicken-and-egg problem: GAP needs to initialize on the C level before else {
// GAP.jl is not yet loaded, i.e., this is a standalone GAP; so try to
// load GAPTypes.jl directly and into the main module
parent_module = jl_main_module;
jl_eval_string("import GAPTypes");
if (jl_exception_occurred()) {
Panic("could not import GAPTypes module into Julia");
}
} So this literally evaluates the expression At this point, you may wonder: "So, why care about this, I only want to use Julia from GAP". Well, yeah, but if you want to use any of the GAP packages that need compilation, chances are that their build systems need to invoke Iit's unclear to me how to resolve this conundrum. One crazy idea I should try would be to simply declare There are probably some things I missed to explain, or forgot, or got wrong, but I think at least the broad issue should be clearer. |
I understand, but the actual reported thing is that local installation of GAP.jl modifies the global/main environment. I'm totally fine with it adding One potential solution is to create |
OK, installing into the local environment sounds like it might lead to a workable solution (at least of part of the problem). But to be honest, I've very little experience using environments; I will work on changing that; in the meantime, if you have a pointer for me what to change in Hm, there is another weird thing in |
Ah, I think it may have been in there to make it easy to locate the GAP executable when running on Travis. But there are of course better ways to do that. |
well, the other thing is to have exactly one version of GAP tree for julia ;) julia_load_path_save = ENV["JULIA_LOAD_PATH"]
pop!( ENV, "JULIA_LOAD_PATH" )
julia_executable = joinpath(julia_binary, "julia")
run(`$(julia_executable) -e 'import Pkg; Pkg.add("GAPTypes")'`)
ENV["JULIA_LOAD_PATH"] = julia_load_path_save and I'm asking myself why isn't it just |
"the other thing is to have exactly one version of GAP tree for julia" -> but that's not what that did or was about. It just was a symlink which pointed to the last There are issue with sharing a single GAP tree: at the very least, we need to compile GAP once for each for version of Julia (so for 1.1, 1.2, 1.3). GAP actually allows multiple out-of-tree build dirs from a single source, so that could even be done with a single GAP source dir (but emphasis on could -- "somebody" would have to code the required logic. Shouldn't be too hard, but requires non-zero effort). Next, as I said, in the future the plan is not to clone a git repo, but rather use a fixed version of GAP (I'd assume that's what e.g. |
Regarding that |
so I guess the problem is In Polymake only the thin CxxWrapper is built against Lets meet on slack/skype and discuss why GAPObj needs to be an abstract type, shall we? |
In the past, there was no I am happy to discuss other ways to solve this, and be super glad if we could get rid of |
build.jl
should not add packages to the global environment as it does nowThe text was updated successfully, but these errors were encountered: