gap icon indicating copy to clipboard operation
gap copied to clipboard

WIP: gap root path unification

Open fingolfin opened this issue 9 months ago • 0 comments
trafficstars

This is not yet quite done, but the goal is to ensure that the GAP kernel and library use the same (identical, egal) plist of root paths.

This has multiple benefits:

  • we replace gnarly C code messing with pointers, manual memory allocation, careful copying around of memory blocks, and which is limited to a hard coded maximum of 16 GAP roots, and also limits the length of paths
  • the replacement is simple C code, that produces a plist of strings objects
  • this plist can then be shared with the GAP library (this part is not yet done! not because it is hard, but just because I did not yet get around to doing it)
  • kernel and library thus get an identical list of root paths, avoiding weird issues caused by them differing
  • most post-processing of the root paths, such as turning relative paths into absolute paths, or removing duplicates, can be done entirely on the GAP level

TODO:

  • [x] actually pass the root path list to the library
  • [x] restore the code which expands ~ into $HOME
  • [ ] fix HPC-GAP compat
  • [ ] fix workspace support
  • [ ] figure out implications for GAP workspaces:
    • ... because right now, if we load a workspace, then the root path list of the kernel is computed fresh, while that of the library is restored from the workspace
    • with this PR, the restore should also replace the root path list of the kernel
    • for most cases this shouldn't make a difference, but it should be possible to construct examples where it makes a visible difference. I think this is fine right now, but this warrants some more carefully thinking
  • [ ] more testing & debugging...
  • [ ] possibly split off parts of the PR into separate PR so they can be reviewed and merged more easily

Note that most likely right workspaces are simply broken, but if so I know why and this will be addressed by the above.

Resolves #4675

fingolfin avatar Feb 18 '25 10:02 fingolfin