diff --git a/G/GAP_lib/build_tarballs.jl b/G/GAP_lib/build_tarballs.jl index 84982fc869e..a091616e9a6 100644 --- a/G/GAP_lib/build_tarballs.jl +++ b/G/GAP_lib/build_tarballs.jl @@ -21,23 +21,23 @@ using BinaryBuilder, Pkg # to all components. name = "GAP_lib" -upstream_version = v"4.14.0" -version = v"400.1400.005" +upstream_version = v"4.15.0" +version = v"400.1500.000" # Collection of sources required to complete build sources = [ ArchiveSource("https://github.com/gap-system/gap/releases/download/v$(upstream_version)/gap-$(upstream_version).tar.gz", - "845f5272c26feb1b8eb9ef294bf0545f264c1fe5a19b0601bbc65d79d9506487"), - DirectorySource("./bundled"), + "93c7df97df1265c0f9ea6a9b5578b12289d5ab3aed2936cfd592710cfa73609e"), + # DirectorySource("./bundled"), ] # Bash recipe for building across all platforms script = raw""" cd ${WORKSPACE}/srcdir/gap* -for f in ${WORKSPACE}/srcdir/patches/*.patch; do - atomic_patch -p1 ${f} -done +#for f in ${WORKSPACE}/srcdir/patches/*.patch; do +# atomic_patch -p1 ${f} +#done # compress group database gzip -n grp/*.grp @@ -78,6 +78,6 @@ dependencies = [ # Build the tarballs, and possibly a `build.jl` as well. build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; - julia_compat="1.10") + preferred_gcc_version=v"7", julia_compat="1.10") # Build trigger: 1 diff --git a/G/GAP_lib/bundled/patches/Add-packagedirs-and-ExtendPackageDirectories-5873.patch b/G/GAP_lib/bundled/patches/Add-packagedirs-and-ExtendPackageDirectories-5873.patch deleted file mode 100644 index 678bbc641d1..00000000000 --- a/G/GAP_lib/bundled/patches/Add-packagedirs-and-ExtendPackageDirectories-5873.patch +++ /dev/null @@ -1,358 +0,0 @@ -From d2dab76e883fd44c7165c6faa6fe7e633ee246ed Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= -Date: Mon, 6 Jan 2025 15:13:18 +0100 -Subject: [PATCH] Add --packagedirs and ExtendPackageDirectories() (#5873) - -... to make it easier to use custom packages - -The changes in dev/ci.sh have been removed from this patch -to make it apply to release tarballs. ---- - doc/ref/files.xml | 31 ++++++++++++++-- - doc/ref/gappkg.xml | 1 + - doc/ref/run.xml | 21 +++++++++++ - lib/package.gd | 26 ++++++++++++- - lib/package.gi | 73 ++++++++++++++++++++++++++++++++----- - lib/system.g | 4 ++ - tst/testinstall/package.tst | 27 ++++---------- - 7 files changed, 150 insertions(+), 33 deletions(-) - -diff --git a/doc/ref/files.xml b/doc/ref/files.xml -index 4da8aca5a..75cb5f68b 100644 ---- a/doc/ref/files.xml -+++ b/doc/ref/files.xml -@@ -81,9 +81,9 @@ directories. For example when ⪆ wants to read its library file - GAPInfo.RootPaths until it finds the path of an existing file. - The first file found this way is read. -

--Furthermore, ⪆ looks for available packages by examining the --subdirectories pkg/ in each of the directories in --GAPInfo.RootPaths. -+Any subdirectories named pkg/ in one of the directories in GAPInfo.RootPaths -+are added to GAPInfo.PackageDirectories (see ), -+which controls where ⪆ looks for available packages. -

- The root directories are specified via one or several of the - -l paths command line options, see . -@@ -95,11 +95,36 @@ This directory can be used to tell ⪆ about personal preferences, - to always load some additional code, to install additional packages, - or to overwrite some ⪆ files. See - for more information how to do this. -+After ⪆ has been started, one can add additional root directories -+via the function . -

- - - - -+ -+

-+GAP Package Directories -+GAPInfo.PackageDirectories -+ -+When ⪆ is started it determines a list of directories potentially -+containing packages. We refer to these as the ⪆ package directories. -+In a running ⪆ session this list can be found in GAPInfo.PackageDirectories. -+

-+Every subdirectory pkg in a ⪆ root directory is automatically -+added to this list. Further package directories can be specified via one or several -+--packagedirs paths command line options, see , -+or after ⪆ has been started via the function . -+The order of the directories in GAPInfo.PackageDirectories is as follows: -+first the package directories specified via the command line option --packagedirs, -+then the subdirectories pkg of the ⪆ root directories that were known at startup in the -+same order, and finally the directories added after ⪆ has been started. -+

-+⪆ looks for available packages by examining each of the directories in -+GAPInfo.PackageDirectories. -+

-+ -+ - -
- Directories -diff --git a/doc/ref/gappkg.xml b/doc/ref/gappkg.xml -index 03751f275..1fa68f75d 100644 ---- a/doc/ref/gappkg.xml -+++ b/doc/ref/gappkg.xml -@@ -96,6 +96,7 @@ that is they will be loaded automatically when &GAP; starts - - <#Include Label="SetPackagePath"> - <#Include Label="ExtendRootDirectories"> -+<#Include Label="ExtendPackageDirectories"> - <#Include Label="DisplayPackageLoadingLog"> - -
-diff --git a/doc/ref/run.xml b/doc/ref/run.xml -index 88101cfda..c87548230 100644 ---- a/doc/ref/run.xml -+++ b/doc/ref/run.xml -@@ -269,6 +269,27 @@ It is not possible to use &GAP; without the library files, so you must - not ignore this warning. You should leave &GAP; and start it again, - specifying the correct root path using the -l option. - -+--packagedirs -+--packagedirs path_list -+ -+can be used to add paths to &GAP;'s list of package directories -+(see ). -+The list always contains all subdirectories pkg in a &GAP; root directory. -+

-+path_list should be a list of directories separated by semicolons. -+No whitespace is permitted before or after a semicolon, and the first and -+last character of path_list may not be a semicolon. -+After &GAP; has completed its startup procedure and -+displays the prompt, the list of package directories can be seen in the -+variable GAPInfo.PackageDirectories, -+see . -+

-+Usually this option is used inside a startup script to specify -+where additional &GAP; packages are located on the system. -+The --packagedirs option can also be used by individual users to tell &GAP; -+about additional &GAP; packages, without the need to set up a complete root -+directory structure. -+ - -M - -M - -diff --git a/lib/package.gd b/lib/package.gd -index 8136cc518..cc1de684f 100644 ---- a/lib/package.gd -+++ b/lib/package.gd -@@ -859,7 +859,8 @@ DeclareGlobalFunction( "LoadPackage" ); - ##

- ## See for a way to force the loading of a - ## prescribed package version. --## See also for a method of adding -+## See also and -+## for methods of adding - ## directories containing packages after &GAP; has been started. - ## - ## <#/GAPDoc> -@@ -947,6 +948,29 @@ DeclareGlobalFunction( "SetPackagePath" ); - ## - DeclareGlobalFunction( "ExtendRootDirectories" ); - -+ -+############################################################################# -+## -+#F ExtendPackageDirectories( ) -+## -+## <#GAPDoc Label="ExtendPackageDirectories"> -+## -+## -+## -+## -+## Let paths be a list of strings that denote paths to intended -+## &GAP; package directories (see ). -+## The function adds these paths to -+## the global list GAPInfo.PackageDirectories and calls the initialization of -+## available &GAP; packages, -+## such that later calls to will find the &GAP; -+## packages that are contained in the directories given by paths. -+## -+## -+## <#/GAPDoc> -+## -+DeclareGlobalFunction( "ExtendPackageDirectories" ); -+ - ############################################################################# - ## - #F InstalledPackageVersion( ) -diff --git a/lib/package.gi b/lib/package.gi -index e7780524b..0a0068a7d 100644 ---- a/lib/package.gi -+++ b/lib/package.gi -@@ -286,7 +286,7 @@ end ); - ## In earlier versions, this function had an argument; now we ignore it. - ## - InstallGlobalFunction( InitializePackagesInfoRecords, function( arg ) -- local pkgdirs, pkgdir, ignore, name, files, record, r; -+ local pkgdirs, pkgdir, pkgdirstrs, ignore, name, file, files, record, r; - - if IsBound( GAPInfo.PackagesInfoInitialized ) and - GAPInfo.PackagesInfoInitialized = true then -@@ -300,8 +300,28 @@ InstallGlobalFunction( InitializePackagesInfoRecords, function( arg ) - - LogPackageLoadingMessage( PACKAGE_DEBUG, - "entering InitializePackagesInfoRecords", "GAP" ); -+ -+ # the first time this is called, add the cmd line args to the list -+ if IsEmpty(GAPInfo.PackageDirectories) then -+ for pkgdirstrs in GAPInfo.CommandLineOptions.packagedirs do -+ pkgdirs:= List( SplitString( pkgdirstrs, ";" ), Directory ); -+ for pkgdir in pkgdirs do -+ if not pkgdir in GAPInfo.PackageDirectories then -+ Add( GAPInfo.PackageDirectories, pkgdir ); -+ fi; -+ od; -+ od; -+ fi; -+ # add any new pkg directories to the list - pkgdirs:= DirectoriesLibrary( "pkg" ); -- if pkgdirs = fail then -+ if pkgdirs <> fail then -+ pkgdirs:= Filtered( pkgdirs, dir -> not dir in GAPInfo.PackageDirectories ); -+ if not IsEmpty(pkgdirs) then -+ Append( GAPInfo.PackageDirectories, pkgdirs ); -+ fi; -+ fi; -+ -+ if IsEmpty(GAPInfo.PackageDirectories) then - LogPackageLoadingMessage( PACKAGE_DEBUG, - "exit InitializePackagesInfoRecords (no pkg directories found)", - "GAP" ); -@@ -327,7 +347,7 @@ InstallGlobalFunction( InitializePackagesInfoRecords, function( arg ) - # Loop over the package directories, - # remove the packages listed in `NOAUTO' files from GAP's suggested - # packages, and unite the information for the directories. -- for pkgdir in pkgdirs do -+ for pkgdir in GAPInfo.PackageDirectories do - - if IsBound( GAPInfo.ExcludeFromAutoload ) then - UniteSet( GAPInfo.ExcludeFromAutoload, -@@ -335,15 +355,21 @@ InstallGlobalFunction( InitializePackagesInfoRecords, function( arg ) - LowercaseString ) ); - fi; - -- # Loop over subdirectories of this package directory. -- for name in Set( DirectoryContents( Filename( pkgdir, "" ) ) ) do -+ # pkgdir may be a package instead of a package directory -+ file:= Filename( [ pkgdir ], "PackageInfo.g" ); -+ if file <> fail then -+ AddPackageInfos( [ [ file, "" ] ], pkgdir, ignore ); -+ else -+ # Loop over subdirectories of this package directory. -+ for name in Set( DirectoryContents( pkgdir ) ) do - -- ## Get all package dirs -- files := FindPackageInfosInSubdirectories( pkgdir, name ); -+ ## Get all package dirs -+ files := FindPackageInfosInSubdirectories( pkgdir, name ); - -- AddPackageInfos( files, pkgdir, ignore ); -+ AddPackageInfos( files, pkgdir, ignore ); - -- od; -+ od; -+ fi; - od; - - # Sort the available info records by their version numbers. -@@ -1958,6 +1984,35 @@ InstallGlobalFunction( ExtendRootDirectories, function( rootpaths ) - end ); - - -+############################################################################# -+## -+#F ExtendPackageDirectories( ) -+## -+InstallGlobalFunction( ExtendPackageDirectories, function( paths_or_dirs ) -+ local p, changed; -+ changed:= false; -+ for p in paths_or_dirs do -+ if IsString( p ) then -+ p:= Directory( p ); -+ elif not IsDirectory( p ) then -+ Error("input must be a list of path strings or directory objects"); -+ fi; -+ if not p in GAPInfo.PackageDirectories then -+ Add( GAPInfo.PackageDirectories, p ); -+ changed:= true; -+ fi; -+ od; -+ if changed then -+ # Reread the package information. -+ if IsBound( GAPInfo.PackagesInfoInitialized ) and -+ GAPInfo.PackagesInfoInitialized = true then -+ GAPInfo.PackagesInfoInitialized:= false; -+ InitializePackagesInfoRecords(); -+ fi; -+ fi; -+ end ); -+ -+ - ############################################################################# - ## - #F InstalledPackageVersion( ) -diff --git a/lib/system.g b/lib/system.g -index d79aca200..d3c5e5b11 100644 ---- a/lib/system.g -+++ b/lib/system.g -@@ -95,6 +95,9 @@ BIND_GLOBAL( "GAPInfo", rec( - "directories to the end/start of existing list", - "of root paths" ] ), - rec( short:= "r", default := false, help := ["disable/enable user GAP root dir", "GAPInfo.UserGapRoot"] ), -+ rec( long := "packagedirs", default := [], arg := "", -+ help := [ "add additional GAP directory paths", -+ "Directories are separated using ';'." ] ), - , - rec( section:= ["Loading:"] ), - rec( short:= "A", default := false, help := ["disable/enable autoloading of suggested", "GAP packages"] ), -@@ -302,6 +305,7 @@ CallAndInstallPostRestore( function() - - # paths - GAPInfo.RootPaths:= GAPInfo.KernelInfo.GAP_ROOT_PATHS; -+ GAPInfo.PackageDirectories := []; - if IsBound(GAPInfo.SystemEnvironment.HOME) then - GAPInfo.UserHome := GAPInfo.SystemEnvironment.HOME; - else -diff --git a/tst/testinstall/package.tst b/tst/testinstall/package.tst -index cd364a81b..10e515fc9 100644 ---- a/tst/testinstall/package.tst -+++ b/tst/testinstall/package.tst -@@ -1,4 +1,4 @@ --#@local entry,equ,pair,sml,oldTermEncoding,pkginfo,info,tmp_dir,mockpkgpath,old_warning_level,p,n,filename,IsDateFormatValid,loadinfo,eval_loadinfo -+#@local entry,equ,pair,sml,oldTermEncoding,pkginfo,info,mockpkgpath,old_warning_level,p,n,filename,IsDateFormatValid,loadinfo,eval_loadinfo - gap> START_TEST("package.tst"); - - # CompareVersionNumbers( , [, \"equal\"] ) -@@ -380,17 +380,9 @@ false - gap> IsPackageLoaded("mockpkg", ">=2.0"); - false - --# load mockpkg via a symlink in a directory called `pkg` --# so we can test ExtendRootDirectories below --# first create a temporary directory for all of this --gap> tmp_dir := DirectoryTemporary( );; -- --# create a subdirectory `/pkg` --gap> Exec( Concatenation( "mkdir -p ", Filename( tmp_dir, "/pkg" ) ) ); -- --# make `/pkg/mockpkg` a symlink to `tst/mockpkg` --gap> Exec( Concatenation( "ln -sfn ", Filename( DirectoriesLibrary("tst/mockpkg"), "" )," ", Filename( tmp_dir, "pkg/mockpkg" ) ) ); --gap> mockpkgpath := Directory( Filename( tmp_dir, "pkg/mockpkg" ) );; -+# load mockpkg first via SetPackagePath and later via -+# ExtendPackageDirectories -+gap> mockpkgpath := DirectoriesLibrary("tst/mockpkg")[1];; - gap> ValidatePackageInfo(Filename(mockpkgpath, "PackageInfo.g")); - true - -@@ -635,12 +627,8 @@ false - gap> IsPackageLoaded("mockpkg", ">=2.0"); - false - --# now add the temporary directory created above as a new root directory --gap> filename:= ShallowCopy( Filename( tmp_dir, "" ) );; --gap> while EndsWith( filename, "/" ) do Remove( filename ); od; --gap> ExtendRootDirectories( [ filename ] ); --gap> ForAll( GAPInfo.RootPaths, x -> EndsWith( x, "/" ) ); --true -+# now add the directory with mockpkgpath as a new package directory -+gap> ExtendPackageDirectories( [ mockpkgpath ] ); - - # make sure that the newly discovered installation path matches - # the path from which mockpkg was loaded above -@@ -649,8 +637,7 @@ gap> Last( GAPInfo.PackagesInfo.mockpkg ).InstallationPath = - true - - # --gap> SetPackagePath( "mockpkg", Filename( tmp_dir, "pkg/mockpkg" ) ); --gap> SetPackagePath( "mockpkg", Filename( tmp_dir, "pkg/mockpkg/" ) ); -+gap> SetPackagePath( "mockpkg", Filename( mockpkgpath, "" ) ); - gap> SetPackagePath( "mockpkg", "/some/other/directory" ); - Error, another version of package mockpkg is already loaded - --- -2.47.1 - diff --git a/G/GAP_lib/bundled/patches/Allow-loading-of-extraperfect-files-from-all-root-dirs-5938.patch b/G/GAP_lib/bundled/patches/Allow-loading-of-extraperfect-files-from-all-root-dirs-5938.patch deleted file mode 100644 index f6a346ade28..00000000000 --- a/G/GAP_lib/bundled/patches/Allow-loading-of-extraperfect-files-from-all-root-dirs-5938.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 078f6c9e9f7b1fedb71bcf9462498123c9d6c81e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= -Date: Sun, 23 Feb 2025 16:56:42 +0100 -Subject: [PATCH] Allow loading of extraperfect files from all root dirs - (#5938) - ---- - grp/perf.grp | 14 ++++++-------- - 1 file changed, 6 insertions(+), 8 deletions(-) - -diff --git a/grp/perf.grp b/grp/perf.grp -index 02b8c4f5b..1baca8d5f 100644 ---- a/grp/perf.grp -+++ b/grp/perf.grp -@@ -16,7 +16,7 @@ - #F PerfGrpLoad() force loading of secondary files, return index - ## - InstallGlobalFunction( PerfGrpLoad, function(sz) --local p,pos,name,libname; -+local p,pos,name,file; - if PERFRec=fail then - ReadGrp("perf0.grp"); - fi; -@@ -36,22 +36,20 @@ local p,pos,name,libname; - p:=12+p; - fi; - name:=Concatenation("perf",String(p),".grp"); -- libname := SHALLOW_COPY_OBJ( "grp" ); -- APPEND_LIST_INTR( libname, "/" ); -- APPEND_LIST_INTR( libname, name ); -- while not READ_GAP_ROOT( libname ) do -+ file:=Filename( DirectoriesLibrary( "grp" ), name ); -+ while file = fail do - Error("\n\n", - "For reasons of size, the perfect groups library for orders >10^6 is\n", - "not distributed fully by default. To access the group requested, get\n", - "the file ",name," from\n", - "https://github.com/hulpke/extraperfect\n", -- "and put it in the `grp` subdirectory of your GAP installation. Then", -+ "and put it in the `grp` subdirectory of a GAP root path. Then", - " type \n\nreturn;\n\n", - "to continue in this GAP session ", - "(which will read in the file).\n\n\n"); -+ file:=Filename( DirectoriesLibrary( "grp" ), name ); - od; -- -- ReadGrp(name); -+ Read(file); - return pos; - end ); - --- -2.48.1 - diff --git a/G/GAP_lib/bundled/patches/FactorCosetAction-G-G-for-perm-groups-5903.patch b/G/GAP_lib/bundled/patches/FactorCosetAction-G-G-for-perm-groups-5903.patch deleted file mode 100644 index aa88f20ff5b..00000000000 --- a/G/GAP_lib/bundled/patches/FactorCosetAction-G-G-for-perm-groups-5903.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 90743e6c800f3ea9867de863c8a55c0dceb8adb0 Mon Sep 17 00:00:00 2001 -From: Thomas Breuer -Date: Sat, 11 Jan 2025 11:35:18 +0100 -Subject: [PATCH] Fix `FactorCosetAction(G, G)` fo perm. groups (#5903) - -Catch the case of an action with trivial image in -`DoFactorCosetActionPerm`, -and delegate to `DoFactorCosetAction` in this case. ---- - lib/csetperm.gi | 4 +++- - lib/factgrp.gd | 2 ++ - lib/factgrp.gi | 2 +- - tst/teststandard/permgrp.tst | 2 ++ - 4 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/lib/csetperm.gi b/lib/csetperm.gi -index 7d7ca1d7b..fc4492c67 100644 ---- a/lib/csetperm.gi -+++ b/lib/csetperm.gi -@@ -883,10 +883,12 @@ local G,u,op,h,N,rt,ac,actions,hom,i,q; - u:=G; - Error("only trivial operation ? I Set u:=G;"); - fi; -+ if IsSubset(u, G) then -+ return DoFactorCosetAction(G, u, G); -+ fi; - if N=false then - N:=Core(G,u); - fi; -- - ac:=ActionRefinedSeries(G,u); - actions:=ac[2]; - ac:=ac[1]; -diff --git a/lib/factgrp.gd b/lib/factgrp.gd -index b8feb8d31..5b0fc432f 100644 ---- a/lib/factgrp.gd -+++ b/lib/factgrp.gd -@@ -167,6 +167,8 @@ DeclareAttribute("NaturalHomomorphismsPool",IsGroup, - ## - DeclareOperation( "FactorCosetAction", [IsGroup,IsGroup] ); - -+DeclareGlobalFunction( "DoFactorCosetAction" ); -+ - ############################################################################# - ## - #F ImproveActionDegreeByBlocks( , , [,forceblocks] ) -diff --git a/lib/factgrp.gi b/lib/factgrp.gi -index 2e8fa119e..7fecc44be 100644 ---- a/lib/factgrp.gi -+++ b/lib/factgrp.gi -@@ -475,7 +475,7 @@ end); - #F FactorCosetAction( , , [] ) operation on the right cosets Ug - ## with possibility to indicate kernel - ## --BindGlobal("DoFactorCosetAction",function(arg) -+InstallGlobalFunction("DoFactorCosetAction",function(arg) - local G,u,op,h,N,rt; - G:=arg[1]; - u:=arg[2]; -diff --git a/tst/teststandard/permgrp.tst b/tst/teststandard/permgrp.tst -index ec68566b3..efd055c08 100644 ---- a/tst/teststandard/permgrp.tst -+++ b/tst/teststandard/permgrp.tst -@@ -155,6 +155,8 @@ gap> u:=Normalizer(g,SylowSubgroup(g,3));; - gap> act:=FactorCosetAction(g,u);; - gap> NrMovedPoints(Range(act)); - 70840 -+gap> NrMovedPoints(Range(FactorCosetAction(g,g))); -+0 - - # - gap> STOP_TEST("permgrp.tst"); --- -2.47.1 - diff --git a/G/GAP_lib/bundled/patches/IsomorphismPermGroupOrFailFpGroup-5900.patch b/G/GAP_lib/bundled/patches/IsomorphismPermGroupOrFailFpGroup-5900.patch deleted file mode 100644 index 1649597f845..00000000000 --- a/G/GAP_lib/bundled/patches/IsomorphismPermGroupOrFailFpGroup-5900.patch +++ /dev/null @@ -1,102 +0,0 @@ -From f885d71c649260f411b24d87368ede083c3125c3 Mon Sep 17 00:00:00 2001 -From: Max Horn -Date: Thu, 9 Jan 2025 08:32:37 +0100 -Subject: [PATCH] Fix IsomorphismPermGroupOrFailFpGroup(G,max) (#5900) - -... to honor its second argument, which limits the coset table size -that gets used before it gives up. ---- - lib/grpfp.gi | 23 +++++++++++++++---- - tst/testbugfix/2024-07-29-fpgroup-enum.tst | 11 +++++++++ - ...1-09-IsomorphismPermGroupOrFailFpGroup.tst | 6 +++++ - 3 files changed, 35 insertions(+), 5 deletions(-) - create mode 100644 tst/testbugfix/2024-07-29-fpgroup-enum.tst - create mode 100644 tst/testbugfix/2025-01-09-IsomorphismPermGroupOrFailFpGroup.tst - -diff --git a/lib/grpfp.gi b/lib/grpfp.gi -index 8b4013d39..5b86e748e 100644 ---- a/lib/grpfp.gi -+++ b/lib/grpfp.gi -@@ -3899,15 +3899,20 @@ end); - #M Size( ) . . . . . . . . . . . . . size of a finitely presented group - ## - BindGlobal("SIZE_FP_FROM_CYCLIC_INDEX", --function( G ) -+function( G, max... ) # max = maximal coset table length required - local fgens, # generators of the free group - rels, # relators of - H, # subgroup of - gen, # generator of cyclic subgroup -- max, # maximal coset table length required - e, - T; # coset table of by - -+ if Length(max) = 0 then -+ max := infinity; -+ else -+ max := max[1]; -+ fi; -+ - fgens := FreeGeneratorsOfFpGroup( G ); - rels := RelatorsOfFpGroup( G ); - -@@ -3926,8 +3931,13 @@ local fgens, # generators of the free group - fi; - # the group could be quite big -- try to find a cyclic subgroup of - # finite index. -- gen:=FinIndexCyclicSubgroupGenerator(G,infinity); -- max:=gen[2]; -+ gen:=FinIndexCyclicSubgroupGenerator(G,max); -+ if gen = fail then -+ return fail; -+ fi; -+ if max = infinity then -+ max:=gen[2]; -+ fi; - gen:=gen[1]; - - H := Subgroup(G,[gen]); -@@ -4049,7 +4059,10 @@ local mappow, G, max, p, gens, rels, comb, i, l, m, H, HH, t, sz, - - H:=[]; # indicate pseudo-size 0 - if not HasSize(G) then -- sz:=SIZE_FP_FROM_CYCLIC_INDEX(G); -+ sz:=SIZE_FP_FROM_CYCLIC_INDEX(G, max); -+ if sz = fail then -+ return fail; -+ fi; - SetSize(G,sz); - fi; - if Size(G)=infinity then -diff --git a/tst/testbugfix/2024-07-29-fpgroup-enum.tst b/tst/testbugfix/2024-07-29-fpgroup-enum.tst -new file mode 100644 -index 000000000..f9627c3df ---- /dev/null -+++ b/tst/testbugfix/2024-07-29-fpgroup-enum.tst -@@ -0,0 +1,11 @@ -+# Sometimes GAP was able to compute the size of an fp group but then -+# for any further action failed to compute a permutation representation. -+# See https://github.com/gap-system/gap/issues/5764 for the report, -+# and https://github.com/gap-system/gap/pull/5770 for the fix. -+gap> f := FreeGroup("a","b","c");; -+gap> g := f / [ f.1*f.1*f.1,f.1*f.2*f.3*f.1*f.3^-1*f.2*f.3*f.3,f.1*f.3*f.2^-1 ]; -+ -+gap> Size(g); -+84 -+gap> IdGroup(g); -+[ 84, 1 ] -diff --git a/tst/testbugfix/2025-01-09-IsomorphismPermGroupOrFailFpGroup.tst b/tst/testbugfix/2025-01-09-IsomorphismPermGroupOrFailFpGroup.tst -new file mode 100644 -index 000000000..808d5dfb6 ---- /dev/null -+++ b/tst/testbugfix/2025-01-09-IsomorphismPermGroupOrFailFpGroup.tst -@@ -0,0 +1,6 @@ -+# IsomorphismPermGroupOrFailFpGroup ignored its second argument -+# which is supposed to limit the number of cosets that get defined -+# before it gives up -+gap> F:=FreeGroup(2);;G:=F/[F.1^2, F.2^2];; -+gap> IsomorphismPermGroupOrFailFpGroup(G, 100); -+fail --- -2.47.1 -