Skip to content

Commit cb64dca

Browse files
committed
release: use Alpine Linux 3.6, GHC from community repository, and static flag (closes #3045)
1 parent 63267f9 commit cb64dca

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

etc/scripts/release.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ options =
103103
"Label to give the uploaded release asset"
104104
, Option "" [noTestHaddocksOptName] (NoArg $ Right $ \g -> g{gTestHaddocks = False})
105105
"Disable testing building haddocks."
106-
-- FIXME: Use 'static' flag in stack.cabal instead. See https://github.com/commercialhaskell/stack/issues/3045.
107-
, Option "" [staticOptName] (NoArg $ Right $ \g -> g{gBuildArgs = gBuildArgs g ++ ["--split-objs", "--ghc-options=-optc-Os -optl-static -fPIC"]})
106+
, Option "" [staticOptName] (NoArg $ Right $ \g -> g{gBuildArgs = gBuildArgs g ++ ["--flag=stack:static"]})
108107
"Build a static binary."
109108
, Option "" [buildArgsOptName]
110109
(ReqArg
@@ -162,7 +161,7 @@ rules global@Global{..} args = do
162161
c
163162
() <- cmd0 "install" gBuildArgs $ concat $ concat
164163
[["--pedantic --no-haddock-deps"], [" --haddock" | gTestHaddocks]]
165-
() <- cmd0 (Cwd "etc/scripts") "install" gBuildArgs "cabal-install"
164+
() <- cmd0 (Cwd "etc/scripts") "install" "cabal-install"
166165
let cmd' c = cmd (AddPath [tmpDir] []) stackProgName (stackArgs global) c
167166
() <- cmd' "test" gBuildArgs "--pedantic --flag stack:integration-tests"
168167
return ()

etc/scripts/vagrant-releases.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
set -xe
3-
"$(dirname "$0")/with-vagrant.sh" alpine-3.4-x86_64 "--binary-variant=static --static $* release"
3+
"$(dirname "$0")/with-vagrant.sh" alpine-3.6-x86_64 "--binary-variant=static --static $* release"
44
"$(dirname "$0")/with-vagrant.sh" freebsd-11.0-amd64 "$* release" "export LANG=en_US.UTF-8;"
55
"$(dirname "$0")/with-vagrant.sh" debian-7-amd64 "$* release"
66
"$(dirname "$0")/with-vagrant.sh" debian-7-i386 "$* release"

etc/vagrant/alpine-3.4-x86_64/Vagrantfile renamed to etc/vagrant/alpine-3.6-x86_64/Vagrantfile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Vagrant.configure(2) do |config|
2-
config.vm.box = "maier/alpine-3.4-x86_64"
2+
config.vm.box = "maier/alpine-3.6-x86_64"
33
config.vm.synced_folder ENV['STACK_BUILD_DIR'], "/vagrant-build", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#", "*.vdi", "*.vmdk"], rsync__args: ["--verbose", "--archive", "--delete", "-z", "--copy-links"], rsync__rsync_path: "/usr/bin/rsync", rsync__chown: false
44
config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#", "*.vdi", "*.vmdk"], rsync__args: ["--verbose", "--archive", "--delete", "-z", "--copy-links"], rsync__rsync_path: "/usr/bin/rsync", rsync__chown: false
55
config.vm.provider "virtualbox" do |vb|
@@ -8,18 +8,9 @@ Vagrant.configure(2) do |config|
88
config.ssh.forward_agent = true
99
config.vm.provision "shell", inline: <<-SHELL
1010
set -xe
11-
#FIXME: See https://github.com/commercialhaskell/stack/issues/3045, probably use:
12-
#FIXME: apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing ghc ghc-dev cabal
13-
if ! grep 's3-us-west-2\.amazonaws\.com/alpine-ghc/7\.10' /etc/apk/repositories; then
14-
echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/7.10" |sudo tee -a /etc/apk/repositories
15-
fi
16-
if ! test -s /etc/apk/keys/[email protected]; then
17-
curl -o /etc/apk/keys/[email protected] https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%40gmail.com-55881c97.rsa.pub
18-
fi
19-
apk -q update
20-
apk add alpine-sdk linux-headers musl-dev gmp-dev zlib-dev ghc git rsync gnupg xz
21-
cp /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginT.o /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginT.o.orig
22-
cp /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginS.o /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginT.o
11+
apk update
12+
apk add alpine-sdk linux-headers musl-dev gmp-dev zlib-dev git rsync gnupg xz
13+
apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community ghc ghc-dev cabal
2314
if ! which stack; then
2415
curl -sSL https://www.stackage.org/stack/linux-x86_64-static \
2516
| tar xzvf - --wildcards --strip-components=1 -C /usr/local/bin '*/stack'

0 commit comments

Comments
 (0)