From 10d2f8bda868d863a9ca4e06eae2bd6004d8f067 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 18 Sep 2022 12:53:49 +0800 Subject: [PATCH 01/18] Add ubuntu builds to gitlab CI Fixes #3169 --- .gitlab-ci.yml | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73a9d50c18..3f7fd25bc3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,6 +75,16 @@ workflow: - x86_64-linux image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" +.x86_64-linux-ubuntu18.04: + tags: + - x86_64-linux + image: "ubuntu:18.04" + +.x86_64-linux-ubuntu20.04: + tags: + - x86_64-linux + image: "ubuntu:20.04" + .x86_64-linux-centos7: tags: - x86_64-linux @@ -163,6 +173,84 @@ test-armv7-linux-deb10: - sudo apt install -y tree +########################### +# x86_64 linux ubuntu18.04 +########################### + +build-x86_64-linux-ubuntu18.04: + extends: + - .build + - .x86_64-linux-ubuntu18.04 + before_script: + - apt update + - apt install -y build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 zlib1g-dev patchelf tree + variables: + ADD_CABAL_ARGS: "--enable-split-sections" + +tar-x86_64-linux-ubuntu18.04: + extends: + - .artifacts + - .x86_64-linux-ubuntu18.04 + stage: tar + needs: ["build-x86_64-linux-ubuntu18.04"] + script: + - ./.gitlab/tar.sh + variables: + TARBALL_ARCHIVE_SUFFIX: x86_64-ubuntu18.04-linux + TARBALL_EXT: tar.xz + before_script: + - apt update + - apt install -y make tar xz-utils curl + +test-x86_64-linux-ubuntu18.04: + extends: + - .test + - .x86_64-linux-ubuntu18.04 + needs: ["tar-x86_64-linux-ubuntu18.04"] + before_script: + - apt update + - apt install -y tree patchelf make curl build-essential + + +########################### +# x86_64 linux ubuntu20.04 +########################### + +build-x86_64-linux-ubuntu20.04: + extends: + - .build + - .x86_64-linux-ubuntu20.04 + before_script: + - apt update + - apt install -y build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 zlib1g-dev patchelf tree + variables: + ADD_CABAL_ARGS: "--enable-split-sections" + +tar-x86_64-linux-ubuntu20.04: + extends: + - .artifacts + - .x86_64-linux-ubuntu20.04 + stage: tar + needs: ["build-x86_64-linux-ubuntu20.04"] + script: + - ./.gitlab/tar.sh + variables: + TARBALL_ARCHIVE_SUFFIX: x86_64-ubuntu20.04-linux + TARBALL_EXT: tar.xz + before_script: + - apt update + - apt install -y make tar xz-utils curl + +test-x86_64-linux-ubuntu20.04: + extends: + - .test + - .x86_64-linux-ubuntu20.04 + needs: ["tar-x86_64-linux-ubuntu20.04"] + before_script: + - apt update + - apt install -y tree patchelf make curl build-essential + + ###################### # x86_64 linux deb10 ###################### From 1cfd8f1ddde28b88bcc08b6a4ae8be82b4e27565 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Tue, 8 Nov 2022 11:56:48 +0530 Subject: [PATCH 02/18] Run pipelines from web interface --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f7fd25bc3..90880ebbb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,6 +30,8 @@ workflow: rules: - if: $CI_COMMIT_TAG when: always + - if: $CI_PIPELINE_SOURCE == "web" + when: always - when: never .artifacts: From fefec70335e1d0f604a77f3aa64c01fac8212f98 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Tue, 8 Nov 2022 11:57:18 +0530 Subject: [PATCH 03/18] Use nix for darwin --- .gitlab-ci.yml | 26 +---- .gitlab/brew.sh | 19 ---- .gitlab/ci.sh | 106 ++++++++++--------- .gitlab/darwin/nix/sources.json | 26 +++++ .gitlab/darwin/nix/sources.nix | 174 ++++++++++++++++++++++++++++++++ .gitlab/darwin/toolchain.nix | 36 +++++++ .gitlab/tar.sh | 1 + .gitlab/test.sh | 1 + 8 files changed, 299 insertions(+), 90 deletions(-) delete mode 100644 .gitlab/brew.sh create mode 100644 .gitlab/darwin/nix/sources.json create mode 100644 .gitlab/darwin/nix/sources.nix create mode 100644 .gitlab/darwin/toolchain.nix diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90880ebbb1..ba40cb6fc8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -511,10 +511,8 @@ build-x86_64-darwin: - x86_64-darwin variables: ADD_CABAL_ARGS: "" - before_script: - - /bin/bash ./.gitlab/brew.sh autoconf automake coreutils make tree + NIX_SYSTEM: x86_64-darwin script: | - export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" /bin/bash ./.gitlab/ci.sh after_script: - rm -Rf /private/tmp/.brew_tmp @@ -525,26 +523,21 @@ tar-x86_64-darwin: needs: ["build-x86_64-darwin"] tags: - x86_64-darwin - before_script: - - /bin/bash ./.gitlab/brew.sh autoconf automake coreutils make tree script: | - export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" /bin/bash ./.gitlab/tar.sh after_script: - rm -Rf /private/tmp/.brew_tmp variables: TARBALL_ARCHIVE_SUFFIX: x86_64-apple-darwin TARBALL_EXT: tar.xz + NIX_SYSTEM: x86_64-darwin test-x86_64-darwin: extends: .test needs: ["tar-x86_64-darwin"] tags: - x86_64-darwin - before_script: - - /bin/bash ./.gitlab/brew.sh make tree script: | - export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" /bin/bash .gitlab/test.sh after_script: - rm -Rf /private/tmp/.brew_tmp @@ -559,22 +552,14 @@ build-aarch64-darwin: stage: build tags: - aarch64-darwin-m1 - before_script: - - export HOMEBREW_CHANGE_ARCH_TO_ARM=1 - - arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree script: | - 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 arch -arm64 /bin/bash ./.gitlab/ci.sh after_script: - rm -Rf /private/tmp/.brew_tmp variables: MACOSX_DEPLOYMENT_TARGET: "10.7" ADD_CABAL_ARGS: "" + NIX_SYSTEM: aarch64-darwin tar-aarch64-darwin: extends: .artifacts @@ -587,17 +572,14 @@ tar-aarch64-darwin: variables: TARBALL_ARCHIVE_SUFFIX: aarch64-apple-darwin TARBALL_EXT: tar.xz + NIX_SYSTEM: aarch64-darwin test-aarch64-darwin: extends: .test needs: ["tar-aarch64-darwin"] tags: - aarch64-darwin-m1 - before_script: - - export HOMEBREW_CHANGE_ARCH_TO_ARM=1 - - arch -arm64 /bin/bash ./.gitlab/brew.sh make tree script: | - export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" arch -arm64 /bin/bash ./.gitlab/test.sh after_script: - rm -Rf /private/tmp/.brew_tmp diff --git a/.gitlab/brew.sh b/.gitlab/brew.sh deleted file mode 100644 index de769632e6..0000000000 --- a/.gitlab/brew.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuxo pipefail - -# Install brew locally in the project dir. Packages will also be installed here. -[ -e "$CI_PROJECT_DIR/.brew" ] || 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" - -# 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 /private/tmp/.brew_tmp -export HOMEBREW_TEMP=/private/tmp/.brew_tmp - -# update and install packages -brew update -brew install ${1+"$@"} diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 751b09c7ea..2dc951d6d9 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -3,6 +3,7 @@ set -Eeuxo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" +source "$CI_PROJECT_DIR/.gitlab/setup.sh" export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR/toolchain" export CABAL_DIR="$CI_PROJECT_DIR/cabal" @@ -11,12 +12,12 @@ EXE_EXTENSION="" case "$(uname)" in MSYS_*|MINGW*) export CABAL_DIR="$(cygpath -w "$CABAL_DIR")" - GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin" - EXE_EXTENSION=".exe" + GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin" + EXE_EXTENSION=".exe" + ;; + *) + GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin" ;; - *) - GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin" - ;; esac mkdir -p "$CABAL_DIR" @@ -32,59 +33,66 @@ export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes # for some reason the subshell doesn't pick up the arm64 environment on darwin # and starts installing x86_64 GHC case "$(uname -s)" in - "Darwin"|"darwin") - case "$(/usr/bin/arch)" in - aarch64|arm64|armv8l) - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash - ;; - *) - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - ;; - esac - ;; - *) - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - ;; + "Darwin"|"darwin") + nix build -f $CI_PROJECT_DIR/.gitlab/darwin/toolchain.nix --argstr system "$NIX_SYSTEM" -o toolchain.sh + cat toolchain.sh + source toolchain.sh + # Precautious since we want to use ghc from ghcup + unset MACOSX_DEPLOYMENT_TARGET + unset GHC + case "$(/usr/bin/arch)" in + aarch64|arm64|armv8l) + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash + export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi" + ;; + *) + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh + ;; + esac + ;; + *) + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh + ;; esac case "$(uname)" in MSYS_*|MINGW*) - # workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/21196 - # export PATH="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin:${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/usr/bin:$PATH" - # ls ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin - # cp ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin/libgcc_s_seh-1.dll ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/bin - # cp ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin/libwinpthread-1.dll ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/bin - ghc --info - # Shorten binary names - sed -i.bak -e 's/haskell-language-server/hls/g' \ - -e 's/haskell_language_server/hls/g' \ - haskell-language-server.cabal $CABAL_PROJECT - sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ - src/**/*.hs exe/*.hs + # workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/21196 + # export PATH="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin:${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/usr/bin:$PATH" + # ls ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin + # cp ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin/libgcc_s_seh-1.dll ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/bin + # cp ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/mingw/bin/libwinpthread-1.dll ${GHCUP_INSTALL_BASE_PREFIX}/ghcup/ghc/${GHC_VERSION}/bin + ghc --info + # Shorten binary names + sed -i.bak -e 's/haskell-language-server/hls/g' \ + -e 's/haskell_language_server/hls/g' \ + haskell-language-server.cabal $CABAL_PROJECT + sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ + src/**/*.hs exe/*.hs - args=( - -O2 - -w "ghc-$GHC_VERSION" - --project-file "$CABAL_PROJECT" - --disable-profiling - --disable-tests - --enable-executable-stripping - ${ADD_CABAL_ARGS} - ) + args=( + -O2 + -w "ghc-$GHC_VERSION" + --project-file "$CABAL_PROJECT" + --disable-profiling + --disable-tests + --enable-executable-stripping + ${ADD_CABAL_ARGS} + ) - run cabal v2-build ${args[@]} exe:hls exe:hls-wrapper + run cabal v2-build ${args[@]} exe:hls exe:hls-wrapper - mkdir "$CI_PROJECT_DIR/out" + mkdir "$CI_PROJECT_DIR/out" - cp "$(cabal list-bin -v0 ${args[@]} exe:hls)" "$CI_PROJECT_DIR/out/haskell-language-server-${GHC_VERSION}"$EXE_EXTENSION - cp "$(cabal list-bin -v0 ${args[@]} exe:hls-wrapper)" "$CI_PROJECT_DIR/out/haskell-language-server-wrapper"$EXE_EXTENSION + cp "$(cabal list-bin -v0 ${args[@]} exe:hls)" "$CI_PROJECT_DIR/out/haskell-language-server-${GHC_VERSION}"$EXE_EXTENSION + cp "$(cabal list-bin -v0 ${args[@]} exe:hls-wrapper)" "$CI_PROJECT_DIR/out/haskell-language-server-wrapper"$EXE_EXTENSION ;; - *) - sed -i.bak -e '/DELETE MARKER FOR CI/,/END DELETE/d' cabal.project # see comment in cabal.project - emake --version - emake GHCUP=ghcup hls - emake GHCUP=ghcup bindist - rm -rf out/*.*.* + *) + sed -i.bak -e '/DELETE MARKER FOR CI/,/END DELETE/d' cabal.project # see comment in cabal.project + emake --version + emake GHCUP=ghcup hls + emake GHCUP=ghcup bindist + rm -rf out/*.*.* ;; esac diff --git a/.gitlab/darwin/nix/sources.json b/.gitlab/darwin/nix/sources.json new file mode 100644 index 0000000000..a6ff5dc415 --- /dev/null +++ b/.gitlab/darwin/nix/sources.json @@ -0,0 +1,26 @@ +{ + "niv": { + "branch": "master", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "nmattia", + "repo": "niv", + "rev": "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070", + "sha256": "1pq9nh1d8nn3xvbdny8fafzw87mj7gsmp6pxkdl65w2g18rmcmzx", + "type": "tarball", + "url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "wip/ghc-8.10.7-darwin", + "description": "Nix Packages collection", + "homepage": "", + "owner": "bgamari", + "repo": "nixpkgs", + "rev": "37c60356e3f83c708a78a96fdd914b5ffc1f551c", + "sha256": "0i5j7nwk4ky0fg4agla3aznadpxz0jyrdwp2q92hyxidra987syn", + "type": "tarball", + "url": "https://github.com/bgamari/nixpkgs/archive/37c60356e3f83c708a78a96fdd914b5ffc1f551c.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/.gitlab/darwin/nix/sources.nix b/.gitlab/darwin/nix/sources.nix new file mode 100644 index 0000000000..1938409ddd --- /dev/null +++ b/.gitlab/darwin/nix/sources.nix @@ -0,0 +1,174 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + + fetch_tarball = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + + fetch_git = name: spec: + let + ref = + if spec ? ref then spec.ref else + if spec ? branch then "refs/heads/${spec.branch}" else + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + in + builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + + fetch_local = spec: spec.path; + + fetch_builtin-tarball = name: throw + ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; + + fetch_builtin-url = name: throw + ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; + + # + # Various helpers + # + + # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 + sanitizeName = name: + ( + concatMapStrings (s: if builtins.isList s then "-" else s) + ( + builtins.split "[^[:alnum:]+._?=-]+" + ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) + ) + ); + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: system: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs name spec + else if spec.type == "tarball" then fetch_tarball pkgs name spec + else if spec.type == "git" then fetch_git name spec + else if spec.type == "local" then fetch_local spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball name + else if spec.type == "builtin-url" then fetch_builtin-url name + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # If the environment variable NIV_OVERRIDE_${name} is set, then use + # the path directly as opposed to the fetched source. + replace = name: drv: + let + saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; + in + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatMapStrings = f: list: concatStrings (map f list); + concatStrings = builtins.concatStringsSep ""; + + # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 + optionalAttrs = cond: as: if cond then as else {}; + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs ( + name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null + , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , system ? builtins.currentSystem + , pkgs ? mkPkgs sources system + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; + +in +mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/.gitlab/darwin/toolchain.nix b/.gitlab/darwin/toolchain.nix new file mode 100644 index 0000000000..68e0f68809 --- /dev/null +++ b/.gitlab/darwin/toolchain.nix @@ -0,0 +1,36 @@ +{ system }: + +let + sources = import ./nix/sources.nix; + nixpkgsSrc = sources.nixpkgs; + pkgs = import nixpkgsSrc { inherit system; }; +in + +let + hsPkgs = pkgs.haskellPackages; + alex = hsPkgs.alex; + happy = hsPkgs.happy; + targetTriple = pkgs.stdenv.targetPlatform.config; + + llvm = pkgs.llvm_11; +in +pkgs.writeTextFile { + name = "toolchain"; + text = '' + export PATH + PATH="${pkgs.autoconf}/bin:$PATH" + PATH="${pkgs.automake}/bin:$PATH" + PATH="${pkgs.tree}/bin:$PATH" + PATH="${pkgs.tar}/bin:$PATH" + export FONTCONFIG_FILE=${fonts} + export HAPPY="${happy}/bin/happy" + export ALEX="${alex}/bin/alex" + export LLC="${llvm}/bin/llc" + export OPT="${llvm}/bin/opt" + export SPHINXBUILD="${pkgs.python3Packages.sphinx}/bin/sphinx-build" + export CABAL_INSTALL="${pkgs.cabal-install}/bin/cabal" + export CABAL="$CABAL_INSTALL" + + sdk_path="$(xcrun --sdk macosx --show-sdk-path)" + ''; +} diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index 7e6754fad3..b62cef29d2 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -3,6 +3,7 @@ set -Eeuxo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" +source "$CI_PROJECT_DIR/.gitlab/setup.sh" ls -la out/ diff --git a/.gitlab/test.sh b/.gitlab/test.sh index 6c6ef0a51f..3c866c4983 100644 --- a/.gitlab/test.sh +++ b/.gitlab/test.sh @@ -3,6 +3,7 @@ set -Eeuxo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" +source "$CI_PROJECT_DIR/.gitlab/setup.sh" export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR/toolchain" export CABAL_DIR="$CI_PROJECT_DIR/cabal" From eddb6e5b5e4dbdc5b1bf8af9a35d9c66a025f019 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Tue, 8 Nov 2022 12:08:49 +0530 Subject: [PATCH 04/18] Drop 9.2.3 and add 9.4.3 --- .gitlab/darwin/toolchain.nix | 2 -- .gitlab/setup.sh | 11 +++++++++++ bindist/ghcs | 3 +-- bindist/ghcs-Msys | 3 +-- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .gitlab/setup.sh diff --git a/.gitlab/darwin/toolchain.nix b/.gitlab/darwin/toolchain.nix index 68e0f68809..2c65f92b3c 100644 --- a/.gitlab/darwin/toolchain.nix +++ b/.gitlab/darwin/toolchain.nix @@ -21,8 +21,6 @@ pkgs.writeTextFile { PATH="${pkgs.autoconf}/bin:$PATH" PATH="${pkgs.automake}/bin:$PATH" PATH="${pkgs.tree}/bin:$PATH" - PATH="${pkgs.tar}/bin:$PATH" - export FONTCONFIG_FILE=${fonts} export HAPPY="${happy}/bin/happy" export ALEX="${alex}/bin/alex" export LLC="${llvm}/bin/llc" diff --git a/.gitlab/setup.sh b/.gitlab/setup.sh new file mode 100644 index 0000000000..ec4402edc4 --- /dev/null +++ b/.gitlab/setup.sh @@ -0,0 +1,11 @@ +case "$(uname -s)" in + "Darwin"|"darwin") + nix build -f $CI_PROJECT_DIR/.gitlab/darwin/toolchain.nix --argstr system "$NIX_SYSTEM" -o toolchain.sh + cat toolchain.sh + source toolchain.sh + unset MACOSX_DEPLOYMENT_TARGET + # Precautious since we want to use ghc from ghcup + unset GHC + ;; +esac + diff --git a/bindist/ghcs b/bindist/ghcs index 17e3ffea1c..2a8c8dcac7 100644 --- a/bindist/ghcs +++ b/bindist/ghcs @@ -1,6 +1,5 @@ 8.10.7,cabal.project 9.0.2,cabal.project -9.2.3,cabal.project 9.2.4,cabal.project -9.4.1,cabal.project 9.4.2,cabal.project +9.4.3,cabal.project diff --git a/bindist/ghcs-Msys b/bindist/ghcs-Msys index 17e3ffea1c..2a8c8dcac7 100644 --- a/bindist/ghcs-Msys +++ b/bindist/ghcs-Msys @@ -1,6 +1,5 @@ 8.10.7,cabal.project 9.0.2,cabal.project -9.2.3,cabal.project 9.2.4,cabal.project -9.4.1,cabal.project 9.4.2,cabal.project +9.4.3,cabal.project From 0cba379b0213203a804ddc6c781272d835a6637a Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Tue, 8 Nov 2022 12:36:55 +0530 Subject: [PATCH 05/18] Build in parallel --- .gitlab-ci.yml | 20 ++++---------------- .gitlab/ci.sh | 11 +++-------- .gitlab/tar.sh | 1 + GNUmakefile | 20 +++----------------- bindist/ghcs | 5 ----- bindist/ghcs-FreeBSD | 2 -- bindist/ghcs-Msys | 5 ----- 7 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 bindist/ghcs delete mode 100644 bindist/ghcs-FreeBSD delete mode 100644 bindist/ghcs-Msys diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba40cb6fc8..6af390018b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,20 +11,18 @@ variables: CABAL_INSTALL_VERSION: 3.8.1.0 -.windows_matrix: &windows_matrix +.matrix: &matrix matrix: - GHC_VERSION: 8.10.7 CABAL_PROJECT: cabal.project - GHC_VERSION: 9.0.2 CABAL_PROJECT: cabal.project - - GHC_VERSION: 9.2.3 - CABAL_PROJECT: cabal.project - GHC_VERSION: 9.2.4 CABAL_PROJECT: cabal.project - - GHC_VERSION: 9.4.1 - CABAL_PROJECT: cabal.project - GHC_VERSION: 9.4.2 CABAL_PROJECT: cabal.project + - GHC_VERSION: 9.4.3 + CABAL_PROJECT: cabal.project workflow: rules: @@ -49,6 +47,7 @@ workflow: .build: extends: .artifacts:short stage: build + parallel: *matrix script: - bash .gitlab/ci.sh @@ -514,8 +513,6 @@ build-x86_64-darwin: NIX_SYSTEM: x86_64-darwin script: | /bin/bash ./.gitlab/ci.sh - after_script: - - rm -Rf /private/tmp/.brew_tmp tar-x86_64-darwin: extends: .artifacts @@ -525,8 +522,6 @@ tar-x86_64-darwin: - x86_64-darwin script: | /bin/bash ./.gitlab/tar.sh - after_script: - - rm -Rf /private/tmp/.brew_tmp variables: TARBALL_ARCHIVE_SUFFIX: x86_64-apple-darwin TARBALL_EXT: tar.xz @@ -539,8 +534,6 @@ test-x86_64-darwin: - x86_64-darwin script: | /bin/bash .gitlab/test.sh - after_script: - - rm -Rf /private/tmp/.brew_tmp ###################### @@ -554,8 +547,6 @@ build-aarch64-darwin: - aarch64-darwin-m1 script: | arch -arm64 /bin/bash ./.gitlab/ci.sh - after_script: - - rm -Rf /private/tmp/.brew_tmp variables: MACOSX_DEPLOYMENT_TARGET: "10.7" ADD_CABAL_ARGS: "" @@ -581,8 +572,6 @@ test-aarch64-darwin: - aarch64-darwin-m1 script: | arch -arm64 /bin/bash ./.gitlab/test.sh - after_script: - - rm -Rf /private/tmp/.brew_tmp ###################### @@ -593,7 +582,6 @@ build-x86_64-windows: extends: .build tags: - new-x86_64-windows - parallel: *windows_matrix script: - $env:CHERE_INVOKING = "yes" - bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh" diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 2dc951d6d9..0d784e6464 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -28,18 +28,13 @@ export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 export BOOTSTRAP_HASKELL_GHC_VERSION="${GHC_VERSION:-recommended}" export BOOTSTRAP_HASKELL_CABAL_VERSION="$CABAL_INSTALL_VERSION" export BOOTSTRAP_HASKELL_VERBOSE=1 +export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes # for some reason the subshell doesn't pick up the arm64 environment on darwin # and starts installing x86_64 GHC case "$(uname -s)" in "Darwin"|"darwin") - nix build -f $CI_PROJECT_DIR/.gitlab/darwin/toolchain.nix --argstr system "$NIX_SYSTEM" -o toolchain.sh - cat toolchain.sh - source toolchain.sh - # Precautious since we want to use ghc from ghcup - unset MACOSX_DEPLOYMENT_TARGET - unset GHC case "$(/usr/bin/arch)" in aarch64|arm64|armv8l) curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash @@ -90,8 +85,8 @@ case "$(uname)" in *) sed -i.bak -e '/DELETE MARKER FOR CI/,/END DELETE/d' cabal.project # see comment in cabal.project emake --version - emake GHCUP=ghcup hls - emake GHCUP=ghcup bindist + emake GHCUP=ghcup hls-ghc + emake GHCUP=ghcup bindist-ghc rm -rf out/*.*.* ;; esac diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index b62cef29d2..e46fcd860f 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -19,6 +19,7 @@ case "${TARBALL_EXT}" in tar.xz) emake --version HLS_VERSION="$(emake -s -C out/bindist/haskell-language-server-* version)" + emake TARBALL="${TARBALL_PREFIX}-${HLS_VERSION}-${TARBALL_ARCHIVE_SUFFIX}.tar.xz" bindist emake TARBALL="${TARBALL_PREFIX}-${HLS_VERSION}-${TARBALL_ARCHIVE_SUFFIX}.tar.xz" bindist-tar rm -rf out/bindist ;; diff --git a/GNUmakefile b/GNUmakefile index f26c9b4b20..a1fafcad30 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -65,29 +65,15 @@ define set_rpath $(if $(filter Darwin,$(UNAME)), $(INSTALL_NAME_TOOL) -add_rpath "@executable_path/$(1)" "$(2)", $(PATCHELF) --force-rpath --set-rpath "\$$ORIGIN/$(1)" "$(2)") endef -hls: bindist/ghcs - for ghc in $(shell [ -e "bindist/ghcs-`uname -o`" ] && cat "bindist/ghcs-`uname -o`" || cat "bindist/ghcs") ; do \ - $(GHCUP) -v install ghc `echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` && \ - $(GHCUP) -v gc -p -s -c && \ - $(MAKE) GHC_VERSION=`echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` PROJECT_FILE=`echo $$ghc | $(AWK) -F ',' '{ print $$2 }'` hls-ghc && \ - $(GHCUP) -v rm ghc `echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` ; \ - done - hls-ghc: $(MKDIR_P) out/ @if test -z "$(GHC_VERSION)" ; then echo >&2 "GHC_VERSION is not set" ; false ; fi - @if test -z "$(PROJECT_FILE)" ; then echo >&2 "PROJECT_FILE is not set" ; false ; fi - $(CABAL_INSTALL) --project-file="$(PROJECT_FILE)" -w "ghc-$(GHC_VERSION)" $(CABAL_INSTALL_ARGS) --installdir="$(ROOT_DIR)/out/$(GHC_VERSION)" exe:haskell-language-server exe:haskell-language-server-wrapper + @if test -z "$(CABAL_PROJECT)" ; then echo >&2 "CABAL_PROJECT is not set" ; false ; fi + $(CABAL_INSTALL) --project-file="$(CABAL_PROJECT)" -w "ghc-$(GHC_VERSION)" $(CABAL_INSTALL_ARGS) --installdir="$(ROOT_DIR)/out/$(GHC_VERSION)" exe:haskell-language-server exe:haskell-language-server-wrapper $(STRIP_S) "$(ROOT_DIR)/out/$(GHC_VERSION)/haskell-language-server" $(STRIP_S) "$(ROOT_DIR)/out/$(GHC_VERSION)/haskell-language-server-wrapper" bindist: - for ghc in $(shell [ -e "bindist/ghcs-`uname`" ] && cat "bindist/ghcs-`uname`" || cat "bindist/ghcs") ; do \ - $(GHCUP) -v install ghc `echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` && \ - $(GHCUP) -v gc -p -s -c && \ - $(MAKE) GHC_VERSION=`echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` bindist-ghc && \ - $(GHCUP) -v rm ghc `echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` ; \ - done $(SED) -e "s/@@HLS_VERSION@@/$(HLS_VERSION)/" \ bindist/GNUmakefile.in > "$(BINDIST_OUT_DIR)/GNUmakefile" $(INSTALL_D) "$(BINDIST_OUT_DIR)/scripts/" @@ -125,4 +111,4 @@ clean: clean-all: $(RM_RF) out/* $(STORE_DIR) -.PHONY: hls hls-ghc bindist bindist-ghc bindist-tar clean clean-all install-ghcs +.PHONY: hls-ghc bindist bindist-ghc bindist-tar clean clean-all install-ghcs diff --git a/bindist/ghcs b/bindist/ghcs deleted file mode 100644 index 2a8c8dcac7..0000000000 --- a/bindist/ghcs +++ /dev/null @@ -1,5 +0,0 @@ -8.10.7,cabal.project -9.0.2,cabal.project -9.2.4,cabal.project -9.4.2,cabal.project -9.4.3,cabal.project diff --git a/bindist/ghcs-FreeBSD b/bindist/ghcs-FreeBSD deleted file mode 100644 index a1b4b6e0bf..0000000000 --- a/bindist/ghcs-FreeBSD +++ /dev/null @@ -1,2 +0,0 @@ -8.10.7,cabal.project -9.0.2,cabal.project diff --git a/bindist/ghcs-Msys b/bindist/ghcs-Msys deleted file mode 100644 index 2a8c8dcac7..0000000000 --- a/bindist/ghcs-Msys +++ /dev/null @@ -1,5 +0,0 @@ -8.10.7,cabal.project -9.0.2,cabal.project -9.2.4,cabal.project -9.4.2,cabal.project -9.4.3,cabal.project From bf2a068731a0c0ac74767344f1eadfb45d4f1c12 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 16:06:18 +0530 Subject: [PATCH 06/18] Add 9.2.5 --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6af390018b..eedfdd600b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,8 @@ variables: CABAL_PROJECT: cabal.project - GHC_VERSION: 9.2.4 CABAL_PROJECT: cabal.project + - GHC_VERSION: 9.2.5 + CABAL_PROJECT: cabal.project - GHC_VERSION: 9.4.2 CABAL_PROJECT: cabal.project - GHC_VERSION: 9.4.3 From eda30cef1140296901c99fac239c50be19d82558 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 16:12:45 +0530 Subject: [PATCH 07/18] fixes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eedfdd600b..c1f088f797 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -543,7 +543,7 @@ test-x86_64-darwin: ###################### build-aarch64-darwin: - extends: .artifacts:short + extends: .build stage: build tags: - aarch64-darwin-m1 From a4afd18107de0945fc081ffa24eab5d10f05b924 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 16:15:58 +0530 Subject: [PATCH 08/18] Fix x86_64-darwin --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1f088f797..1723a9ff64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -509,7 +509,7 @@ test-x86_64-freebsd13: build-x86_64-darwin: extends: .build tags: - - x86_64-darwin + - x86_64-darwin-m1 variables: ADD_CABAL_ARGS: "" NIX_SYSTEM: x86_64-darwin @@ -521,7 +521,7 @@ tar-x86_64-darwin: stage: tar needs: ["build-x86_64-darwin"] tags: - - x86_64-darwin + - x86_64-darwin-m1 script: | /bin/bash ./.gitlab/tar.sh variables: @@ -533,7 +533,7 @@ test-x86_64-darwin: extends: .test needs: ["tar-x86_64-darwin"] tags: - - x86_64-darwin + - x86_64-darwin-m1 script: | /bin/bash .gitlab/test.sh From 9f0936d5c4750ee9524dc1031a2f41309f4d7f39 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 16:30:49 +0530 Subject: [PATCH 09/18] Drop 9.4.3 (ghc-exactprint) --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1723a9ff64..e67e7d3282 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,8 +23,6 @@ variables: CABAL_PROJECT: cabal.project - GHC_VERSION: 9.4.2 CABAL_PROJECT: cabal.project - - GHC_VERSION: 9.4.3 - CABAL_PROJECT: cabal.project workflow: rules: From c4ffd03d0c322c0be950c07a293af76c9fd8fab7 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 16:32:33 +0530 Subject: [PATCH 10/18] Revert "Drop 9.4.3 (ghc-exactprint)" This reverts commit 9f0936d5c4750ee9524dc1031a2f41309f4d7f39. --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e67e7d3282..1723a9ff64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,8 @@ variables: CABAL_PROJECT: cabal.project - GHC_VERSION: 9.4.2 CABAL_PROJECT: cabal.project + - GHC_VERSION: 9.4.3 + CABAL_PROJECT: cabal.project workflow: rules: From fa17d0234c2f00bc4083e969e2450f02b1ac2ad7 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 16:33:16 +0530 Subject: [PATCH 11/18] Bump index state to allow 9.4.3 --- cabal.project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 4950a95f3a..795a7e8fab 100644 --- a/cabal.project +++ b/cabal.project @@ -48,7 +48,7 @@ package * write-ghc-environment-files: never -index-state: 2022-10-07T12:19:15Z +index-state: 2022-11-09T12:19:15Z constraints: -- For GHC 9.4, older versions of entropy fail to build on Windows From cea78af2279229b9ec27446ee6c40e1f27cb98e3 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 17:22:05 +0530 Subject: [PATCH 12/18] debug --- .gitlab/tar.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index e46fcd860f..e5dfd9b183 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -5,7 +5,10 @@ set -Eeuxo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" source "$CI_PROJECT_DIR/.gitlab/setup.sh" +ls ls -la out/ +ls -la out/bindist/ +cat GNUmakefile # create tarball/zip TARBALL_PREFIX="haskell-language-server" From 3ef96d81a31050629d810ca6e191d67aa15b1f37 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 18:09:57 +0530 Subject: [PATCH 13/18] fixes --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index a1fafcad30..716ad9ec97 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -111,4 +111,4 @@ clean: clean-all: $(RM_RF) out/* $(STORE_DIR) -.PHONY: hls-ghc bindist bindist-ghc bindist-tar clean clean-all install-ghcs +.PHONY: hls-ghc bindist bindist-ghc bindist-tar clean clean-all install-ghcs version From eaae78e8261f09327c87258a917f3a557d894ba3 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 19:18:17 +0530 Subject: [PATCH 14/18] fixes --- .gitlab/tar.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index e5dfd9b183..ed6da7d7e5 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -11,7 +11,6 @@ ls -la out/bindist/ cat GNUmakefile # create tarball/zip -TARBALL_PREFIX="haskell-language-server" case "${TARBALL_EXT}" in zip) HLS_VERSION="$("$CI_PROJECT_DIR/out/haskell-language-server-8.10.7" --numeric-version)" @@ -21,9 +20,8 @@ case "${TARBALL_EXT}" in ;; tar.xz) emake --version - HLS_VERSION="$(emake -s -C out/bindist/haskell-language-server-* version)" - emake TARBALL="${TARBALL_PREFIX}-${HLS_VERSION}-${TARBALL_ARCHIVE_SUFFIX}.tar.xz" bindist - emake TARBALL="${TARBALL_PREFIX}-${HLS_VERSION}-${TARBALL_ARCHIVE_SUFFIX}.tar.xz" bindist-tar + emake bindist + emake bindist-tar rm -rf out/bindist ;; *) From 799724dfb67dd31bab36a9993a5cfd2dcf65cad7 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 9 Nov 2022 19:21:16 +0530 Subject: [PATCH 15/18] fixes --- GNUmakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 716ad9ec97..3fc906f335 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,9 +11,10 @@ UNAME := $(shell uname) ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) GHC_VERSION ?= +TARBALL_ARCHIVE_SUFFIX ?= HLS_VERSION := $(shell grep '^version:' haskell-language-server.cabal | awk '{ print $$2 }') -TARBALL ?= haskell-language-server-$(HLS_VERSION).tar.xz +TARBALL ?= haskell-language-server-$(HLS_VERSION)-$(TARBALL_ARCHIVE_SUFFIX).tar.xz CHMOD := chmod CHMOD_X := $(CHMOD) 755 From 864e6ca1126e48818d0f3cd97a26bf5a6dd3dffb Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Thu, 10 Nov 2022 15:45:02 +0530 Subject: [PATCH 16/18] fixes --- .gitlab-ci.yml | 4 ++++ .gitlab/tar.sh | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1723a9ff64..acbcf1a98b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -536,6 +536,8 @@ test-x86_64-darwin: - x86_64-darwin-m1 script: | /bin/bash .gitlab/test.sh + variables: + NIX_SYSTEM: aarch64-darwin ###################### @@ -574,6 +576,8 @@ test-aarch64-darwin: - aarch64-darwin-m1 script: | arch -arm64 /bin/bash ./.gitlab/test.sh + variables: + NIX_SYSTEM: aarch64-darwin ###################### diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index ed6da7d7e5..3397466ba2 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -5,10 +5,6 @@ set -Eeuxo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" source "$CI_PROJECT_DIR/.gitlab/setup.sh" -ls -ls -la out/ -ls -la out/bindist/ -cat GNUmakefile # create tarball/zip case "${TARBALL_EXT}" in @@ -19,6 +15,9 @@ case "${TARBALL_EXT}" in find . -type f ! -name '*.zip' -delete ;; tar.xz) + ls -la out/ + ls -la out/bindist/ + ls -la out/bindist/*/ emake --version emake bindist emake bindist-tar From 07873769e03b5fa7783379a4879cd86942e2a104 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Thu, 10 Nov 2022 18:13:18 +0530 Subject: [PATCH 17/18] fixes --- .gitlab/tar.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index 3397466ba2..65ee943890 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -9,6 +9,7 @@ source "$CI_PROJECT_DIR/.gitlab/setup.sh" # create tarball/zip case "${TARBALL_EXT}" in zip) + TARBALL_PREFIX="haskell-language-server" HLS_VERSION="$("$CI_PROJECT_DIR/out/haskell-language-server-8.10.7" --numeric-version)" cd out/ zip "${TARBALL_PREFIX}-${HLS_VERSION}-${TARBALL_ARCHIVE_SUFFIX}.zip" haskell-language-server-* From 6a8ab4388ce2be029b384ca8132b44fd96c522f4 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Thu, 10 Nov 2022 18:14:48 +0530 Subject: [PATCH 18/18] fixes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acbcf1a98b..7bade64d53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -537,7 +537,7 @@ test-x86_64-darwin: script: | /bin/bash .gitlab/test.sh variables: - NIX_SYSTEM: aarch64-darwin + NIX_SYSTEM: x86_64-darwin ######################