kernel & buildsys: change how internal GAP headers are included to minimize conflicts with OS headers#6007
Conversation
|
OK, that's a good catch. |
719d98a to
192e7e3
Compare
|
This is certainly the correct change, although |
|
Thank you for the approval! I have manually checked |
|
First off: thank you for your contribution, it would of course be great if someone finally worked a bit on improving "native" (well, MinGW based) Windows support. That said, I am torn about this PR because GAP is not only used and compiled "directly from source", but also in installed form, after With your proposed patch, everyone everywhere will have to use Mind you, I am not saying "no", but I need a bit more time to ponder it (and perhaps @ChrisJefferson would like to chime in, too). Alternatives I can think of right now include:
(Actually I guess my second point could already be done now, if we just place both |
|
Yes, I would prefer not to adjust the build system, just because adding extra complication to all the places GAP is built (in various distros, and many packages have slightly different build systems for historical reasons). I would be happy to rename the file (git tends to cope with that fairly well). It would be good to know if anything else collided, so we could do the renaming in one go. |
|
IMHO, it's better to put all the GAP headers into a subdirectory, e.g. The old code can either do a straightforward renaming, or add It's certainly not the first time such changes become inevitable in various projects - GAP held out for so long just due to the lack of |
|
Thank you all for the comments. I will be happy to make some improvements to unblock the native Windows build. For this PR, I can do the renaming, and I like @dimpase's idea to move all headers under a subdirectory to effectively namespace the header files and solve the conflicting names once and for all. @fingolfin, forgive my very limited understanding, but were you suggesting hiding all the headers and exposing only gap_all.h instead? I am not familiar with the concept of kernel extensions. My understanding is that kernel extensions outside this repository use these headers too, and your suggestion involved a slow migration process, i.e., by maintaining backward compatibility for those external kernel extensions by still providing the rest of the .h headers for a specific period. Am I understanding your suggestion correctly? Since this sounds like something that can be done in parallel with the renaming, I will proceed with the subdirectory idea for now, and we can open a separate issue to discuss this long-term migration further if it is still needed, as I can see @dimpase has a different opinion on it (CMIIW). What do you think? |
|
historically, GAP kernel modules were always built in-tree, that's why very little had been done as far as header namespaces go. Many packages had to move to headers in subdirectories: to name a few in the area of algebra: gmp, flint/flintlib, cdd/cddlib. As far as distributions go, they would very much appreciate neat header handling, as dumping everything in |
|
@dimpase all GAP headers are already in a subdirectory Your suggestion to adding @ptrrsn no, that's not my suggestion. Or rather: the GAP headers are already "hidden away" when GAP is installed, namely in What I am proposing is this instead:
The main drawback is that it'll break packages with kernel extensions not in the GAP distro right now. But we can solve this for many of them by also adding a |
I was talking about kernel modules, and got carried away a bit, sorry for confusion. As far as the GAP build itself, moving all Also, IMHO, the de facto standard is that the internal headers be I don't see this, or the solution offered by this PR, as being problematic for various downstreams. Distros (including SageMath) will adapt easily, GAP package builders ought to use the installed GAP headers, anyway.
No, that was meant for downstream users of GAP, not for the GAP itself. But, sorry, my memory was fuzzy on the state of |
|
@dimpase err you are apparently ignorant of what GAP currently does despite me explicitly stating it: we already install headers in a separate dir and our Overall your comments really don't contribute positively to the discussion. I'd appreciate if you just kept out if it, we have it under control. |
|
@fingolfin I only ventured into it cause @ptrrsn happens to be my former student. But I don't mean to lecture anyone, I'm as usual totally tone-deaf, apologies.. By the way, what upsets me about GAP is that I have a PR ready in gap-packages/ace for literally years, and you just seem to ignore it, despite reminders. |
|
Thank you everyone for the comments. @fingolfin I updated my changes with my interpretation of your proposal. Could you check if my understanding is correct? The way I tested it by:
But looking at the CI breakage, it seems that those tests are not enough... |
|
Ah, okay, the failure is due to io package build failure. And it can be fixed by changing the use of #include "profile.h" in io package. I will make that change in the io package. |
Removing it because gap_all.h is already included. For more context why we need this, please see: gap-system/gap#6007
|
To accomodate this, I created two PRs on two packages: |
Removing it because gap_all.h is already included. For more context why we need this, please see: gap-system/gap#6007
|
Ah, sorry, I accidentally triggered a CI run from a sync. I will try to fix the failures, except the "CI / testbuildsys; testmockpkg testinstall - NO_COVERAGE = 1 ..." seems to be an infrastructural failure. I also saw that in my other PR. |
|
@fingolfin I think I have fixed all the CI problems (except the infrastructure failure one). As for HPC, I added all An alternative but more intrusive option is to change all such includes in |
fingolfin
left a comment
There was a problem hiding this comment.
Thanks a lot for working on this, much appreciated! I left some more comments.
|
So @ChrisJefferson kinda convinced me, but then I also had another think, and realized we might be able to simplify a few things again... So I tweaked this PR a bit to avoid the need for I'd be happy to merge this now if you are also OK with it, @ptrrsn |
|
Wow, thank you for the additional patches! They look really great! |
The header io.h from MinGW is hidden by gap's io.h which is causing compilation error. Changing -I to -iquote ensures that all gap header files are included with quotes, while the standard library header files are included with the <>.
This helps the work for #4157