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

kernel: move GAP_KERNEL_{MINOR,MAJOR}_VERSION to version.h resp. gap_version.h #4674

Merged

Conversation

fingolfin
Copy link
Member

@fingolfin fingolfin commented Oct 18, 2021

The goal is to eventually move #include "config.h" from common.h into all the .c and .cc files. This greatly simplifies the installation of headers as part of make install. It also means that the same set of headers can be shared by multiple binary builds of GAP; i.e. one could then install plain GAP, HPC-GAP and Julia-GAP in parallel.

This is just a step towards this goal (not the last one, nor the first one), but we are getting pretty close now.

This is a subset of PR #4492.

UPDATE: most of this PR has now been merged via PR #4678. What remains is the code which moves GAP_KERNEL_{MINOR,MAJOR}_VERSION to version.h resp. gap_version.h. The reasons why I give two names is because I've switched around between the two: I prefer the former one as simpler, but I thought for a while that this was perhaps the reason behind the strange failures in the CI tests for the release process, which break down when building HPC-GAP, because version.h resp. gap_version.h are not found (i.e., they are not generated). But apparently the name is not the cause for the breakage after all... very weird

Closes #4679.

@fingolfin fingolfin added topic: kernel release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Oct 18, 2021
src/common.h Outdated Show resolved Hide resolved
src/gap_version.h.in Outdated Show resolved Hide resolved
Makefile.rules Outdated Show resolved Hide resolved
@fingolfin fingolfin force-pushed the mh/reduce-autoconf-usage-in-headers branch 2 times, most recently from 9329663 to ac21b7d Compare October 19, 2021 19:32
@fingolfin
Copy link
Member Author

Weird failure in the "Wrap release" CI scripts when building HPC-GAP out of tree. E.g. in this build log, we see:

In file included from ../src/ariths.c:17:
../src/modules.h:19:10: fatal error: version.h: No such file or directory
   19 | #include "version.h"
      |          ^~~~~~~~~~~
compilation terminated.
make: *** [../Makefile.rules:357: build/obj/src/ariths.c.lo] Error 1

However, I cannot reproduce this on locally (yet).

@fingolfin fingolfin force-pushed the mh/reduce-autoconf-usage-in-headers branch from dcc8847 to 58e7079 Compare October 22, 2021 10:04
@fingolfin fingolfin changed the title kernel: reduce reliance on autoconf defined values (via config.h) in our header files kernel: move GAP_KERNEL_{MINOR,MAJOR}_VERSION to version.h resp. gap_version.h Oct 25, 2021
@fingolfin fingolfin force-pushed the mh/reduce-autoconf-usage-in-headers branch from 58e7079 to 0fa0b0c Compare October 25, 2021 08:41
dev/releases/utils.py Outdated Show resolved Hide resolved
@fingolfin fingolfin force-pushed the mh/reduce-autoconf-usage-in-headers branch 2 times, most recently from 5fa5bd4 to b28c8a0 Compare October 25, 2021 13:05
The `vpath` directives are what makes out-of-tree builds possible. With
them, if a source file is not present in `${builddir}`, then GNU make
automatically looks for it in `${srcdir}`.

For files in `src`, this is generally what we want. But for generated
files in `build`, we do *not* want that. As a result, it could happen
that instead of `${builddir}/build/gap_version.c` we would access
`${srcdir}/build/gap_version.c`, and so on.

This patch fixes this by restricting the `vpath` directives to files
inside `src` subdirectory.
@fingolfin fingolfin force-pushed the mh/reduce-autoconf-usage-in-headers branch from 1934161 to 5e2e37b Compare October 25, 2021 20:39
@fingolfin fingolfin marked this pull request as draft October 25, 2021 20:40
Also rename gap_version.c to version.c and likewise for the header file.
Copy link
Member

@wilfwilson wilfwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the explanations in various places on issues/PRs/commit messages/comments.

@fingolfin fingolfin merged commit 584062c into gap-system:master Oct 26, 2021
@fingolfin fingolfin deleted the mh/reduce-autoconf-usage-in-headers branch October 26, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants