From 6148256ef351c925aa152e3535098a56e0accb68 Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Wed, 1 Oct 2025 15:44:52 +0100 Subject: [PATCH 1/2] Remove support for GAP 4.10 --- .github/workflows/ubuntu.yml | 8 -------- Makefile.gappkg | 2 +- PackageInfo.g | 2 +- README.md | 2 +- init.g | 7 ------- m4/find_gap.m4 | 3 --- read.g | 6 ------ src/gap-includes.h | 6 +----- src/gap_all.h | 20 -------------------- tst/standard/grahom.tst | 18 ++++++++---------- 10 files changed, 12 insertions(+), 62 deletions(-) delete mode 100644 src/gap_all.h diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5d1171bbc..fa00f3928 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -45,9 +45,6 @@ jobs: mode: default # There wouldn't be much point testing GAP v4.11 with only needed packages. The only difference is whether Grape is loaded. pkgs-to-clone: https://github.com/digraphs/graphviz.git pkgs-to-build: io* orb* datastructures* profiling* grape* - - gap-version: v4.10 # Note: NautyTracesInterface requires GAP 4.12 - mode: default # There wouldn't be much point testing GAP v4.10 with only needed packages. The only difference is whether Grape is loaded. - pkgs-to-build: io* orb* datastructures profiling* grape* steps: - uses: actions/checkout@v5 @@ -60,16 +57,11 @@ jobs: - name: "Build Digraphs . . ." uses: gap-actions/build-pkg@v2 - name: "Clone additional GAP packages . . ." - if: ${{ matrix.gap-version != 'v4.10' }} run: | for PKG in ${{ matrix.pkgs-to-clone }}; do cd ${GAPROOT}/pkg git clone $PKG done - # Special case for GAP v4.10 as it requires checking out a non-default ref - - name: "Clone datastructures v0.2.5 (GAP 4.10 only) . . ." - if: ${{ matrix.gap-version == 'v4.10' }} - run: git clone -b v0.2.5 https://github.com/gap-packages/datastructures ${GAPROOT}/pkg/datastructures - name: "Build relevant GAP packages . . ." run: | cd ${GAPROOT}/pkg diff --git a/Makefile.gappkg b/Makefile.gappkg index 2663dcb96..5746c0a0c 100644 --- a/Makefile.gappkg +++ b/Makefile.gappkg @@ -51,7 +51,7 @@ KEXT_BINARCHDIR = bin/$(GAParch) KEXT_SO = $(KEXT_BINARCHDIR)/$(KEXT_NAME).so # the following settings are provided by sysinfo.gap in GAP >= 4.12; -# for compatibility with older GAP version (at least 4.9, 4.10, 4.11) +# for compatibility with GAP 4.11 # we try to "guess" suitable values here GAP ?= $(GAPPATH)/gap GAC ?= $(GAPPATH)/gac diff --git a/PackageInfo.g b/PackageInfo.g index edbfb2e38..013414fa0 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -539,7 +539,7 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">=4.10.0", + GAP := ">=4.11.0", NeededOtherPackages := [["IO", ">=4.5.1"], ["orb", ">=4.8.2"], ["datastructures", ">=0.2.5"]], diff --git a/README.md b/README.md index c17926137..ac6707a7b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ For questions, remarks, suggestions, and issues please use the ## Installation It is assumed that you have a working copy of [GAP][] with version number -4.10.0 or higher. The most up-to-date version of GAP, and instructions on how +4.11.0 or higher. The most up-to-date version of GAP, and instructions on how to install it, can be obtained from the [main GAP webpage](https://www.gap-system.org). diff --git a/init.g b/init.g index 9edfe8d60..20ed2f3dd 100644 --- a/init.g +++ b/init.g @@ -45,13 +45,6 @@ fi; if not IsBound(Adjacency) then Adjacency := IdFunc; fi; -# Avoid warnings with GAP 4.10 for use of FlipBlist -# Can be removed once Digraphs requires GAP>=4.11 -if not IsBound(FlipBlist) then - FlipBlist := function(BList) - Apply(BList, x -> not x); - end; -fi; ReadPackage("digraphs", "gap/digraph.gd"); ReadPackage("digraphs", "gap/digraphs.g"); diff --git a/m4/find_gap.m4 b/m4/find_gap.m4 index 6899daf51..dbe036b88 100644 --- a/m4/find_gap.m4 +++ b/m4/find_gap.m4 @@ -83,9 +83,6 @@ AC_DEFUN([FIND_GAP], AC_MSG_ERROR([No GAP_CPPFLAGS is given]) fi - # compatibility with GAP 4.9 (not needed in GAP >= 4.10) - GAP_CPPFLAGS="$GAP_CPPFLAGS -I${GAP_LIB_DIR}/src" - AC_SUBST(GAPARCH) AC_SUBST(GAPROOT) AC_SUBST(GAP_CPPFLAGS) diff --git a/read.g b/read.g index e04a710fe..40ae189c5 100644 --- a/read.g +++ b/read.g @@ -30,12 +30,6 @@ BindGlobal("DIGRAPHS_NautyAvailable", Unbind(_NautyTracesInterfaceVersion); -# Delete this when we no longer support GAP 4.10 -if not CompareVersionNumbers(ReplacedString(GAPInfo.Version, "dev", ""), "4.11") - and not IsBound(INTOBJ_MAX) then - BindGlobal("INTOBJ_MAX", 1152921504606846975); -fi; - ReadPackage("digraphs", "gap/utils.gi"); ReadPackage("digraphs", "gap/digraph.gi"); ReadPackage("digraphs", "gap/constructors.gi"); diff --git a/src/gap-includes.h b/src/gap-includes.h index 95db0a4c5..ab4c7a6cd 100644 --- a/src/gap-includes.h +++ b/src/gap-includes.h @@ -27,8 +27,4 @@ // GAP headers #include "gap_all.h" // for Obj, Int // -#ifdef GAP410_OR_OLDER -#include "compiled.h" // FIXME Remove include when we don't support GAP 4.10 -#endif - -#endif // DIGRAPHS_SRC_GAP_INCLUDES_H_ +#endif // DIGRAPHS_SRC_GAP_INCLUDES_H_ diff --git a/src/gap_all.h b/src/gap_all.h deleted file mode 100644 index 0b18be2e9..000000000 --- a/src/gap_all.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* -** -*A gap_all.h GAP package Digraphs Julius Jonusas -** James Mitchell -** Wilf A. Wilson -** Michael Young -** -** Copyright (C) 2014-25 - Julius Jonusas, James Mitchell, Wilf A. Wilson, -** Michael Young -** -** This file is free software, see the digraphs/LICENSE. -** -*******************************************************************************/ - -#ifndef DIGRAPHS_SRC_GAP_ALL_H_ -#define DIGRAPHS_SRC_GAP_ALL_H_ -// Delete this file once we no longer support GAP 4.10. -// This is a hack to get Digraphs to compile on GAP 4.10 still. -#define GAP410_OR_OLDER -#endif // DIGRAPHS_SRC_GAP_ALL_H_ diff --git a/tst/standard/grahom.tst b/tst/standard/grahom.tst index 74e30e95b..470c89e17 100644 --- a/tst/standard/grahom.tst +++ b/tst/standard/grahom.tst @@ -52,16 +52,14 @@ Error, the 7th argument must 0, 1, or 2, not -1, gap> HomomorphismDigraphsFinder(gr1, gr2, fail, "a", infinity, 2, 1, 0, 0, > 0, 0); Error, the 8th argument must be a list or fail, not integer, - -# Commented out due to difference in the rmessage for GAP 4.10 vs GAP 4.11 -#gap> HomomorphismDigraphsFinder(gr1, gr2, fail, [], 1, 1, 1, [1, []], 0, -#> 0, 0); -#Error, the 8th argument must only contain positive integers, but found\ -# list (plain,empty) in position 2, -#gap> HomomorphismDigraphsFinder(gr1, gr2, fail, [], 1, 1, 1, [[], []], 0, -#> 0, 0); -#Error, the 8th argument must only contain positive integers, but found\ -# list (plain,empty) in position 1, +gap> HomomorphismDigraphsFinder(gr1, gr2, fail, [], 1, 1, 1, [1, []], 0, +> 0, 0); +Error, the 8th argument must only contain positive integers, but found\ + empty plain list in position 2, +gap> HomomorphismDigraphsFinder(gr1, gr2, fail, [], 1, 1, 1, [[], []], 0, +> 0, 0); +Error, the 8th argument must only contain positive integers, but found\ + empty plain list in position 1, gap> HomomorphismDigraphsFinder(gr1, gr2, fail, [], 1, 1, 1, [0, 1], 0, 0, > 0); Error, the 8th argument must only contain positive integers, but found\ From 1332815fbbe058181534eaa5cd9eea1afcc8a46d Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Wed, 1 Oct 2025 16:03:14 +0100 Subject: [PATCH 2/2] Take advantage of GAP 4.11 features --- gap/attr.gi | 6 +++--- gap/io.gi | 23 +++++++++++------------ makedoc.g | 12 +++--------- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/gap/attr.gi b/gap/attr.gi index a71c5b354..47b00d38f 100644 --- a/gap/attr.gi +++ b/gap/attr.gi @@ -1814,8 +1814,8 @@ function(D, maxLength) # Extends a given chordless path if possible CCExtension := function(D, path, C, key, blocked) local v, extendedPath, data; - blocked := BlockNeighbours(D, path[Length(path)], blocked); - for v in OutNeighboursOfVertex(D, path[Length(path)]) do + blocked := BlockNeighbours(D, Last(path), blocked); + for v in OutNeighboursOfVertex(D, Last(path)) do if DigraphVertexLabel(D, v) > key and blocked[v] = 1 and Length(path) < maxLength then extendedPath := Concatenation(path, [v]); @@ -1828,7 +1828,7 @@ function(D, maxLength) fi; fi; od; - blocked := UnblockNeighbours(D, path[Length(path)], blocked); + blocked := UnblockNeighbours(D, Last(path), blocked); return [C, blocked]; end; diff --git a/gap/io.gi b/gap/io.gi index ae57e8202..c58c11755 100644 --- a/gap/io.gi +++ b/gap/io.gi @@ -275,10 +275,10 @@ function(filename) fi; splitname := SplitString(filename, "."); - extension := splitname[Length(splitname)]; + extension := Remove(splitname); if extension in ["gz", "bz2", "xz"] then - extension := splitname[Length(splitname) - 1]; + extension := Remove(splitname); fi; if extension = "txt" then @@ -313,10 +313,10 @@ function(filename) fi; splitname := SplitString(filename, "."); - extension := splitname[Length(splitname)]; + extension := Remove(splitname); if extension in ["gz", "bz2", "xz"] then - extension := splitname[Length(splitname) - 1]; + extension := Remove(splitname); fi; if extension = "txt" then @@ -549,9 +549,8 @@ function(arg...) # the file encoder was not specified and cannot be deduced from the # filename, so we try to make a guess based on the digraphs themselves splitname := SplitString(name, "."); - if splitname[Length(splitname)] in ["xz", "gz", "bz2"] then - compext := splitname[Length(splitname)]; - splitname := splitname{[1 .. Length(splitname) - 1]}; + if Last(splitname) in ["xz", "gz", "bz2"] then + compext := Remove(splitname); fi; # Do we know all the graphs to be symmetric? @@ -647,7 +646,7 @@ function(arg...) " is a whole file encoder, and so only one digraph should be ", "specified. Only the last digraph will be encoded."); fi; - IO_Write(file, encoder(digraphs[Length(digraphs)])); + IO_Write(file, encoder(Last(digraphs))); else for i in [1 .. Length(digraphs)] do encoder(file, digraphs[i]); @@ -715,7 +714,7 @@ function(filt, s) maxedges := n * (n - 1) / 2; if list <> [0] and list <> [1] and not (Int((maxedges - 1) / 6) + start = Length(list) and - list[Length(list)] mod 2 ^ ((0 - maxedges) mod 6) = 0) then + Last(list) mod 2 ^ ((0 - maxedges) mod 6) = 0) then ErrorNoReturn("the 2nd argument is not a valid graph6 string,"); fi; @@ -732,8 +731,8 @@ function(filt, s) i := i / 2; else edge := FindCoord(pos + 6 - bpos, 0); - out[edge[1]][Length(out[edge[1]]) + 1] := edge[2]; - out[edge[2]][Length(out[edge[2]]) + 1] := edge[1]; + Add(out[edge[1]], edge[2]); + Add(out[edge[2]], edge[1]); nredges := nredges + 1; i := (i - 1) / 2; fi; @@ -2165,7 +2164,7 @@ function(args...) positions := PositionsProperty(partition, x -> x = i); joinedPositions := JoinStringsWithSeparator(positions, " "); partitionString := Concatenation(partitionString, joinedPositions); - if i <> dflabels[Length(dflabels)] then + if i <> Last(dflabels) then partitionString := Concatenation(partitionString, " | "); fi; od; diff --git a/makedoc.g b/makedoc.g index c1214b9dc..d8bcbc436 100644 --- a/makedoc.g +++ b/makedoc.g @@ -52,14 +52,9 @@ for Pkg in Concatenation(PkgInfo.Dependencies.NeededOtherPackages, XMLEntities.(entity_name) := RemovePrefixVersion(Pkg[2]); od; -# Can change the following line to use Last() once we drop GAP 4.10 support -ARCHIVE_BASENAME := SplitString(PkgInfo.ArchiveURL, "/"); -ARCHIVE_BASENAME := ARCHIVE_BASENAME[Length(ARCHIVE_BASENAME)]; -XMLEntities.ARCHIVE_BASENAME := ARCHIVE_BASENAME; - -ARCHIVENAME := Concatenation(ARCHIVE_BASENAME, PkgInfo.ArchiveFormats); -XMLEntities.ARCHIVENAME := ARCHIVENAME; - +XMLEntities.ARCHIVE_BASENAME := Last(SplitString(PkgInfo.ArchiveURL, "/")); +XMLEntities.ARCHIVENAME := Concatenation(XMLEntities.ARCHIVE_BASENAME, + PkgInfo.ArchiveFormats); XMLEntities.DIGRAPHS := PackageEntity("Digraphs"); for Pkg in Concatenation(PkgInfo.Dependencies.NeededOtherPackages, @@ -155,7 +150,6 @@ Unbind(MathOrCode); Unbind(XMLEntities); Unbind(PkgInfo); Unbind(Pkg); -Unbind(ARCHIVENAME); Unbind(DocDir); Unbind(Files); Unbind(Includes);