-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add etc/Makefile.gappkg
, for use in the build system of GAP package with kernel extensions
#3683
Conversation
# build rule for C++ code | ||
# The dependency on Makefile ensures that re-running configure recompiles everything | ||
gen/%.lo: %.cc Makefile | ||
$(QUIET_GAC)$(GAC) -d -p "$(KEXT_DEPFLAGS)" -p "$(KEXT_CXXFLAGS)" -c $< -o $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this perhaps also support KEXT_CPPFLAGS
, which would be passed to both C and C++ compilers?
Should we also support other C++ file extensions, such as .cxx
, .cpp
? The gac
tool supports all three, although .cxx only starting with GAP 4.11.
On Travis, test against GAP 4.9, too (this package claims to be compatible with it). As for the build system: stop using autotools, use Makefile.gappkg instead (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
I think we should go with option (2) and plan not to break it. If something really serious happened and we decided we had to make breaking changes, we could also introduce Makefile-v2.gappkg or something crazy like that. |
Yeah, indeed, of course the plan is to avoid breaking stuff as much as possible ;-). To this end, before merging this PR, I'd also try hard to get as many packages as possible working with a version of it. I already submitted a bunch of PRs resp. updated repos. Two more tricky ones are gap-packages/PARIInterface#24 and gap-packages/GaloisGroups#9 which already lead me to make several major changes to the code in here, to make it easier to combine it with other build steps. |
The file Makefile.gappkg is already use by several GAP packages. By shipping it with GAP, it gets easier for new GAP packages to provide simple kernel extensions.
9b50a7d
to
ce601d0
Compare
Backported to stable-4.11 in fb0f52d |
Stop using autotools, and instead start to use Makefile.gappkg (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
Stop using autotools, and instead start to use Makefile.gappkg (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
Stop using autotools, and instead start to use Makefile.gappkg (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
Stop using autotools, and instead start to use Makefile.gappkg (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
Stop using autotools, and instead start to use Makefile.gappkg (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
Stop using autotools, and instead start to use Makefile.gappkg (see <gap-system/gap#3683>); this has several advantages, e.g. running configure is much quicker (esp. on macOS and Windows), it automatically rebuilds if GAP changed (detected via changes to GAP's sysinfo.gap), and of course there is no need for autoconf, automake, autogen.sh etc., nor need to deal with M4 syntax in cryptic configure.ac scripts
etc/Makefile.gappkg
, for use in the build system of GAP package with kernel extensions
Summary
The file
etc/Makefile.gappkg
provides the core of a build system for GAP packages with a kernel extension, with nice features, such as automatic recompilation if any source files or parts of the build system changed, or if GAP itself changed.It is already use by several GAP packages. By shipping it with GAP, it gets easier for new GAP packages to provide simple kernel extensions.
Goals and questions
There are two ways this could be used:
Makefile.gappkg
in their package, but should have a line like this in theirconfigure
script:The two approaches balance work between the GAP team, and package maintainers:
Approach 1 is more defensive; it means that in order to benefit from improvements to this file, package authors will have to copy the file over to their package from time to time (but carefully so, as newer versions might not be compatible with older versions of GAP; right now, this file is compatible with at least GAP 4.9, 4.10 and 4.11, but I already have an improvement in mind that would require a new
gac
version and thus would not be backwards compatible). After copying the file, they also need to make a release. Based on past experience, this may never happen, or only with a delay of several years, unless somebody from the GAP team actively pushes all involved packages resp. their maintainers to action, which means a lot of work.Approach 2 requires virtually no effort from package maintainers. It does, however, slightly increase the strain on the GAP team itself, as we'd have to be careful with any change so as not to break existing packages relaying on
Makefile.gappkg
. However, we already have CI tests which build and test all deposited packages; so we should notice regressions quickly. In the worst case, a change may need to be coordinated with updates to some packages, but that is still less work than with approach 1.Hence, overall I prefer approach 2, but would be interested to learn what others think.
Other considerations
The name
Makefile.gappkg
is not set in stone. Alternative suggestions are welcome.I marked this as
backport-to-4.11
, and referenced 4.11 in the code comments, because (a) there is no risk of regression when adding a completely new file like this, and (b) the sooner this is in a GAP release, the sooner people can use it, and the sooner they can drop backwards compatibility code (I'd still expect that to take a couple years, but reducing from N to N-1 years still is good ;-).Some packages need to build other things than just a GAP kernel extension. I tried to write
Makefile.gappkg
with this in mind; hence most variables are prefixed withKEXT_
to avoid clashes, build rules are set up to be extensible, and so on). However, this may require some further tweaking based on experience with integrating this into packages with more complex build requirements.Ideally I'd like to use this in the Example package, so that people can see how to use it there; and of course also in PackageMaker.
Affected packages
Packages that use (a version of) this file, resp. for which I submitted a PR to use a copy of it, include these:
A few other packages either use older versions of the build rules in here, or could otherwise easily be adapted to use them, if so desired, including:
Packages that could perhaps use it (I didn't look closely), but might still require more complicated configure scripts (autoconf based?) to check for required 3rd party dependencies include: