From 00f2181ae9b55e91b166366e886ec45fdc140cb8 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 24 Jan 2022 22:40:22 +0100 Subject: [PATCH 1/6] Remove unused nix config --- .gitlab/shell-aarch64-darwin.nix | 90 -------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 .gitlab/shell-aarch64-darwin.nix diff --git a/.gitlab/shell-aarch64-darwin.nix b/.gitlab/shell-aarch64-darwin.nix deleted file mode 100644 index 33c7c67bee..0000000000 --- a/.gitlab/shell-aarch64-darwin.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ system ? "aarch64-darwin" -#, nixpkgs ? fetchTarball https://github.com/angerman/nixpkgs/archive/257cb120334.tar.gz #apple-silicon.tar.gz -, pkgs ? import { 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 ]); -} From efc4609d2d1c9c91c7e7d3969a1e33b8eb8a8e09 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 24 Jan 2022 22:43:11 +0100 Subject: [PATCH 2/6] Add ghc-9.2.1 to gitlab build --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29fece07f5..82f9faea6f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,8 @@ variables: CABAL_PROJECT: cabal.project - GHC_VERSION: 9.0.2 CABAL_PROJECT: cabal-ghc90.project + - GHC_VERSION: 9.2.1 + CABAL_PROJECT: cabal-ghc921.project .m1_matrix: &m1_matrix matrix: From 83f6772e7c5a7773af6300600112bdbc3be68253 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 24 Jan 2022 22:44:15 +0100 Subject: [PATCH 3/6] Remove not needed alpine workaround --- .gitlab/ci.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 26ab30c85e..88c85e536a 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -45,11 +45,6 @@ case "$(uname -s)" in ;; esac -# some alpines need workaround -if ghc --info | grep -q integer-simple ; then - echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local -fi - # Shorten binary names sed -i.bak -e 's/haskell-language-server/hls/g' \ -e 's/haskell_language_server/hls/g' \ @@ -58,9 +53,9 @@ sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ src/**/*.hs exe/*.hs args=( - -O2 + -O2 -w "ghc-$GHC_VERSION" - --project-file "$CABAL_PROJECT" + --project-file "$CABAL_PROJECT" --disable-profiling --disable-tests --enable-executable-stripping From 0e8604df5dbf91a48bc664d656df29ca9d5d39b5 Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 25 Jan 2022 13:24:36 +0100 Subject: [PATCH 4/6] Use -j1 to fix oom in bsd-12 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82f9faea6f..0b026b0056 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,7 +152,7 @@ build-x86_64-freebsd12: - x86_64-freebsd12 parallel: *default_matrix variables: - ADD_CABAL_ARGS: "--enable-split-sections" + ADD_CABAL_ARGS: "--enable-split-sections -j1" tar-x86_64-freebsd12: extends: .artifacts From 4fd647c5bc57519556a16ac5787312d8e59b8d22 Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 25 Jan 2022 13:26:57 +0100 Subject: [PATCH 5/6] Use -j1 to try fix oom in bsd-13 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b026b0056..692c88fc80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -176,7 +176,7 @@ build-x86_64-freebsd13: - sudo pkg install --yes compat12x-amd64 - sudo ln -s libncurses.so.6 /usr/local/lib/libncurses.so.6.2 variables: - ADD_CABAL_ARGS: "--enable-split-sections" + ADD_CABAL_ARGS: "--enable-split-sections -j1" tar-x86_64-freebsd13: extends: .artifacts From 317d36005e754f67bff723dc3cfcf573c887dc6c Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 25 Jan 2022 20:43:26 +0100 Subject: [PATCH 6/6] exclude 9.2.1 for freebsd --- .gitlab-ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 692c88fc80..e93f32b716 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,16 @@ variables: - GHC_VERSION: 9.2.1 CABAL_PROJECT: cabal-ghc921.project +# ghc-9.2.1 is broken for bsd +.freebsd_matrix: &freebsd_matrix + matrix: + - GHC_VERSION: 8.8.4 + CABAL_PROJECT: cabal.project + - GHC_VERSION: 8.10.7 + CABAL_PROJECT: cabal.project + - GHC_VERSION: 9.0.2 + CABAL_PROJECT: cabal-ghc90.project + .m1_matrix: &m1_matrix matrix: - GHC_VERSION: 8.10.7 @@ -150,7 +160,7 @@ build-x86_64-freebsd12: extends: .build tags: - x86_64-freebsd12 - parallel: *default_matrix + parallel: *freebsd_matrix variables: ADD_CABAL_ARGS: "--enable-split-sections -j1" @@ -170,7 +180,7 @@ build-x86_64-freebsd13: extends: .build tags: - x86_64-freebsd13 - parallel: *default_matrix + parallel: *freebsd_matrix before_script: - sudo pkg update - sudo pkg install --yes compat12x-amd64