Skip to content

Commit

Permalink
Swap cabal build for install now that static install works
Browse files Browse the repository at this point in the history
We also need to upgrade to cabal 3.12 to get the fix, so we fix the
version in our release scripts.
  • Loading branch information
tbidne committed Oct 31, 2024
1 parent 9275341 commit 7710d5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
6 changes: 1 addition & 5 deletions .github/scripts/release_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ arch=$(uname -m)

mkdir -p bin

# see NOTE: [Cabal Build vs. Install]
#
# Use cabal build for now for symmetry with linux static release.
cabal update
cabal build exe:shrun --project-file cabal.ghc982.project --ghc-options -Werror
cabal install exe:shrun --installdir bin/ --program-suffix "_$shrun_vers-$arch-linux-ubuntu_$ubuntu_vers" --project-file cabal.ghc982.project --ghc-options -Werror

cp ./dist-newstyle/build/x86_64-linux/ghc-*/shrun-*/x/shrun/opt/build/shrun/shrun "bin/shrun_$shrun_vers-$arch-linux-ubuntu_$ubuntu_vers"
6 changes: 1 addition & 5 deletions .github/scripts/release_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ fi

mkdir -p bin

# see NOTE: [Cabal Build vs. Install]
#
# Use cabal build for now for symmetry with linux static release.
cabal update
cabal build exe:shrun --project-file cabal.ghc982.project --ghc-options -Werror
cabal install exe:shrun --installdir bin/ --program-suffix "_$shrun_vers-$arch-macos_$apple_vers-darwin" --project-file cabal.ghc982.project --ghc-options -Werror

cp ./dist-newstyle/build/$cabal_build_dir/ghc-*/shrun-*/x/shrun/opt/build/shrun/shrun "bin/shrun_$shrun_vers-$arch-macos_$apple_vers-darwin"
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ jobs:
- uses: haskell-actions/setup@v2
with:
ghc-version: "9.8.2"
cabal-version: "3.12"
- name: Install binary
run: |
.github/scripts/release_osx.sh
Expand Down Expand Up @@ -186,6 +187,7 @@ jobs:
- uses: haskell-actions/setup@v2
with:
ghc-version: "9.8.2"
cabal-version: "3.12"
- name: Install binary
run: |
.github/scripts/release_linux.sh
Expand Down
13 changes: 3 additions & 10 deletions docker/alpine_amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,21 @@ echo "*** Installing ghc ***"
ghcup install ghc 9.8.2 --set

echo "*** Installing cabal ***"
ghcup install cabal 3.10.3.0 --set
ghcup install cabal 3.12 --set

echo "*** Building shrun ***"

cd /opt/shrun

# NOTE: [Cabal Build vs. Install]
#
# Replace 'cabal build' with 'cabal install' once --enable-executable-static
# works for install.
arch=$(uname -m)

cabal update
cabal build --enable-executable-static --enable-executable-stripping exe:shrun --project-file cabal.ghc982.project --ghc-options -Werror
cabal install --installdir bin/ --program-suffix "_$shrun_vers-$arch-linux-static" --enable-executable-static --enable-executable-stripping exe:shrun --project-file cabal.ghc982.project --ghc-options -Werror

echo "*** Copy binary ***"

mkdir -p /opt/shrun/bin

arch=$(uname -m)

cp ./dist-newstyle/build/x86_64-linux/ghc-*/shrun-*/x/shrun/opt/build/shrun/shrun "/opt/shrun/bin/shrun_$shrun_vers-$arch-linux-static"

cd ../../

EOF
Expand Down

0 comments on commit 7710d5e

Please sign in to comment.