Skip to content
Snippets Groups Projects
Unverified Commit 5678b550 authored by Julian Ospald's avatar Julian Ospald :tea:
Browse files

f

parent 0f06f147
No related branches found
No related tags found
No related merge requests found
Pipeline #38975 failed
......@@ -209,7 +209,7 @@ variables:
artifacts:
expire_in: 2 week
paths:
- _release/stack-*
- $CI_PROJECT_DIR/.local/bin/
only:
- tags
......
......@@ -6,40 +6,5 @@ set -eux
mkdir -p "$CI_PROJECT_DIR"/.local/bin
ecabal() {
cabal "$@"
}
git config --global core.fscache false
git describe
if [ "${OS}" = "LINUX" ]
then
# Retry installing nix due to nondeterministic error
# Fatal error: glibc detected an invalid stdio handle
# See:
# https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181
# https://github.com/NixOS/nix/issues/2733
#
mkdir -m 0755 /nix && chown root /nix
(for i in {1..5}; do sh <(curl -sSL https://nixos.org/nix/install) && exit 0; done; exit 1)
. ~/.nix-profile/etc/profile.d/nix.sh
nix-channel --add https://nixos.org/channels/nixos-19.09 nixpkgs
nix-channel --update
elif [ "${OS}" == "WINDOWS" ]
then
# choco install nsis-unicode -y
echo "nothing"
fi
# Do this in the same step as installing deps to get relevant env var modifications
if [ "${OS}" = "LINUX" ]
then
stack etc/scripts/release.hs check --allow-dirty --alpine
stack etc/scripts/release.hs build --allow-dirty --alpine
else
stack etc/scripts/release.hs check --allow-dirty
stack etc/scripts/release.hs build --allow-dirty
fi
stack build --flag stack:integration-tests stack --exec stack-integration-test
......@@ -20,6 +20,12 @@ fi
git describe --always
if [ "${OS}" = "WINDOWS" ] ; then
ext=".exe"
else
ext=''
fi
### build
ecabal update
......@@ -27,17 +33,31 @@ ecabal update
echo '' >> stack.yaml
echo 'allow-different-user: true' >> stack.yaml
ecabal build -w ghc-${GHC_VERSION}
ecabal test -w ghc-${GHC_VERSION}
ecabal haddock -w ghc-${GHC_VERSION}
if [ "${OS}" = "WINDOWS" ] ; then
ext=".exe"
if [ "${OS}" = "LINUX" ] ; then
if [ "${ARCH}" = "32" ] ; then
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static'
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static' --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
elif [ "${ARCH}" = "64" ] ; then
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static'
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static' --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
else
ecabal build -w ghc-${GHC_VERSION}
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
fi
elif [ "${OS}" = "FREEBSD" ] ; then
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections'
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --ghc-options='-split-sections' --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
elif [ "${OS}" = "WINDOWS" ] ; then
ecabal build -w ghc-${GHC_VERSION}
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
else
ext=''
ecabal build -w ghc-${GHC_VERSION}
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
fi
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v stack')" "$CI_PROJECT_DIR"/.local/bin/stack${ext}
ecabal test -w ghc-${GHC_VERSION}
ecabal haddock -w ghc-${GHC_VERSION}
### cleanup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment