From 4c5927c98c4f673b23240c7cd18a1c096512669b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Wed, 30 Jun 2021 14:33:03 +0800 Subject: [PATCH 1/6] Update scripts to use `cabal v1-...` so they work on newer cabal Fixes build failures like https://github.com/GrammaticalFramework/gf-core/runs/2949099280?check_suite_focus=true --- Makefile | 14 +++++++------- debian/rules | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 93a8dc20b5..aee576d60a 100644 --- a/Makefile +++ b/Makefile @@ -6,24 +6,24 @@ VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal) all: build dist/setup-config: gf.cabal Setup.hs WebSetup.hs - cabal configure + cabal v1-configure build: dist/setup-config - cabal build + cabal v1-build install: - cabal copy - cabal register + cabal v1-copy + cabal v1-register doc: - cabal haddock + cabal v1-haddock clean: - cabal clean + cabal v1-clean bash bin/clean_html gf: - cabal build rgl-none + cabal v1-build rgl-none strip dist/build/gf/gf html:: diff --git a/debian/rules b/debian/rules index 8bd3c1f85a..7ec04b4e22 100755 --- a/debian/rules +++ b/debian/rules @@ -16,9 +16,9 @@ override_dh_shlibdeps: override_dh_auto_configure: cd src/runtime/c && bash setup.sh configure --prefix=/usr cd src/runtime/c && bash setup.sh build - cabal update - cabal install --only-dependencies - cabal configure --prefix=/usr -fserver -fc-runtime --extra-lib-dirs=$(CURDIR)/src/runtime/c/.libs --extra-include-dirs=$(CURDIR)/src/runtime/c + cabal v1-update + cabal v1-install --only-dependencies + cabal v1-configure --prefix=/usr -fserver -fc-runtime --extra-lib-dirs=$(CURDIR)/src/runtime/c/.libs --extra-include-dirs=$(CURDIR)/src/runtime/c SET_LDL=LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs @@ -26,10 +26,10 @@ override_dh_auto_build: cd src/runtime/python && EXTRA_INCLUDE_DIRS=$(CURDIR)/src/runtime/c EXTRA_LIB_DIRS=$(CURDIR)/src/runtime/c/.libs python setup.py build cd src/runtime/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr echo $(SET_LDL) - -$(SET_LDL) cabal build + -$(SET_LDL) cabal v1-build override_dh_auto_install: - $(SET_LDL) cabal copy --destdir=$(CURDIR)/debian/gf + $(SET_LDL) cabal v1-copy --destdir=$(CURDIR)/debian/gf cd src/runtime/c && bash setup.sh copy prefix=$(CURDIR)/debian/gf/usr cd src/runtime/python && python setup.py install --prefix=$(CURDIR)/debian/gf/usr cd src/runtime/java && make INSTALL_PATH=$(CURDIR)/debian/gf/usr install From e3498d5ead8c98d6719e94e575ed9242838491cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Wed, 30 Jun 2021 15:11:05 +0800 Subject: [PATCH 2/6] Update to newest haskell github action Also fix so the stack builds use the correct ghc versions --- .github/workflows/build-all-versions.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-all-versions.yml b/.github/workflows/build-all-versions.yml index f4ba6a2f1f..9ab8a06226 100644 --- a/.github/workflows/build-all-versions.yml +++ b/.github/workflows/build-all-versions.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1.4 + - uses: haskell/actions/setup@v1 id: setup-haskell-cabal name: Setup Haskell with: @@ -73,11 +73,12 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1.4 + - uses: haskell/actions/setup@v1 name: Setup Haskell Stack with: - # ghc-version: ${{ matrix.ghc }} - stack-version: ${{ matrix.stack }} + ghc-version: ${{ matrix.ghc }} + stack-version: 'latest' + enable-stack: true - uses: actions/cache@v1 name: Cache ~/.stack From 0474a37af6dceb7d1e2d35ff2ed875fa23c3b08c Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 2 Jul 2021 11:05:30 +0200 Subject: [PATCH 3/6] Make Makefile compatible with stack and old/new cabal (with v1- prefix when necessary) --- Makefile | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index aee576d60a..cdb35e49a8 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,48 @@ -.PHONY: all build install doc clean gf html deb pkg bintar sdist +.PHONY: all build install doc clean html deb pkg bintar sdist # This gets the numeric part of the version from the cabal file VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal) +# Check if stack is installed +STACK=$(shell if hash stack 2>/dev/null; then echo "1"; else echo "0"; fi) + +# Check if cabal >= 2.4 is installed (with v1- and v2- commands) +CABAL_NEW=$(shell if cabal v1-repl --help >/dev/null 2>&1 ; then echo "1"; else echo "0"; fi) + +ifeq ($(STACK),1) + CMD=stack +else + CMD=cabal + ifeq ($(CABAL_NEW),1) + CMD_PFX=v1- + endif +endif + all: build dist/setup-config: gf.cabal Setup.hs WebSetup.hs - cabal v1-configure +ifneq ($(STACK),1) + cabal ${CMD_PFX}configure +endif build: dist/setup-config - cabal v1-build + ${CMD} ${CMD_PFX}build install: - cabal v1-copy - cabal v1-register +ifeq ($(STACK),1) + stack install +else + cabal ${CMD_PFX}copy + cabal ${CMD_PFX}register +endif doc: - cabal v1-haddock + ${CMD} ${CMD_PFX}haddock clean: - cabal v1-clean + ${CMD} ${CMD_PFX}clean bash bin/clean_html -gf: - cabal v1-build rgl-none - strip dist/build/gf/gf - html:: bash bin/update_html @@ -35,7 +52,7 @@ html:: deb: dpkg-buildpackage -b -uc -# Make an OS X Installer package +# Make a macOS installer package pkg: FMT=pkg bash bin/build-binary-dist.sh From 3c4f42db15b92ea5de24147b3cbfba195837170f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 6 Jul 2021 15:51:16 +0800 Subject: [PATCH 4/6] Build ubuntu packages on ubuntu-latest Fixes #74 --- .github/workflows/build-binary-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 53f0397144..1893f5569d 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -10,7 +10,7 @@ jobs: ubuntu: name: Build Ubuntu package - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest # strategy: # matrix: # ghc: ["8.6.5"] From 375b3cf285078224d013437eed0bc4b0f75ba35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Thu, 22 Jul 2021 09:06:31 +0800 Subject: [PATCH 5/6] Update release script to build for two ubuntu versions --- .github/workflows/build-binary-packages.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 1893f5569d..0931dce0e4 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -10,11 +10,13 @@ jobs: ubuntu: name: Build Ubuntu package - runs-on: ubuntu-latest - # strategy: - # matrix: - # ghc: ["8.6.5"] - # cabal: ["2.4"] + strategy: + matrix: + os: + - ubuntu-18.04 + - ubuntu-20.04 + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -53,7 +55,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: gf-${{ github.sha }}-ubuntu + name: gf-${{ github.sha }}-${{ matrix.os }} path: dist/gf_*.deb if-no-files-found: error From 8814fde817af010e6c17ff8829eceb008dfa5f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Thu, 22 Jul 2021 09:50:35 +0800 Subject: [PATCH 6/6] Only run the script once per release --- .github/workflows/build-binary-packages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 0931dce0e4..ccc7dd7d77 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -2,7 +2,8 @@ name: Build Binary Packages on: workflow_dispatch: - release: + release: + types: ["created"] jobs: