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

libgap: add a clean way to disable loading init.g (i.e. set SyLoadSystemInitFile to 0) #5890

Open
fingolfin opened this issue Jan 3, 2025 · 0 comments
Labels
topic: libgap things related to libgap

Comments

@fingolfin
Copy link
Member

This is needed by GAP.jl (which currently does it by "manually" poking 0 into SyLoadSystemInitFile), and also logically makes sense.

One way would be to add an argument BOOL dontLoadInitFile or so to GAP_Initialize (or its reverse).

Another would be to split this out from GAP_Initialize completely, i.e. GAP_Initialize never loads init.g, instead a second API is added to do it. That second call would could needed anyway. For reference, GAP.jl handles this part as follows right now:

    if ccall((:READ_GAP_ROOT, libgap), Int64, (Ptr{Cchar},), "lib/init.g") == 0
        error("failed to read lib/init.g")
    end

which is based on what the GAP kernel itself does right now:

    if ( SyLoadSystemInitFile ) {
      GAP_TRY {
        if ( READ_GAP_ROOT("lib/init.g") == 0 ) {
                Pr( "gap: hmm, I cannot find 'lib/init.g' maybe"
                    " use option '-l <gaproot>'?\n", 0, 0);
                SystemErrorCode = 1;
            }
      }
      GAP_CATCH {
          Panic("Caught error at top-most level, probably quit from "
                "library loading");
      }
    }

I intend to eventually work on this, but for now have other priorities, so I am putting this here to (a) not forget, and (b) just in case someone else is interested in tackling this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: libgap things related to libgap
Projects
None yet
Development

No branches or pull requests

1 participant