Skip to content

Commit 476d0c9

Browse files
committed
Also print pkg names additionally to abi hash
1 parent 6259067 commit 476d0c9

File tree

5 files changed

+86
-88
lines changed

5 files changed

+86
-88
lines changed

.gitlab-ci.yml

Lines changed: 41 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ build-aarch64-linux-deb10:
6060
extends: .build
6161
before_script:
6262
- sudo apt update
63-
- sudo apt install -y patchelf
63+
- sudo apt install -y patchelf tree
6464
tags:
6565
- aarch64-linux
6666
image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV"
@@ -86,6 +86,9 @@ test-aarch64-linux-deb10:
8686
tags:
8787
- aarch64-linux
8888
image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV"
89+
before_script:
90+
- sudo apt update
91+
- sudo apt install -y tree
8992

9093

9194
######################
@@ -96,7 +99,7 @@ build-armv7-linux-deb10:
9699
extends: .build
97100
before_script:
98101
- sudo apt update
99-
- sudo apt install -y patchelf
102+
- sudo apt install -y patchelf tree
100103
tags:
101104
- armv7-linux
102105
image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb10:$DOCKER_REV"
@@ -122,6 +125,9 @@ test-armv7-linux-deb10:
122125
tags:
123126
- armv7-linux
124127
image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb10:$DOCKER_REV"
128+
before_script:
129+
- sudo apt update
130+
- sudo apt install -y tree
125131

126132

127133
######################
@@ -132,7 +138,7 @@ build-x86_64-linux-deb10:
132138
extends: .build
133139
before_script:
134140
- sudo apt update
135-
- sudo apt install -y patchelf
141+
- sudo apt install -y patchelf tree
136142
tags:
137143
- x86_64-linux
138144
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV"
@@ -158,6 +164,9 @@ test-x86_64-linux-deb10:
158164
tags:
159165
- x86_64-linux
160166
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV"
167+
before_script:
168+
- sudo apt update
169+
- sudo apt install -y tree
161170

162171
######################
163172
# x86_64 linux deb9
@@ -167,7 +176,7 @@ build-x86_64-linux-deb9:
167176
extends: .build
168177
before_script:
169178
- sudo apt update
170-
- sudo apt install -y patchelf
179+
- sudo apt install -y patchelf tree
171180
tags:
172181
- x86_64-linux
173182
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
@@ -193,6 +202,9 @@ test-x86_64-linux-deb9:
193202
tags:
194203
- x86_64-linux
195204
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
205+
before_script:
206+
- sudo apt update
207+
- sudo apt install -y tree
196208

197209
######################
198210
# x86_64 linux centos7
@@ -202,7 +214,7 @@ build-x86_64-linux-centos7:
202214
extends: .build
203215
before_script:
204216
- sudo yum install -y epel-release
205-
- sudo yum install -y patchelf
217+
- sudo yum install -y patchelf tree
206218
tags:
207219
- x86_64-linux
208220
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-centos7:$DOCKER_REV"
@@ -228,6 +240,8 @@ test-x86_64-linux-centos7:
228240
tags:
229241
- x86_64-linux
230242
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-centos7:$DOCKER_REV"
243+
before_script:
244+
- sudo yum install -y tree
231245

232246
######################
233247
# x86_64 linux fedora27
@@ -236,7 +250,7 @@ test-x86_64-linux-centos7:
236250
build-x86_64-linux-fedora27:
237251
extends: .build
238252
before_script:
239-
- sudo dnf install -y patchelf
253+
- sudo dnf install -y patchelf tree
240254
tags:
241255
- x86_64-linux
242256
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora27:$DOCKER_REV"
@@ -262,6 +276,8 @@ test-x86_64-linux-fedora27:
262276
tags:
263277
- x86_64-linux
264278
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora27:$DOCKER_REV"
279+
before_script:
280+
- sudo dnf install -y tree
265281

266282

267283
######################
@@ -274,7 +290,7 @@ build-x86_64-linux-alpine:
274290
- x86_64-linux
275291
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV"
276292
before_script:
277-
- sudo apk add --no-cache tar zlib zlib-dev zlib-static bzip2 bzip2-dev bzip2-static gmp gmp-dev xz xz-dev ncurses-static patchelf findutils
293+
- sudo apk add --no-cache tar zlib zlib-dev zlib-static bzip2 bzip2-dev bzip2-static gmp gmp-dev xz xz-dev ncurses-static patchelf findutils tree
278294
variables:
279295
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
280296

@@ -300,7 +316,7 @@ test-x86_64-linux-alpine:
300316
- x86_64-linux
301317
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV"
302318
before_script:
303-
- sudo apk add --no-cache tar zlib zlib-dev zlib-static bzip2 bzip2-dev bzip2-static gmp gmp-dev xz xz-dev ncurses-static
319+
- sudo apk add --no-cache tar zlib zlib-dev zlib-static bzip2 bzip2-dev bzip2-static gmp gmp-dev xz xz-dev ncurses-static tree
304320

305321

306322
######################
@@ -310,7 +326,8 @@ test-x86_64-linux-alpine:
310326
build-x86_64-freebsd12:
311327
extends: .build
312328
before_script:
313-
- sudo pkg install --yes patchelf gmake
329+
- sudo pkg update
330+
- sudo pkg install --yes patchelf gmake tree binutils
314331
tags:
315332
- x86_64-freebsd12
316333
variables:
@@ -334,7 +351,8 @@ test-x86_64-freebsd12:
334351
tags:
335352
- x86_64-freebsd12
336353
before_script:
337-
- sudo pkg install --yes patchelf gmake
354+
- sudo pkg update
355+
- sudo pkg install --yes patchelf gmake tree binutils
338356

339357

340358
######################
@@ -347,7 +365,7 @@ build-x86_64-freebsd13:
347365
- x86_64-freebsd13
348366
before_script:
349367
- sudo pkg update
350-
- sudo pkg install --yes compat12x-amd64 patchelf gmake
368+
- sudo pkg install --yes compat12x-amd64 patchelf gmake tree binutils
351369
- sudo ln -s libncurses.so.6 /usr/local/lib/libncurses.so.6.2
352370
variables:
353371
ADD_CABAL_ARGS: "--enable-split-sections -j1"
@@ -371,7 +389,7 @@ test-x86_64-freebsd13:
371389
- x86_64-freebsd13
372390
before_script:
373391
- sudo pkg update
374-
- sudo pkg install --yes compat12x-amd64 gmake
392+
- sudo pkg install --yes compat12x-amd64 gmake tree binutils
375393
- sudo ln -s libncurses.so.6 /usr/local/lib/libncurses.so.6.2
376394

377395

@@ -386,21 +404,7 @@ build-x86_64-darwin:
386404
variables:
387405
ADD_CABAL_ARGS: ""
388406
before_script:
389-
# Install brew locally in the project dir. Packages will also be installed here.
390-
- '[ -e "$CI_PROJECT_DIR/.brew" ] || git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew'
391-
- export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
392-
393-
# make sure to not pollute the machine with temp files etc
394-
- mkdir -p $CI_PROJECT_DIR/.brew_cache
395-
- export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
396-
- mkdir -p $CI_PROJECT_DIR/.brew_logs
397-
- export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
398-
- mkdir -p /private/tmp/.brew_tmp
399-
- export HOMEBREW_TEMP=/private/tmp/.brew_tmp
400-
401-
# update and install packages
402-
- brew update
403-
- brew install autoconf automake coreutils make
407+
- /bin/bash ./.gitlab/brew.sh autoconf automake coreutils make tree
404408
script: |
405409
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
406410
/bin/bash ./.gitlab/ci.sh
@@ -414,21 +418,7 @@ tar-x86_64-darwin:
414418
tags:
415419
- x86_64-darwin
416420
before_script:
417-
# Install brew locally in the project dir. Packages will also be installed here.
418-
- '[ -e "$CI_PROJECT_DIR/.brew" ] || git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew'
419-
- export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
420-
421-
# make sure to not pollute the machine with temp files etc
422-
- mkdir -p $CI_PROJECT_DIR/.brew_cache
423-
- export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
424-
- mkdir -p $CI_PROJECT_DIR/.brew_logs
425-
- export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
426-
- mkdir -p /private/tmp/.brew_tmp
427-
- export HOMEBREW_TEMP=/private/tmp/.brew_tmp
428-
429-
# update and install packages
430-
- brew update
431-
- brew install autoconf automake coreutils make
421+
- /bin/bash ./.gitlab/brew.sh autoconf automake coreutils make tree
432422
script: |
433423
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
434424
/bin/bash ./.gitlab/tar.sh
@@ -443,6 +433,13 @@ test-x86_64-darwin:
443433
needs: ["tar-x86_64-darwin"]
444434
tags:
445435
- x86_64-darwin
436+
before_script:
437+
- /bin/bash ./.gitlab/brew.sh make tree
438+
script: |
439+
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
440+
/bin/bash .gitlab/test.sh
441+
after_script:
442+
- rm -Rf /private/tmp/.brew_tmp
446443

447444

448445
######################
@@ -455,25 +452,8 @@ build-aarch64-darwin:
455452
tags:
456453
- aarch64-darwin-m1
457454
before_script:
458-
# Install brew locally in the project dir. Packages will also be installed here.
459-
- '[ -e "$CI_PROJECT_DIR/.brew" ] || git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew'
460-
- export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
461-
462-
# otherwise we seem to get intel binaries
463455
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
464-
465-
# make sure to not pollute the machine with temp files etc
466-
- mkdir -p $CI_PROJECT_DIR/.brew_cache
467-
- export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
468-
- mkdir -p $CI_PROJECT_DIR/.brew_logs
469-
- export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
470-
- mkdir -p /private/tmp/.brew_tmp
471-
- export HOMEBREW_TEMP=/private/tmp/.brew_tmp
472-
473-
# update and install packages
474-
- brew update
475-
- brew install llvm
476-
- brew install autoconf automake coreutils make
456+
- arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
477457
script: |
478458
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
479459
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
@@ -506,32 +486,10 @@ test-aarch64-darwin:
506486
tags:
507487
- aarch64-darwin-m1
508488
before_script:
509-
# Install brew locally in the project dir. Packages will also be installed here.
510-
- '[ -e "$CI_PROJECT_DIR/.brew" ] || git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew'
511-
- export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
512-
513-
# otherwise we seem to get intel binaries
514489
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
515-
516-
# make sure to not pollute the machine with temp files etc
517-
- mkdir -p $CI_PROJECT_DIR/.brew_cache
518-
- export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
519-
- mkdir -p $CI_PROJECT_DIR/.brew_logs
520-
- export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
521-
- mkdir -p /private/tmp/.brew_tmp
522-
- export HOMEBREW_TEMP=/private/tmp/.brew_tmp
523-
524-
# update and install packages
525-
- brew update
526-
- brew install llvm
527-
- brew install autoconf automake coreutils
490+
- arch -arm64 /bin/bash ./.gitlab/brew.sh make tree
528491
script: |
529492
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
530-
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
531-
export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
532-
export LD=ld
533-
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
534-
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
535493
arch -arm64 /bin/bash ./.gitlab/test.sh
536494
after_script:
537495
- rm -Rf /private/tmp/.brew_tmp

.gitlab/brew.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -Eeuxo pipefail
4+
5+
# Install brew locally in the project dir. Packages will also be installed here.
6+
[ -e "$CI_PROJECT_DIR/.brew" ] || git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew
7+
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
8+
9+
# make sure to not pollute the machine with temp files etc
10+
mkdir -p $CI_PROJECT_DIR/.brew_cache
11+
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
12+
mkdir -p $CI_PROJECT_DIR/.brew_logs
13+
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
14+
mkdir -p /private/tmp/.brew_tmp
15+
export HOMEBREW_TEMP=/private/tmp/.brew_tmp
16+
17+
# update and install packages
18+
brew update
19+
brew install ${1+"$@"}

.gitlab/test.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,34 @@ case "$(uname -s)" in
4545
;;
4646
esac
4747

48-
cd "$CI_PROJECT_DIR/out/"
48+
# make sure out/ dir is gone, so build host rpaths don't
49+
# kick in (TODO: we should probably remove those)
50+
mv "$CI_PROJECT_DIR/out"/*.tar.xz .
51+
rm -rf "$CI_PROJECT_DIR/out/"
4952

53+
# cleanup from previous dirty runs
54+
rm -rf "$HOME"/.local/lib/haskell-language-server-* || true
55+
56+
# install
5057
tar xf *.tar.xz
5158
rm *.tar.xz
5259
cd haskell-language-server-*
53-
emake PREFIX=$HOME/.local
54-
export PATH="$HOME/.local/bin:$PATH"
60+
INSTALL_DIR=$(dirname "${GHCUP_BINDIR}") || exit 1
61+
[ -d "$INSTALL_DIR" ] || exit 1
62+
emake PREFIX="${INSTALL_DIR}" install
63+
64+
# print rpaths and libdirs
65+
case "$(uname -s)" in
66+
"Darwin"|"darwin")
67+
otool -l "$INSTALL_DIR"/lib/haskell-language-server-*/bin/haskell-language-server-*
68+
;;
69+
*)
70+
objdump -x "$INSTALL_DIR"/lib/haskell-language-server-*/bin/haskell-language-server-*
71+
;;
72+
esac
73+
tree "$INSTALL_DIR"/lib/haskell-language-server-*
74+
tree "$INSTALL_DIR"/bin
75+
5576
tmp_dir=$(mktempdir)
5677
cd "$tmp_dir"
5778
cabal unpack bytestring-0.11.1.0

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ bindist-ghc:
8888
$(SED) \
8989
-e "s/@@EXE_NAME@@/haskell-language-server-$(GHC_VERSION)/" \
9090
-e "s/@@GHC_VERSION@@/$(GHC_VERSION)/" \
91-
-e "s/@@ABI_HASHES@@/$(shell for dep in `ghc-pkg-$(GHC_VERSION) --global list --simple-output` ; do ghc-pkg-$(GHC_VERSION) field $$dep abi --simple-output ; done | tr '\n' ' ' | xargs)/" \
91+
-e "s/@@ABI_HASHES@@/$(shell for dep in `ghc-pkg-$(GHC_VERSION) --global list --simple-output` ; do printf "%s:" "$$dep" && ghc-pkg-$(GHC_VERSION) field $$dep abi --simple-output ; done | tr '\n' ' ' | xargs)/" \
9292
bindist/wrapper.in > "$(BINDIST_OUT_DIR)/haskell-language-server-$(GHC_VERSION).in"
9393
$(CHMOD_X) "$(BINDIST_OUT_DIR)/haskell-language-server-$(GHC_VERSION).in"
9494
$(INSTALL_D) "$(BINDIST_OUT_DIR)/bin/"

bindist/wrapper.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ check_ghc() {
5656
return 1
5757
fi
5858
PKGCONF="${check_ghc_libdir}/package.conf.d"
59-
MY_ABI_HASHES="$(for dep in $("${GHC_PKG}" --global --global-package-db "$PKGCONF" list --simple-output) ; do "${GHC_PKG}" --global --global-package-db "$PKGCONF" field "${dep}" abi --simple-output ; done | tr '\n' ' ' | xargs)"
59+
MY_ABI_HASHES="$(for dep in $("${GHC_PKG}" --global --global-package-db "$PKGCONF" list --simple-output) ; do printf "%s:" "${dep}" && "${GHC_PKG}" --global --global-package-db "$PKGCONF" field "${dep}" abi --simple-output ; done | tr '\n' ' ' | xargs)"
6060
if [ "${ABI_HASHES}" != "${MY_ABI_HASHES}" ] ; then
6161
err_abi "${MY_ABI_HASHES}"
6262
return 3

0 commit comments

Comments
 (0)