Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GHC musl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
GHC musl
Commits
9ca36d18
Verified
Commit
9ca36d18
authored
1 year ago
by
Olivier Benz
Browse files
Options
Downloads
Patches
Plain Diff
Rebuild Cabal (the tool) with the GHC target version
parent
b4a42a1d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#24563
passed
1 year ago
Stage: build1
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+4
-4
4 additions, 4 deletions
.gitlab-ci.yml
latest.Dockerfile
+31
-14
31 additions, 14 deletions
latest.Dockerfile
with
35 additions
and
18 deletions
.gitlab-ci.yml
+
4
−
4
View file @
9ca36d18
...
@@ -69,7 +69,7 @@ build:latest-linux-amd64:
...
@@ -69,7 +69,7 @@ build:latest-linux-amd64:
--build-arg GHC_VERSION
--build-arg GHC_VERSION
--build-arg CABAL_VERSION
--build-arg CABAL_VERSION
--build-arg STACK_VERSION
--build-arg STACK_VERSION
--target test
er
--target test
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-linux-amd64
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-linux-amd64
-f latest.Dockerfile .
-f latest.Dockerfile .
...
@@ -101,7 +101,7 @@ build:latest-linux-arm64v8:
...
@@ -101,7 +101,7 @@ build:latest-linux-arm64v8:
--build-arg GHC_VERSION
--build-arg GHC_VERSION
--build-arg CABAL_VERSION
--build-arg CABAL_VERSION
--build-arg STACK_VERSION
--build-arg STACK_VERSION
--target test
er
--target test
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-linux-arm64v8
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-linux-arm64v8
-f latest.Dockerfile .
-f latest.Dockerfile .
...
@@ -130,7 +130,7 @@ build:version-linux-amd64:
...
@@ -130,7 +130,7 @@ build:version-linux-amd64:
script
:
script
:
-
>
-
>
docker build
docker build
--target test
er
--target test
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
-f prior/$GHC_VERSION.Dockerfile .
-f prior/$GHC_VERSION.Dockerfile .
-
>
-
>
...
@@ -152,7 +152,7 @@ build:version-linux-arm64v8:
...
@@ -152,7 +152,7 @@ build:version-linux-arm64v8:
script
:
script
:
-
>
-
>
docker build
docker build
--target test
er
--target test
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
-f prior/$GHC_VERSION.Dockerfile .
-f prior/$GHC_VERSION.Dockerfile .
-
>
-
>
...
...
This diff is collapsed.
Click to expand it.
latest.Dockerfile
+
31
−
14
View file @
9ca36d18
...
@@ -44,21 +44,26 @@ RUN cd /tmp \
...
@@ -44,21 +44,26 @@ RUN cd /tmp \
&&
cd
"ghc-
$GHC_VERSION
"
\
&&
cd
"ghc-
$GHC_VERSION
"
\
&&
./boot.source
\
&&
./boot.source
\
&&
./configure
--disable-ld-override
LD
=
ld.gold
\
&&
./configure
--disable-ld-override
LD
=
ld.gold
\
# Use the LLVM backend
#
#
Use the LLVM backend
# Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
#
#
Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
# so we can match the llvm vendor string alpine uses
#
#
so we can match the llvm vendor string alpine uses
&& sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnueabi/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnueabi/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnu/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnu/alpine-linux/g' llvm-targets \
&& cabal update \
&& cabal update \
# See https://unix.stackexchange.com/questions/519092/what-is-the-logic-of-using-nproc-1-in-make-command
#
#
See https://unix.stackexchange.com/questions/519092/what-is-the-logic-of-using-nproc-1-in-make-command
&& hadrian/build binary-dist -j"$(($(nproc)+1))" \
&& hadrian/build binary-dist -j"$(($(nproc)+1))" \
--flavour=perf+llvm+split_sections \
--flavour=perf+llvm+split_sections \
--docs=none \
--docs=none
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
FROM
bootstrap
as
bootstrap-cabal
## Build Cabal (the tool) with the GHC bootstrap version
RUN
cabal update
\
## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install --allow-newer --constraint 'Cabal-syntax<3.11' "cabal-install-$CABAL_VERSION"
&& cabal install --allow-newer --constraint 'Cabal-syntax<3.11' "cabal-install-$CABAL_VERSION"
FROM
alpine:3.18
as
builder
FROM
alpine:3.18
as
ghc-stage1
LABEL
org.opencontainers.image.licenses="MIT" \
LABEL
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
...
@@ -110,10 +115,10 @@ RUN apk add --no-cache \
...
@@ -110,10 +115,10 @@ RUN apk add --no-cache \
COPY
--from=bootstrap /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
COPY
--from=bootstrap /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
RUN
cd
/tmp
\
RUN
cd
/tmp
\
# Fix https://github.com/haskell/cabal/issues/8923
#
#
Fix https://github.com/haskell/cabal/issues/8923
&& PKG_CONFIG_VERSION="$(pkg-config --version)" \
&& PKG_CONFIG_VERSION="$(pkg-config --version)" \
&& if [ "${PKG_CONFIG_VERSION%.*}" = "1.9" ]; then \
&& if [ "${PKG_CONFIG_VERSION%.*}" = "1.9" ]; then \
# Downgrade pkgconf from 1.9.x to 1.8.1
#
#
Downgrade pkgconf from 1.9.x to 1.8.1
curl -sSLO http://dl-cdn.alpinelinux.org/alpine/v3.16/main/"$(uname -m)"/pkgconf-1.8.1-r0.apk; \
curl -sSLO http://dl-cdn.alpinelinux.org/alpine/v3.16/main/"$(uname -m)"/pkgconf-1.8.1-r0.apk; \
apk add --no-cache pkgconf-1.8.1-r0.apk; \
apk add --no-cache pkgconf-1.8.1-r0.apk; \
fi \
fi \
...
@@ -132,25 +137,37 @@ RUN cd /tmp \
...
@@ -132,25 +137,37 @@ RUN cd /tmp \
## Clean up
## Clean up
&& rm -rf /tmp/*
&& rm -rf /tmp/*
## Install Cabal
FROM
ghc-stage1
as
ghc-stage2
COPY
--from=bootstrap /root/.local/bin/cabal /usr/local/bin/cabal
FROM
builder
as
tester
## Install Cabal (the tool) built with the GHC bootstrap version
COPY
--from=bootstrap-cabal /root/.local/bin/cabal /usr/local/bin/cabal
## Rebuild Cabal (the tool) with the GHC target version
RUN
cabal update
\
&&
cabal
install
--allow-newer
--constraint
'Cabal-syntax<3.11'
"cabal-install-
$CABAL_VERSION
"
FROM
ghc-stage1
as
test
WORKDIR
/usr/local/src
WORKDIR
/usr/local/src
## Install Cabal (the tool) built with the GHC target version
COPY
--from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal
COPY
Main.hs Main.hs
COPY
Main.hs Main.hs
RUN
ghc
-static
-optl-pthread
-optl-static
Main.hs
\
RUN
ghc
-static
-optl-pthread
-optl-static
Main.hs
\
&&
file Main
\
&&
file Main
\
&&
./Main
\
&&
./Main
\
# Test cabal workflow
#
#
Test cabal workflow
&& mkdir cabal-test \
&& mkdir cabal-test \
&& cd cabal-test \
&& cd cabal-test \
&& cabal update \
&& cabal update \
&& cabal init -n --is-executable -p tester -l MIT \
&& cabal init -n --is-executable -p tester -l MIT \
&& cabal run
&& cabal run
FROM
builder
as
final
FROM
ghc-stage1
## Install Cabal (the tool) built with the GHC target version
COPY
--from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal
CMD
["ghci"]
CMD
["ghci"]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment