From 86246c6fb8679259e8ae3d62041fafd65c6d05d2 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 11:05:41 +0200 Subject: [PATCH 01/17] Add macOS to CI --- .github/workflows/build-majestic.yml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 4acfc244b..85c4b3710 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -64,3 +64,64 @@ jobs: run: | npm ci npm run test + + macos: + name: Build on macOS + runs-on: macOS-11 + + steps: + - uses: actions/checkout@v2 + + # All these are already available in GitHub runner + # - name: Install build tools + # run: | + # sudo apt-get update + # sudo apt-get install -y \ + # autoconf \ + # automake \ + # libtool \ + # make \ + # g++ + + - name: Build C runtime + working-directory: ./src/runtime/c + run: | + autoreconf -i + ./configure + make + sudo make install + + - name: Setup Haskell + uses: haskell/actions/setup@v1 + # with: + # ghc-version: '8.6' + # cabal-version: '2.4.1.0' + + - name: Run Haskell testsuite + working-directory: ./src/runtime/haskell + env: + LD_LIBRARY_PATH: /usr/local/lib + run: | + cabal test --extra-lib-dirs=/usr/local/lib + + # - name: Install Python bindings + # working-directory: ./src/runtime/python + # run: | + # python setup.py build + # sudo python setup.py install + # + # - name: Run Python testsuite + # working-directory: ./src/runtime/python + # env: + # LD_LIBRARY_PATH: /usr/local/lib + # run: | + # pip install pytest + # pytest + # + # - name: Run JavaScript testsuite + # working-directory: ./src/runtime/javascript + # env: + # LD_LIBRARY_PATH: /usr/local/lib + # run: | + # npm ci + # npm run test From 8e03b63237c81adbf840f06d42a86350cf96cace Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 11:07:38 +0200 Subject: [PATCH 02/17] Add glibtoolize to macOS CI --- .github/workflows/build-majestic.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 85c4b3710..e66af3a65 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -86,6 +86,7 @@ jobs: - name: Build C runtime working-directory: ./src/runtime/c run: | + glibtoolize autoreconf -i ./configure make From 9b591129ed6a7d572dc6ec37b7e5f8cca30614b7 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 11:13:31 +0200 Subject: [PATCH 03/17] Install build tools with brew --- .github/workflows/build-majestic.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index e66af3a65..8248203c6 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -72,16 +72,14 @@ jobs: steps: - uses: actions/checkout@v2 - # All these are already available in GitHub runner - # - name: Install build tools - # run: | - # sudo apt-get update - # sudo apt-get install -y \ - # autoconf \ - # automake \ - # libtool \ - # make \ - # g++ + - name: Install build tools + run: | + brew install + autoconf \ + automake \ + libtool \ + # make \ + # g++ - name: Build C runtime working-directory: ./src/runtime/c From 2d3c390e7d90625f58209e5a2a4de0496098241b Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 11:14:38 +0200 Subject: [PATCH 04/17] missing \ --- .github/workflows/build-majestic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 8248203c6..accfb7e43 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -74,7 +74,7 @@ jobs: - name: Install build tools run: | - brew install + brew install \ autoconf \ automake \ libtool \ From 30e3e6ba5267d75d3a1505e53e75a74c79d18f04 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 11:26:30 +0200 Subject: [PATCH 05/17] Cleanup, update README --- .github/workflows/build-majestic.yml | 35 ---------------------------- src/runtime/c/README.md | 10 +++++++- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index accfb7e43..0b887871e 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -11,17 +11,6 @@ jobs: steps: - uses: actions/checkout@v2 - # All these are already available in GitHub runner - # - name: Install build tools - # run: | - # sudo apt-get update - # sudo apt-get install -y \ - # autoconf \ - # automake \ - # libtool \ - # make \ - # g++ - - name: Build C runtime working-directory: ./src/runtime/c run: | @@ -78,8 +67,6 @@ jobs: autoconf \ automake \ libtool \ - # make \ - # g++ - name: Build C runtime working-directory: ./src/runtime/c @@ -102,25 +89,3 @@ jobs: LD_LIBRARY_PATH: /usr/local/lib run: | cabal test --extra-lib-dirs=/usr/local/lib - - # - name: Install Python bindings - # working-directory: ./src/runtime/python - # run: | - # python setup.py build - # sudo python setup.py install - # - # - name: Run Python testsuite - # working-directory: ./src/runtime/python - # env: - # LD_LIBRARY_PATH: /usr/local/lib - # run: | - # pip install pytest - # pytest - # - # - name: Run JavaScript testsuite - # working-directory: ./src/runtime/javascript - # env: - # LD_LIBRARY_PATH: /usr/local/lib - # run: | - # npm ci - # npm run test diff --git a/src/runtime/c/README.md b/src/runtime/c/README.md index 011ba33a3..fd140b010 100644 --- a/src/runtime/c/README.md +++ b/src/runtime/c/README.md @@ -17,16 +17,24 @@ g++ - Install XCode from App Store - Install XCode command line tools: `xcode-select --install` +- Required system packages (`brew install ...`): +``` +autoconf +automake +libtool +``` ## Installation -Installing the runtime (puts libraries in `/usr/local/lib`): +**Note for macOS**: you should first run `glibtoolize`, followed by the commands below. + ``` autoreconf -i ./configure make make install ``` +The shared libraries are installed in `/usr/local/lib`. ## Using From 57b9080234120c226f509e3d3a52886b0cba1ec9 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:01:37 +0200 Subject: [PATCH 06/17] First attempt at separating the different language bindings in CI workflow --- .github/workflows/build-majestic.yml | 126 ++++++++++++++++----------- 1 file changed, 73 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 0b887871e..986f71a3f 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -4,7 +4,7 @@ on: push jobs: - ubuntu: + ubuntu-build: name: Build on Ubuntu runs-on: ubuntu-20.04 @@ -19,63 +19,25 @@ jobs: make sudo make install - - name: Setup Haskell - uses: haskell/actions/setup@v1 - # with: - # ghc-version: '8.6' - # cabal-version: '2.4.1.0' + - uses: actions/upload-artifact@master + with: + name: libpgf-ubuntu + path: | + /usr/local/lib/libpgf* + /usr/local/include/pgf - - name: Run Haskell testsuite - working-directory: ./src/runtime/haskell - env: - LD_LIBRARY_PATH: /usr/local/lib - run: | - cabal test --extra-lib-dirs=/usr/local/lib - - - name: Install Python bindings - working-directory: ./src/runtime/python - run: | - python setup.py build - sudo python setup.py install - - - name: Run Python testsuite - working-directory: ./src/runtime/python - env: - LD_LIBRARY_PATH: /usr/local/lib - run: | - pip install pytest - pytest - - - name: Run JavaScript testsuite - working-directory: ./src/runtime/javascript - env: - LD_LIBRARY_PATH: /usr/local/lib - run: | - npm ci - npm run test - - macos: - name: Build on macOS - runs-on: macOS-11 + ubuntu-haskell: + name: Build & test Haskell bindings on Ubuntu + runs-on: ubuntu-20.04 + needs: ubuntu-build steps: - uses: actions/checkout@v2 - - name: Install build tools - run: | - brew install \ - autoconf \ - automake \ - libtool \ - - - name: Build C runtime - working-directory: ./src/runtime/c - run: | - glibtoolize - autoreconf -i - ./configure - make - sudo make install + - uses: actions/download-artifact@master + with: + name: libpgf-ubuntu + path: / - name: Setup Haskell uses: haskell/actions/setup@v1 @@ -89,3 +51,61 @@ jobs: LD_LIBRARY_PATH: /usr/local/lib run: | cabal test --extra-lib-dirs=/usr/local/lib + + # - name: Install Python bindings + # working-directory: ./src/runtime/python + # run: | + # python setup.py build + # sudo python setup.py install + # + # - name: Run Python testsuite + # working-directory: ./src/runtime/python + # env: + # LD_LIBRARY_PATH: /usr/local/lib + # run: | + # pip install pytest + # pytest + # + # - name: Run JavaScript testsuite + # working-directory: ./src/runtime/javascript + # env: + # LD_LIBRARY_PATH: /usr/local/lib + # run: | + # npm ci + # npm run test + + # macos: + # name: Build on macOS + # runs-on: macOS-11 + # + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install build tools + # run: | + # brew install \ + # autoconf \ + # automake \ + # libtool \ + # + # - name: Build C runtime + # working-directory: ./src/runtime/c + # run: | + # glibtoolize + # autoreconf -i + # ./configure + # make + # sudo make install + # + # - name: Setup Haskell + # uses: haskell/actions/setup@v1 + # # with: + # # ghc-version: '8.6' + # # cabal-version: '2.4.1.0' + # + # - name: Run Haskell testsuite + # working-directory: ./src/runtime/haskell + # env: + # LD_LIBRARY_PATH: /usr/local/lib + # run: | + # cabal test --extra-lib-dirs=/usr/local/lib From 695025d1a2f531528ee675917655aa204917d5fd Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:05:03 +0200 Subject: [PATCH 07/17] Display structure of downloaded files --- .github/workflows/build-majestic.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 986f71a3f..802df4008 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -37,7 +37,10 @@ jobs: - uses: actions/download-artifact@master with: name: libpgf-ubuntu - path: / + # path: / + + - name: Display structure of downloaded files + run: ls -R - name: Setup Haskell uses: haskell/actions/setup@v1 From a044adfc8b92c9f5b9d5ed99e48ac0e17b131ef3 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:08:18 +0200 Subject: [PATCH 08/17] Download artifacts to /usr/local --- .github/workflows/build-majestic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 802df4008..d96cd3cba 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -37,10 +37,10 @@ jobs: - uses: actions/download-artifact@master with: name: libpgf-ubuntu - # path: / + path: /usr/local - name: Display structure of downloaded files - run: ls -R + run: ls -R /usr/local - name: Setup Haskell uses: haskell/actions/setup@v1 From 5bf0c9b7ad2acd12439c71d75461631fc4347dbc Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:13:20 +0200 Subject: [PATCH 09/17] mkdir /usr/local/lib and /usr/local/include --- .github/workflows/build-majestic.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index d96cd3cba..8608506eb 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -34,6 +34,10 @@ jobs: steps: - uses: actions/checkout@v2 + - run: | + sudo mkdir -p /usr/local/lib + sudo mkdir -p /usr/local/include + - uses: actions/download-artifact@master with: name: libpgf-ubuntu From d304e57b6e09950749dbd90e1d560a62cd1fccac Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:17:55 +0200 Subject: [PATCH 10/17] Move after download --- .github/workflows/build-majestic.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 8608506eb..12929fb46 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -34,14 +34,12 @@ jobs: steps: - uses: actions/checkout@v2 - - run: | - sudo mkdir -p /usr/local/lib - sudo mkdir -p /usr/local/include - - uses: actions/download-artifact@master with: name: libpgf-ubuntu - path: /usr/local + - run: + mv lib/* /usr/local/lib/ + mv include/* /usr/local/include/ - name: Display structure of downloaded files run: ls -R /usr/local From 04dd99c56c844d43542b7ac39e672a46c292180a Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:19:25 +0200 Subject: [PATCH 11/17] sudo mv --- .github/workflows/build-majestic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 12929fb46..78bb88b5a 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -38,8 +38,8 @@ jobs: with: name: libpgf-ubuntu - run: - mv lib/* /usr/local/lib/ - mv include/* /usr/local/include/ + sudo mv lib/* /usr/local/lib/ + sudo mv include/* /usr/local/include/ - name: Display structure of downloaded files run: ls -R /usr/local From 60a578bd6f5a26642add2ece1332ba49b17d2eec Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:21:11 +0200 Subject: [PATCH 12/17] add pipe ro run command --- .github/workflows/build-majestic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 78bb88b5a..0d15c777d 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -37,7 +37,7 @@ jobs: - uses: actions/download-artifact@master with: name: libpgf-ubuntu - - run: + - run: | sudo mv lib/* /usr/local/lib/ sudo mv include/* /usr/local/include/ From 6b93c6fde4c7f7c04f6d35a5e626b32a1522359c Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:25:04 +0200 Subject: [PATCH 13/17] Be more conservative when displaying /usr/local --- .github/workflows/build-majestic.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 0d15c777d..856c2c2ea 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -41,8 +41,10 @@ jobs: sudo mv lib/* /usr/local/lib/ sudo mv include/* /usr/local/include/ - - name: Display structure of downloaded files - run: ls -R /usr/local + - name: Display downloaded files + run: | + ls -R /usr/local/lib/*pgf* + ls -R /usr/local/include/pgf - name: Setup Haskell uses: haskell/actions/setup@v1 From 900a0985a88df84b5ade0e86d047b675d6c0f3a9 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 15:31:05 +0200 Subject: [PATCH 14/17] Put back bindings in all languages as separate jobs --- .github/workflows/build-majestic.yml | 84 ++++++++++++++++++---------- 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 856c2c2ea..7713c1feb 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -4,7 +4,7 @@ on: push jobs: - ubuntu-build: + ubuntu-runtime: name: Build on Ubuntu runs-on: ubuntu-20.04 @@ -29,11 +29,10 @@ jobs: ubuntu-haskell: name: Build & test Haskell bindings on Ubuntu runs-on: ubuntu-20.04 - needs: ubuntu-build + needs: ubuntu-runtime steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master with: name: libpgf-ubuntu @@ -41,11 +40,6 @@ jobs: sudo mv lib/* /usr/local/lib/ sudo mv include/* /usr/local/include/ - - name: Display downloaded files - run: | - ls -R /usr/local/lib/*pgf* - ls -R /usr/local/include/pgf - - name: Setup Haskell uses: haskell/actions/setup@v1 # with: @@ -59,27 +53,59 @@ jobs: run: | cabal test --extra-lib-dirs=/usr/local/lib - # - name: Install Python bindings - # working-directory: ./src/runtime/python - # run: | - # python setup.py build - # sudo python setup.py install - # - # - name: Run Python testsuite - # working-directory: ./src/runtime/python - # env: - # LD_LIBRARY_PATH: /usr/local/lib - # run: | - # pip install pytest - # pytest - # - # - name: Run JavaScript testsuite - # working-directory: ./src/runtime/javascript - # env: - # LD_LIBRARY_PATH: /usr/local/lib - # run: | - # npm ci - # npm run test + ubuntu-python: + name: Build & test Python bindings on Ubuntu + runs-on: ubuntu-20.04 + needs: ubuntu-runtime + + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@master + with: + name: libpgf-ubuntu + - run: | + sudo mv lib/* /usr/local/lib/ + sudo mv include/* /usr/local/include/ + + - name: Install Python bindings + working-directory: ./src/runtime/python + run: | + python setup.py build + sudo python setup.py install + + - name: Run Python testsuite + working-directory: ./src/runtime/python + env: + LD_LIBRARY_PATH: /usr/local/lib + run: | + pip install pytest + pytest + + ubuntu-javascript: + name: Build & test JavaScript bindings on Ubuntu + runs-on: ubuntu-20.04 + needs: ubuntu-runtime + + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@master + with: + name: libpgf-ubuntu + - run: | + sudo mv lib/* /usr/local/lib/ + sudo mv include/* /usr/local/include/ + + - name: Build JavaScript bindings + working-directory: ./src/runtime/javascript + run: | + npm ci + + - name: Run JavaScript testsuite + working-directory: ./src/runtime/javascript + env: + LD_LIBRARY_PATH: /usr/local/lib + run: | + npm run test # macos: # name: Build on macOS From d218c286eb14f821816439890912f3ac84ad8585 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 21:52:41 +0200 Subject: [PATCH 15/17] Re-enable macOS build in CI. Minor cleanup. --- .github/workflows/build-majestic.yml | 127 ++++++++++++++++----------- 1 file changed, 75 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 7713c1feb..009ca2972 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -5,13 +5,13 @@ on: push jobs: ubuntu-runtime: - name: Build on Ubuntu + name: Runtime (Ubuntu) runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Build C runtime + - name: Build runtime working-directory: ./src/runtime/c run: | autoreconf -i @@ -19,7 +19,8 @@ jobs: make sudo make install - - uses: actions/upload-artifact@master + - name: Upload artifact + uses: actions/upload-artifact@master with: name: libpgf-ubuntu path: | @@ -27,13 +28,14 @@ jobs: /usr/local/include/pgf ubuntu-haskell: - name: Build & test Haskell bindings on Ubuntu + name: Haskell (Ubuntu) runs-on: ubuntu-20.04 needs: ubuntu-runtime steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master + - name: Download artifact + uses: actions/download-artifact@master with: name: libpgf-ubuntu - run: | @@ -42,11 +44,8 @@ jobs: - name: Setup Haskell uses: haskell/actions/setup@v1 - # with: - # ghc-version: '8.6' - # cabal-version: '2.4.1.0' - - name: Run Haskell testsuite + - name: Build & run testsuite working-directory: ./src/runtime/haskell env: LD_LIBRARY_PATH: /usr/local/lib @@ -54,26 +53,27 @@ jobs: cabal test --extra-lib-dirs=/usr/local/lib ubuntu-python: - name: Build & test Python bindings on Ubuntu + name: Python (Ubuntu) runs-on: ubuntu-20.04 needs: ubuntu-runtime steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master + - name: Download artifact + uses: actions/download-artifact@master with: name: libpgf-ubuntu - run: | sudo mv lib/* /usr/local/lib/ sudo mv include/* /usr/local/include/ - - name: Install Python bindings + - name: Install bindings working-directory: ./src/runtime/python run: | python setup.py build sudo python setup.py install - - name: Run Python testsuite + - name: Run testsuite working-directory: ./src/runtime/python env: LD_LIBRARY_PATH: /usr/local/lib @@ -82,63 +82,86 @@ jobs: pytest ubuntu-javascript: - name: Build & test JavaScript bindings on Ubuntu + name: JavaScript (Ubuntu) runs-on: ubuntu-20.04 needs: ubuntu-runtime steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@master + - name: Download artifact + uses: actions/download-artifact@master with: name: libpgf-ubuntu - run: | sudo mv lib/* /usr/local/lib/ sudo mv include/* /usr/local/include/ - - name: Build JavaScript bindings + - name: Install dependencies working-directory: ./src/runtime/javascript run: | npm ci - - name: Run JavaScript testsuite + - name: Run testsuite working-directory: ./src/runtime/javascript env: LD_LIBRARY_PATH: /usr/local/lib run: | npm run test - # macos: - # name: Build on macOS - # runs-on: macOS-11 - # - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install build tools - # run: | - # brew install \ - # autoconf \ - # automake \ - # libtool \ - # - # - name: Build C runtime - # working-directory: ./src/runtime/c - # run: | - # glibtoolize - # autoreconf -i - # ./configure - # make - # sudo make install - # - # - name: Setup Haskell - # uses: haskell/actions/setup@v1 - # # with: - # # ghc-version: '8.6' - # # cabal-version: '2.4.1.0' - # - # - name: Run Haskell testsuite - # working-directory: ./src/runtime/haskell - # env: - # LD_LIBRARY_PATH: /usr/local/lib - # run: | - # cabal test --extra-lib-dirs=/usr/local/lib +# ---------------------------------------------------------------------------- + + macos-runtime: + name: Runtime (macOS) + runs-on: macOS-11 + + steps: + - uses: actions/checkout@v2 + + - name: Install build tools + run: | + brew install \ + autoconf \ + automake \ + libtool \ + + - name: Build runtime + working-directory: ./src/runtime/c + run: | + glibtoolize + autoreconf -i + ./configure + make + sudo make install + + - name: Upload artifact + uses: actions/upload-artifact@master + with: + name: libpgf-macos + path: | + /usr/local/lib/libpgf* + /usr/local/include/pgf + + macos-haskell: + name: Haskell (macOS) + runs-on: macOS-11 + needs: macos-runtime + + steps: + - uses: actions/checkout@v2 + - name: Download artifact + uses: actions/download-artifact@master + with: + name: libpgf-macos + - run: | + sudo mv lib/* /usr/local/lib/ + sudo mv include/* /usr/local/include/ + + - name: Setup Haskell + uses: haskell/actions/setup@v1 + + - name: Build & run testsuite + working-directory: ./src/runtime/haskell + env: + LD_LIBRARY_PATH: /usr/local/lib + run: | + cabal test --extra-lib-dirs=/usr/local/lib From 26069e7ffeb2f45c26c6e36c219a56fa2388bf86 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 22:09:55 +0200 Subject: [PATCH 16/17] Set LD_LIBRARY_PATH globally in all workflow jobs/steps --- .github/workflows/build-majestic.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 009ca2972..c72618d91 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -2,6 +2,9 @@ name: Build majestic runtime on: push +env: + LD_LIBRARY_PATH: /usr/local/lib + jobs: ubuntu-runtime: @@ -47,8 +50,6 @@ jobs: - name: Build & run testsuite working-directory: ./src/runtime/haskell - env: - LD_LIBRARY_PATH: /usr/local/lib run: | cabal test --extra-lib-dirs=/usr/local/lib @@ -75,8 +76,6 @@ jobs: - name: Run testsuite working-directory: ./src/runtime/python - env: - LD_LIBRARY_PATH: /usr/local/lib run: | pip install pytest pytest @@ -103,8 +102,6 @@ jobs: - name: Run testsuite working-directory: ./src/runtime/javascript - env: - LD_LIBRARY_PATH: /usr/local/lib run: | npm run test @@ -161,7 +158,5 @@ jobs: - name: Build & run testsuite working-directory: ./src/runtime/haskell - env: - LD_LIBRARY_PATH: /usr/local/lib run: | cabal test --extra-lib-dirs=/usr/local/lib From a5fb51ff3d6bf8a257db1a8189ae83bad5196dd7 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 14 Oct 2021 22:23:39 +0200 Subject: [PATCH 17/17] Add some notes about uninstalling runtime --- src/runtime/c/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/runtime/c/README.md b/src/runtime/c/README.md index fd140b010..43f394891 100644 --- a/src/runtime/c/README.md +++ b/src/runtime/c/README.md @@ -40,3 +40,24 @@ The shared libraries are installed in `/usr/local/lib`. - Compiling GF with this runtime will require flag `--extra-lib-dirs=/usr/local/lib`. - Running GF with this runtime will require environment variable `LD_LIBRARY_PATH=/usr/local/lib` + +## Uninstalling + +To remove the _old_ C runtime from your system, do: +``` +rm /usr/local/lib/libpgf.* +rm /usr/local/lib/libgu.* +rm /usr/local/lib/libsg.* +rm -rf /usr/local/include/pgf +``` + +To remove _this_ version of the runtime from your system, do: +``` +rm /usr/local/lib/libpgf.* +rm -rf /usr/local/include/pgf +``` + +To clean all generated build files from this directory, use: +``` +git clean -Xdf +```