Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup-hs
Commits
b2d29960
Verified
Commit
b2d29960
authored
3 years ago
by
Julian Ospald
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-nix'
parents
d68ab3b6
df2337ab
No related branches found
No related tags found
1 merge request
!217
Fix nix, hopefully for the last time, fixes #274
Pipeline
#43043
canceled
3 years ago
Stage: checks
Stage: quick-test
Stage: test
Stage: expensive-test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+70
-38
70 additions, 38 deletions
.gitlab-ci.yml
.gitlab/ghcup_env
+1
-1
1 addition, 1 deletion
.gitlab/ghcup_env
.gitlab/shell.nix
+0
-90
0 additions, 90 deletions
.gitlab/shell.nix
with
71 additions
and
129 deletions
.gitlab-ci.yml
+
70
−
38
View file @
b2d29960
...
...
@@ -11,6 +11,10 @@ variables:
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV
:
8d0224e6b2a08157649651e69302380b2bd24e11
# Sequential version number of all cached things.
# Bump to invalidate GitLab CI cache.
CACHE_REV
:
0
############################################################
# CI Step
############################################################
...
...
@@ -164,26 +168,40 @@ variables:
-
.test_ghcup_version
-
.darwin:aarch64
-
.root_cleanup
cache
:
key
:
darwin-brew-$CACHE_REV
paths
:
-
.brew
-
.brew_cache
before_script
:
# Install brew locally in the project dir. Packages will also be installed here.
-
git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew
-
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
# otherwise we seem to get intel binaries
-
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
# make sure to not pollute the machine with temp files etc
-
mkdir -p $CI_PROJECT_DIR/.brew_cache
-
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
-
mkdir -p $CI_PROJECT_DIR/.brew_logs
-
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
-
mkdir -p $CI_PROJECT_DIR/.brew_tmp
-
export HOMEBREW_TEMP=$CI_PROJECT_DIR/.brew_tmp
# update and install packages
-
brew update
-
brew install llvm
-
brew install autoconf automake coreutils
script
:
|
set -Eeuo pipefail
function runInNixShell() {
time nix-shell $CI_PROJECT_DIR/.gitlab/shell.nix \
-I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
--argstr system "aarch64-darwin" \
--pure \
--keep CI_PROJECT_DIR \
--keep MACOSX_DEPLOYMENT_TARGET \
--keep JSON_VERSION \
--keep ARTIFACT \
--keep OS \
--keep ARCH \
--keep CABAL_DIR \
--keep GHC_VERSION \
--keep CABAL_VERSION \
--run "$1" 2>&1
}
runInNixShell ./.gitlab/before_script/darwin/install_deps.sh 2>&1
runInNixShell ./.gitlab/script/ghcup_version.sh 2>&1
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
export LD=ld
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
./.gitlab/before_script/darwin/install_deps.sh
./.gitlab/script/ghcup_version.sh
.test_ghcup_version:freebsd12
:
extends
:
...
...
@@ -508,26 +526,40 @@ release:darwin:aarch64:
-
.darwin:aarch64
-
.release_ghcup
-
.root_cleanup
cache
:
key
:
darwin-brew-$CACHE_REV
paths
:
-
.brew
-
.brew_cache
before_script
:
# Install brew locally in the project dir. Packages will also be installed here.
-
git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew
-
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
# otherwise we seem to get intel binaries
-
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
# make sure to not pollute the machine with temp files etc
-
mkdir -p $CI_PROJECT_DIR/.brew_cache
-
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
-
mkdir -p $CI_PROJECT_DIR/.brew_logs
-
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
-
mkdir -p $CI_PROJECT_DIR/.brew_tmp
-
export HOMEBREW_TEMP=$CI_PROJECT_DIR/.brew_tmp
# update and install packages
-
brew update
-
brew install llvm
-
brew install autoconf automake
script
:
|
set -Eeuo pipefail
function runInNixShell() {
time nix-shell $CI_PROJECT_DIR/.gitlab/shell.nix \
-I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
--argstr system "aarch64-darwin" \
--pure \
--keep CI_PROJECT_DIR \
--keep MACOSX_DEPLOYMENT_TARGET \
--keep JSON_VERSION \
--keep ARTIFACT \
--keep OS \
--keep ARCH \
--keep CABAL_DIR \
--keep GHC_VERSION \
--keep CABAL_VERSION \
--run "$1" 2>&1
}
runInNixShell ./.gitlab/before_script/darwin/install_deps.sh 2>&1
runInNixShell ./.gitlab/script/ghcup_release.sh 2>&1
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
export LD=ld
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
./.gitlab/before_script/darwin/install_deps.sh
./.gitlab/script/ghcup_release.sh
variables
:
ARTIFACT
:
"
aarch64-apple-darwin-ghcup"
GHC_VERSION
:
"
8.10.7"
...
...
This diff is collapsed.
Click to expand it.
.gitlab/ghcup_env
+
1
−
1
View file @
b2d29960
...
...
@@ -6,6 +6,6 @@ if [ "${OS}" = "WINDOWS" ] ; then
else
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
export GHCUP_BIN="$CI_PROJECT_DIR/.ghcup/bin"
export PATH="$GHCUP_BIN:$CI_PROJECT_DIR/.local/bin:
/opt/llvm/bin:
$PATH"
export PATH="$GHCUP_BIN:$CI_PROJECT_DIR/.local/bin:$PATH"
export TMPDIR="$CI_PROJECT_DIR/tmp"
fi
This diff is collapsed.
Click to expand it.
.gitlab/shell.nix
deleted
100644 → 0
+
0
−
90
View file @
d68ab3b6
{
system
?
"aarch64-darwin"
#, nixpkgs ? fetchTarball https://github.com/angerman/nixpkgs/archive/257cb120334.tar.gz #apple-silicon.tar.gz
,
pkgs
?
import
<
nixpkgs
>
{
inherit
system
;
}
,
compiler
?
if
system
==
"aarch64-darwin"
then
"ghc8103Binary"
else
"ghc8103"
}:
pkgs
.
mkShell
{
# this prevents nix from trying to write the env-vars file.
# we can't really, as NIX_BUILD_TOP/env-vars is not set.
noDumpEnvVars
=
1
;
# stop polluting LDFLAGS with -liconv
dontAddExtraLibs
=
true
;
# we need to inject ncurses into --with-curses-libraries.
# the real fix is to teach terminfo to use libcurses on macOS.
# CONFIGURE_ARGS = "--with-intree-gmp --with-curses-libraries=${pkgs.ncurses.out}/lib";
CONFIGURE_ARGS
=
"--with-intree-gmp --with-curses-libraries=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib --with-iconv-includes=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include --with-iconv-libraries=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib SH=/bin/bash"
;
# magic speedup pony :facepalm:
#
# nix has the ugly habbit of duplicating ld flags more than necessary. This
# somewhat consolidates this.
shellHook
=
''
export NIX_LDFLAGS=$(for a in $NIX_LDFLAGS; do echo $a; done |sort|uniq|xargs)
export NIX_LDFLAGS_FOR_TARGET=$(for a in $NIX_LDFLAGS_FOR_TARGET; do echo $a; done |sort|uniq|xargs)
export NIX_LDFLAGS_FOR_TARGET=$(comm -3 <(for l in $NIX_LDFLAGS_FOR_TARGET; do echo $l; done) <(for l in $NIX_LDFLAGS; do echo $l; done))
# Impurity hack for GHC releases.
#################################
# We don't want binary releases to depend on nix, thus we'll need to make sure we don't leak in references.
# GHC externally depends only on iconv and curses. However we can't force a specific curses library for
# the terminfo package, as such we'll need to make sure we only look in the system path for the curses library
# and not pick up the tinfo from the nix provided ncurses package.
#
# We also need to force us to use the systems COREFOUNDATION, not the one that nix builds. Again this is impure,
# but it will allow us to have proper binary distributions.
#
# do not use nixpkgs provided core foundation
export NIX_COREFOUNDATION_RPATH=/System/Library/Frameworks
# drop curses from the LDFLAGS, we really want the system ones, not the nix ones.
export NIX_LDFLAGS=$(for lib in $NIX_LDFLAGS; do case "$lib" in *curses*);; *) echo -n "$lib ";; esac; done;)
export NIX_CFLAGS_COMPILE+=" -Wno-nullability-completeness -Wno-availability -Wno-expansion-to-defined -Wno-builtin-requires-header -Wno-unused-command-line-argument"
# unconditionally add the MacOSX.sdk and TargetConditional.h
export NIX_CFLAGS_COMPILE+=" -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
export NIX_LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $NIX_LDFLAGS"
''
;
nativeBuildInputs
=
(
with
pkgs
;
[
# This needs to come *before* ghc,
# otherwise we migth end up with the clang from
# the bootstrap GHC in PATH with higher priority.
clang_11
llvm_11
haskell
.
compiler
.
${
compiler
}
haskell
.
packages
.
${
compiler
}
.
cabal-install
haskell
.
packages
.
${
compiler
}
.
alex
haskell
.
packages
.
${
compiler
}
.
happy
# _1_19_12 is needed for older GHCs.
automake
autoconf
m4
gmp
zlib
.
out
zlib
.
dev
glibcLocales
# locale doesn't build yet :-/
# locale
git
python3
# python3Full
# python3Packages.sphinx
perl
which
wget
curl
file
xz
xlibs
.
lndir
cacert
])
++
(
with
pkgs
.
darwin
.
apple_sdk
.
frameworks
;
[
Foundation
Security
]);
}
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