Skip to content

Commit

Permalink
[GAP] Update to 4.12.1 (#5739)
Browse files Browse the repository at this point in the history
* Clean up GAP and GAP_lib build recipes

* [GAP] Update to 4.12.1
  • Loading branch information
fingolfin authored Oct 25, 2022
1 parent c9f2c40 commit b12374b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 50 deletions.
18 changes: 5 additions & 13 deletions G/GAP/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ uuid = Base.UUID("a83860b7-747b-57cf-bf1f-3e79990d037f")
delete!(Pkg.Types.get_last_stdlibs(v"1.6.3"), uuid)

name = "GAP"
upstream_version = v"4.12.0"
version = v"400.1200.000"
upstream_version = v"4.12.1"
version = v"400.1200.100"

julia_versions = [v"1.6", v"1.7", v"1.8", v"1.9"]

# Collection of sources required to complete build
sources = [
# GAP 4.12.0 git tag
GitSource("https://github.com/gap-system/gap.git", "7ba252e2bc68ceccb5d267118d47fa5ca20bc513"),
# ArchiveSource("https://github.com/gap-system/gap/releases/download/v$(upstream_version)/gap-$(upstream_version)-core.tar.gz",
# "2b6e2ed90fcae4deb347284136427105361123ac96d30d699db7e97d094685ce"),
ArchiveSource("https://github.com/gap-system/gap/releases/download/v$(upstream_version)/gap-$(upstream_version)-core.tar.gz",
"1e8e823578e8f1018af592b39bd6f3be1402b482d98f1efb3e24fe6e2f55c926"),
DirectorySource("./bundled"),
]

Expand Down Expand Up @@ -73,13 +71,9 @@ julia_version=$(./julia_version)
--with-zlib=${prefix} \
--with-gc=julia \
--with-julia
mkdir -p build
# WORKAROUND: avoid error: /usr/local/include: No such file or directory
export CPPFLAGS="$CPPFLAGS -Wno-missing-include-dirs"
# WORKAROUND: avoid error: redundant redeclaration of ‘jl_gc_safepoint’ for Julia 1.8 & 1.9
# (see https://github.com/JuliaLang/julia/pull/45120 for a proper fix)
#export CPPFLAGS="$CPPFLAGS -Wredundant-decls"
# configure & compile a native version of GAP to generate ffdata.{c,h}, c_oper1.c and c_type1.c
mkdir native-build
Expand All @@ -91,9 +85,7 @@ cd native-build
--with-zlib=${host_prefix} \
CC=${CC_BUILD} CXX=${CXX_BUILD}
make -j${nproc}
cp build/c_*.c ../src/
cp ffgen ..
cp build/ffdata.* ../build/
cp build/c_*.c build/ffdata.* ../src/
cd ..
# remove the native build, it has done its job
Expand Down
10 changes: 5 additions & 5 deletions G/GAP/bundled/patches/configure.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From bb5f0f05a4da658c1923a9bad54f92871bccf10a Mon Sep 17 00:00:00 2001
From e3ff603685bf881031f7f63ad18a5bdcf191b162 Mon Sep 17 00:00:00 2001
From: Max Horn <[email protected]>
Date: Tue, 13 Sep 2022 16:09:34 +0200
Subject: [PATCH 3/3] configure.ac: patch Julia compiler flags computation
Subject: [PATCH 3/4] configure.ac: patch Julia compiler flags computation

The normal code in GAP invokes Julia to "ask" it for the relevant flags.
But that doesn't work well when cross compiling, and even worse when
Expand All @@ -18,10 +18,10 @@ variables.
1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 78e3912b2..eec745fc5 100644
index a5113c4f7..c3410fac7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -714,35 +714,24 @@ AS_IF([test "x$with_julia" != xno ],[
@@ -718,35 +718,24 @@ AS_IF([test "x$with_julia" != xno ],[
[ AC_MSG_ERROR([invalid argument to --with-julia]) ] )
JULIA_PATH="${PATH}"
])
Expand Down Expand Up @@ -64,5 +64,5 @@ index 78e3912b2..eec745fc5 100644
],
[
--
2.37.3
2.38.1

21 changes: 13 additions & 8 deletions G/GAP/bundled/patches/gcc12.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
commit 6f851174fe92c077e316005612e7246819434e0e
Author: Max Horn <[email protected]>
Date: 2022-09-14 00:12:02 +0200
From 592581753cf7a281eafa251ddc976b0eede11afa Mon Sep 17 00:00:00 2001
From: Max Horn <[email protected]>
Date: Wed, 14 Sep 2022 00:12:02 +0200
Subject: [PATCH 4/4] kernel: workaround GCC 12 warning

kernel: workaround GCC 12 warning

With GCC 12, we get a spurious warning indicating that `buf` in `GetStr`
may be used uninitialized. Weirdly, it does not complain about the almost
identical code in e.g. `GetPragma`.
With GCC 12, we get a spurious warning indicating that `buf` in `GetStr`
may be used uninitialized. Weirdly, it does not complain about the almost
identical code in e.g. `GetPragma`.
---
src/scanner.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scanner.c b/src/scanner.c
index f5dbbcc04..23adc944e 100644
Expand All @@ -21,3 +23,6 @@ index f5dbbcc04..23adc944e 100644
UInt i = 0;

while (c != '"' && c != '\n' && c != '\377') {
--
2.38.1

6 changes: 3 additions & 3 deletions G/GAP/bundled/patches/julia_gc.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 739f802c85c747e509670c56606563e2570839ea Mon Sep 17 00:00:00 2001
From 2deedf339740abf0abd25eee3e98211cf5c7ec5a Mon Sep 17 00:00:00 2001
From: Max Horn <[email protected]>
Date: Tue, 13 Sep 2022 16:09:19 +0200
Subject: [PATCH 2/3] Don't invoke jl_init()
Subject: [PATCH 2/4] Don't invoke jl_init()

This is not needed when running this code from within Julia
---
Expand All @@ -21,5 +21,5 @@ index db02b5d39..c5c536467 100644
SetJuliaTLS();
#ifdef SKIP_GUARD_PAGES
--
2.37.3
2.38.1

20 changes: 10 additions & 10 deletions G/GAP/bundled/patches/no-strip.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From fe60c6174563dcf2e193726aac960713c1c522c7 Mon Sep 17 00:00:00 2001
From 8d35396cc4fb43700b857ca7b2063f48844763d6 Mon Sep 17 00:00:00 2001
From: Max Horn <[email protected]>
Date: Tue, 13 Sep 2022 16:07:40 +0200
Subject: [PATCH 1/3] Don't strip binaries when installing them
Subject: [PATCH 1/4] Don't strip binaries when installing them

This works around an error when cross-compiling on Yggdrasil for macOS:
the `/usr/bin/install` binary is from BusyBox and insists on adding `-p`
Expand All @@ -12,27 +12,27 @@ supported by the `strip` executable for macOS.
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.rules b/Makefile.rules
index dc619819f..2db76b410 100644
index 368814df2..c7ecd4cda 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -583,7 +583,7 @@ install-bin: gap
@echo "Warning, 'make install-bin' is incomplete"
@@ -586,7 +586,7 @@ export gap_wrapper
install-bin: gap
# install the real GAP executable as $(libdir)/gap/gap
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)/gap
- $(INSTALL) -m 0755 -s gap $(DESTDIR)$(libdir)/gap
+ $(INSTALL) -m 0755 gap $(DESTDIR)$(libdir)/gap
- $(LTINSTALL) -s gap $(DESTDIR)$(libdir)/gap
+ $(LTINSTALL) gap $(DESTDIR)$(libdir)/gap

# install a wrapper shell script invoking the real GAP executable as $(bindir)/gap
$(INSTALL) -d -m 0755 $(DESTDIR)$(bindir)
@@ -661,7 +661,7 @@ install-headers: $(FFDATA_H) build/version.h
@@ -663,7 +663,7 @@ install-headers: $(FFDATA_H) build/version.h

install-libgap: libgap.la
@echo "Warning, 'make install-libgap' is incomplete"
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)
- $(LTINSTALL) -s libgap.la $(DESTDIR)$(libdir)
+ $(LTINSTALL) libgap.la $(DESTDIR)$(libdir)


.PHONY: install install-bin install-doc install-gaproot install-headers install-libgap
--
2.37.3
2.38.1

22 changes: 11 additions & 11 deletions G/GAP_lib/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ using BinaryBuilder, Pkg
# to all components.

name = "GAP_lib"
upstream_version = v"4.12.0"
version = v"400.1200.000"
upstream_version = v"4.12.1"
version = v"400.1201.100"

# Collection of sources required to complete build
sources = [
# snapshot of GAP master branch leading up to GAP 4.12:
GitSource("https://github.com/gap-system/gap.git", "7ba252e2bc68ceccb5d267118d47fa5ca20bc513"),
# ArchiveSource("https://github.com/gap-system/gap/releases/download/v$(upstream_version)/gap-$(upstream_version)-core.tar.gz",
# "2b6e2ed90fcae4deb347284136427105361123ac96d30d699db7e97d094685ce"),
ArchiveSource("https://github.com/gap-system/gap/releases/download/v$(upstream_version)/gap-$(upstream_version)-core.tar.gz",
"1e8e823578e8f1018af592b39bd6f3be1402b482d98f1efb3e24fe6e2f55c926"),
ArchiveSource("https://github.com/gap-system/gap/releases/download/v$(upstream_version)/packages-required-v$(upstream_version).tar.gz",
"2f2b19406d5926ccdd0957da52ca36824fcd8252193a5a5d2677463516ec8cf1";
"86d24a1a2208d57822b9aed159b2d5c1306e1a800c6440c6a0d4566e65829c57";
unpack_target="pkg"),
]

Expand All @@ -40,9 +38,9 @@ script = raw"""
cd ${WORKSPACE}/srcdir/gap*
mv ../pkg .
find pkg -name '._*' -exec rm \{\} \; # unwanted files
# run autogen.sh if compiling from it source and/or if configure was patched
# must run autogen.sh if compiling from git snapshot and/or if configure was patched;
# it doesn't hurt otherwise, too, so just always do it
./autogen.sh
# compile a native version of GAP so we can use it to generate the manual
Expand All @@ -57,8 +55,10 @@ find pkg -name '._*' -exec rm \{\} \; # unwanted files
CC=${CC_BUILD} CXX=${CXX_BUILD}
make -j${nproc}
# build the manual (only HTML and txt; for PDF we'd need LaTeX)
make html
# build the manual if necessary (only HTML and txt; for PDF we'd need LaTeX)
if [[ ! -f doc/ref/chap0.html ]] ; then
make html
fi
# the license
install_license LICENSE
Expand Down

0 comments on commit b12374b

Please sign in to comment.