-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
GAP: make GAP_ROOT_PATHS configuration unnecessary #37344
base: develop
Are you sure you want to change the base?
Conversation
Note that `self.__make_workspace` is true only when `use_workspace_cache` is false, hence `self.__use_workspace_cache and self.__make_workspace` is never true.
Since the `gap` binary itself knows the paths, there's no need. In fact, configure got the paths from running `gap`.
I think the assumption that This should really go through an See: |
We already assume that
Orthogonal to this PR. Please open a separate issue to avoid cluttering this one. This PR is focused on making Fixing other issues, unless caused by this PR, is not a goal. |
It's not orthogonal because it's the present PR would be a regression for library use of sage.libs.libgap, which currently works with the GAP as configured at compile time |
I'd appreciate a more detailed report. AFAICT the current version defaults OTOH if using Note that unlike There's still an issue that [0] at best we could take the location of the library, say |
@mkoeppe I added one more commit for If this is good for you, the missing bits are:
Otherwise, a wise man said: "describe the actual system configuration (not an imagined one), describe what happens". Maybe that would make it easier to work out. I already described explicitly two circumstances under which the status quo is broken and needs to be fixed. |
Same comment as on #37308: We append the |
Here's the relevant part of my comment in #37308. Let me know if this looks reasonable. What we need is a configuration, let's tentatively call it This means: a. for
b. for
(here c. the for
(with the systemfile trick this is quick enough to do at runtime) |
What makes this a "blocker"? |
The same as #37178. |
The conda workflow is failing here and these failures propagate to every other PR via the blocker label. Hence degrading the priority. |
@tobiasdiez Good call. I've seen these failures on PRs but didn't have a chance to check where they were coming from. |
Thanks for noticing it. I don't understand what's going on here:
In effect we are doing something like:
Is there a bug in that code? What do you get doing that in conda? What would be the way to access package data files? I could place the file in I guess an alternative is to do |
I think the issue is that |
I agree. The runs for the other Python versions seem to work. Another reason to opt-out from the namespace packages for the moment #36753. |
People, that's why we carry the backport package |
Documentation preview for this PR (built with commit edcc082; changes) is ready! 🎉 |
importlib.resources is supported since python 3.7; importlib_resources is not used at all in sagelib, and can (should) be removed. |
Yes, the module The backport package More questions? |
I know that -- I added it in #35203 because I knew that it will be needed later. And you just found the first use. |
Not useful. This is unnecessary dependency; some distros don't ship importlib_resources anymore so we should stick to what's available in python. Besides,
I did not ask a question, but since you knew python 3.9 did not support namespace packages, a mention before I had to debug this would have been nice. |
It doesn't try to. You use |
Yes, that's how the official backport packages work. |
Sorry I didn't notice you are using importlib.resources in this branch! |
Could it be that these are distros that only ship Python packages for the latest version of Python? |
@tornaria Now that you know to use |
LGTM |
I don't think this is in a mergeable state, e.g. class KERNEL_INFO(dict):
"""
doc
""" And while I would also love it if we didn't need |
Its only instantiated on use, and not on Sage startup I presume? Lets fix then docstring, then. |
I can't say for sure because the sage build fails for me right now and I don't have time to figure out why. Regardless, a huge portion of sage uses GAP, so it's not like you're going to avoid the penalty. |
As shown in #37308, running with
GAP_ROOT_PATHS
misconfigured results in awful breakage, and there are several situations where it's difficult to get this rigth (#37263, #37308 (comment)).The current PR makes minimal changes in
gap
andlibgap
to make this configuration unnecessary. Instead, we obtain the necessary information from thegap
command.Note that the user can still change the gap command with
SAGE_GAP_COMMAND
. This includes the possibility to change the paths to a custom with something likeSAGE_GAP_COMMAND='gap -l "path1;path2;path3"'
, etc.Details:
The first three commits are cleanup to replace global WORKSPACE by an attribute. This necessary to prevent circular references, and it's also good form and simplifies a number of tests which want running a gap instance with a temporary workspace file.
This one is trivial since the
gap
command knows the paths.Implements a fast version of KERNEL_INFO() which obtains the configuration we need by running the
gap
command but avoiding the full initialization of gap which is costly.See #33446 (comment) and #33446 (comment) for this idea, which I discarded previously because it was pretty slow. Compare:
with
The implementation returns only a few selected variables from
KERNEL_INFO()
but it would be easy to add more variables as needed insrc/sage/interfaces/gap_kernel_info.g
.TODO: add documentation and tests for
KERNEL_INFO()
.It is now very easy to rid of all usages of
GAP_ROOT_PATHS
, replacing it by use ofKERNEL_INFO()
.This even makes some code easier, e.g.,
gap_workspace_file()
previously had to find and parsesysinfo.gap
to read version and architecture, now it can obtain all the required information directly fromKERNEL_INFO()
.📝 Checklist
EDIT: formatting