diff options
author | Julian Ospald <hasufell@posteo.de> | 2022-05-16 16:45:17 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-21 12:51:16 -0400 |
commit | 7edd991e5d00a1ba19f3607fe8a66bbdc3ab3181 (patch) | |
tree | 53815dd4023fa6adf8ca862f17635ac21b9a9935 | |
parent | ecf5f3634c9971de4ae21870f0d6f3d5a35634a1 (diff) | |
download | haskell-7edd991e5d00a1ba19f3607fe8a66bbdc3ab3181.tar.gz |
Test DESTDIR in test_hadrian()wip/type-data
-rwxr-xr-x | .gitlab/ci.sh | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 48c34ec4fc..3e3549e2f1 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -539,6 +539,27 @@ function build_hadrian() { } +# run's `make DESTDIR=$1 install` and then +# merges the file tree to the actual destination $2, +# ensuring that `DESTDIR` is properly honoured by the +# build system +function make_install_destdir() { + local destdir=$1 + local instdir=$2 + + mkdir -p "$destdir" + mkdir -p "$instdir" + run "$MAKE" DESTDIR="$destdir" install + # check for empty dir portably + # https://superuser.com/a/667100 + if find "$instdir" -mindepth 1 -maxdepth 1 | read; then + fail "$instdir is not empty!" + fi + info "merging file tree from $destdir to $instdir" + cp -a "$destdir/$instdir"/* "$instdir"/ + "$instdir"/bin/ghc-pkg recache +} + function test_hadrian() { if [ -n "${CROSS_TARGET:-}" ]; then info "Can't test cross-compiled build." @@ -582,8 +603,8 @@ function test_hadrian() { ;; *) read -r -a args <<< "${INSTALL_CONFIGURE_ARGS:-}" - run ./configure --prefix="$TOP"/_build/install "${args[@]+"${args[@]}"}" - run "$MAKE" install + run ./configure --prefix="$TOP"/_build/install "${args[@]+"${args[@]}"}" + make_install_destdir "$TOP"/destdir "$TOP"/_build/install ;; esac cd ../../../ |