From aaebd497579de5d450cd742ea7918a8994d25be2 Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Mon, 26 Aug 2024 14:04:04 +0100 Subject: [PATCH 1/2] Update kernel module checking --- .github/workflows/ci.yml | 33 +++++++++++++++------------------ PackageInfo.g | 7 +++++-- init.g | 6 ++++++ read.g | 8 -------- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f715eb..73a38f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: 'ferret CI' +name: "ferret CI" on: pull_request: @@ -15,21 +15,18 @@ jobs: strategy: matrix: gap: - - 'master' + - "master" flags: - - '' - - '--enable-checking' - - '--enable-timing' - - '--enable-checking --enable-timing' + - "" + - "--enable-checking" + - "--enable-timing" + - "--enable-checking --enable-timing" include: - - gap: 'stable-4.13' - flags: '' - - gap: 'stable-4.12' - flags: '' - - gap: 'stable-4.11' - flags: '' - + - gap: "stable-4.13" + flags: "" + - gap: "stable-4.12" + flags: "" env: CONF_FLAG: ${{ matrix.flags }} BRANCH: ${{ matrix.gap }} @@ -37,13 +34,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: 'Display configuration' + - name: "Display configuration" shell: bash run: | echo $BRANCH ":" $CONF_FLAG echo $CXX ":" $CC - - name: 'Install needed apt_packages' + - name: "Install needed apt_packages" shell: bash run: | packages=( @@ -53,7 +50,7 @@ jobs: sudo apt-get update sudo apt-get install "${packages[@]}" - - name: 'Build GAP and its packages' + - name: "Build GAP and its packages" shell: bash run: | pwd @@ -62,7 +59,7 @@ jobs: ( cd gap && ./configure && make && make bootstrap-pkg-full V=1) ( cd gap/pkg && ../bin/BuildPackages.sh io* ) - - name: 'Build ferret' + - name: "Build ferret" shell: bash run: | pwd @@ -70,7 +67,7 @@ jobs: ln -s $(pwd) gap/pkg/ferret ( cd gap/pkg/ferret && ./autogen.sh && ./configure $CONF_FLAG && make V=1) - - name: 'Run ferret tests' + - name: "Run ferret tests" shell: bash run: | (cd gap/pkg/ferret && scripts/quick_test.sh ${MAKEFLAG}) diff --git a/PackageInfo.g b/PackageInfo.g index 5c57e50..c908b0f 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -66,14 +66,17 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">= 4.11", + GAP := ">= 4.12", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ] ], SuggestedOtherPackages := [ ], ExternalConditions := [ ], ), AvailabilityTest := function() - if Filename(DirectoriesPackagePrograms("ferret"), "ferret.so") = fail then + if not IsKernelExtensionAvailable("ferret") then + LogPackageLoadingMessage(PACKAGE_WARNING, + ["the kernel module is not compiled, ", + "the package cannot be loaded."]); return fail; fi; return true; diff --git a/init.g b/init.g index 932defa..9549629 100644 --- a/init.g +++ b/init.g @@ -5,6 +5,12 @@ ## ############################################################################# + +# load kernel function if it is installed +if not LoadKernelExtension("ferret") then + Error("failed to load the ferret package kernel extension"); +fi; + ## #R Read the declaration files. ## diff --git a/read.g b/read.g index cd7a13a..04705c4 100644 --- a/read.g +++ b/read.g @@ -8,14 +8,6 @@ ## #R Read the install files. ## - -# Load C code -_PATH_SO:=Filename(DirectoriesPackagePrograms("ferret"), "ferret.so"); -if _PATH_SO <> fail then - LoadDynamicModule(_PATH_SO); -fi; -Unbind(_PATH_SO); - ReadPackage( "ferret", "lib/helper_functions.g" ); ReadPackage( "ferret", "lib/yapb.gi" ); ReadPackage( "ferret", "lib/overloadmethods.gi" ); From 38090d2671cbc74ec3c3efda18682fa60570b32e Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Mon, 26 Aug 2024 14:10:04 +0100 Subject: [PATCH 2/2] Unformat ci --- .github/workflows/ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73a38f0..0da0c4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: "ferret CI" +name: 'ferret CI' on: pull_request: @@ -15,18 +15,18 @@ jobs: strategy: matrix: gap: - - "master" + - 'master' flags: - - "" - - "--enable-checking" - - "--enable-timing" - - "--enable-checking --enable-timing" + - '' + - '--enable-checking' + - '--enable-timing' + - '--enable-checking --enable-timing' include: - - gap: "stable-4.13" - flags: "" - - gap: "stable-4.12" - flags: "" + - gap: 'stable-4.13' + flags: '' + - gap: 'stable-4.12' + flags: '' env: CONF_FLAG: ${{ matrix.flags }} BRANCH: ${{ matrix.gap }} @@ -34,13 +34,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: "Display configuration" + - name: 'Display configuration' shell: bash run: | echo $BRANCH ":" $CONF_FLAG echo $CXX ":" $CC - - name: "Install needed apt_packages" + - name: 'Install needed apt_packages' shell: bash run: | packages=( @@ -50,7 +50,7 @@ jobs: sudo apt-get update sudo apt-get install "${packages[@]}" - - name: "Build GAP and its packages" + - name: 'Build GAP and its packages' shell: bash run: | pwd @@ -59,7 +59,7 @@ jobs: ( cd gap && ./configure && make && make bootstrap-pkg-full V=1) ( cd gap/pkg && ../bin/BuildPackages.sh io* ) - - name: "Build ferret" + - name: 'Build ferret' shell: bash run: | pwd @@ -67,7 +67,7 @@ jobs: ln -s $(pwd) gap/pkg/ferret ( cd gap/pkg/ferret && ./autogen.sh && ./configure $CONF_FLAG && make V=1) - - name: "Run ferret tests" + - name: 'Run ferret tests' shell: bash run: | (cd gap/pkg/ferret && scripts/quick_test.sh ${MAKEFLAG})