Skip to content

Update nix-tools github action #1846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- master

push:
branches:
- master

defaults:
run:
shell: bash
Expand Down
14 changes: 7 additions & 7 deletions docs/tutorials/development/nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"homepage": "https://input-output-hk.github.io/haskell.nix",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "d20fc9dc2245a5f5d1d3dc898bf41e6f58b7486d",
"sha256": "09qkfbxkrymcsiaydw6iyvpw14y5279863a25m62cxbb44hnqan3",
"rev": "d61a3f429425e57108ca2b5355f10df94dafe39d",
"sha256": "1fra8grb1jzfb794vm9kw090bb5kiq5g11xmb3nkm2lk60yixjx3",
"type": "tarball",
"url": "https://github.com/input-output-hk/haskell.nix/archive/d20fc9dc2245a5f5d1d3dc898bf41e6f58b7486d.tar.gz",
"url": "https://github.com/input-output-hk/haskell.nix/archive/d61a3f429425e57108ca2b5355f10df94dafe39d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-21.05",
"branch": "release-22.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5f244caea76105b63d826911b2a1563d33ff1cdc",
"sha256": "1xlgynfw9svy7nvh9nkxsxdzncv9hg99gbvbwv3gmrhmzc3sar75",
"rev": "b7ce17b1ebf600a72178f6302c77b6382d09323f",
"sha256": "sha256-uNvD7fzO5hNlltNQUAFBPlcEjNG5Gkbhl/ROiX+GZU4=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5f244caea76105b63d826911b2a1563d33ff1cdc.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/b7ce17b1ebf600a72178f6302c77b6382d09323f.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
6 changes: 3 additions & 3 deletions docs/tutorials/getting-started/nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "https://input-output-hk.github.io/haskell.nix",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "d20fc9dc2245a5f5d1d3dc898bf41e6f58b7486d",
"sha256": "09qkfbxkrymcsiaydw6iyvpw14y5279863a25m62cxbb44hnqan3",
"rev": "d61a3f429425e57108ca2b5355f10df94dafe39d",
"sha256": "1fra8grb1jzfb794vm9kw090bb5kiq5g11xmb3nkm2lk60yixjx3",
"type": "tarball",
"url": "https://github.com/input-output-hk/haskell.nix/archive/d20fc9dc2245a5f5d1d3dc898bf41e6f58b7486d.tar.gz",
"url": "https://github.com/input-output-hk/haskell.nix/archive/d61a3f429425e57108ca2b5355f10df94dafe39d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
Expand Down
4 changes: 2 additions & 2 deletions modules/hackage-quirks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ in [
}
constraints: hls-fourmolu-plugin <1.1.1.0, hls-rename-plugin <1.0.2.0, hls-stan-plugin <1.0.1.0
''
# TODO Remove this flag once the hls-haddock-comments-plugin is updated in hackage to work with ghc 9.2
# TODO Remove this flag once the hls-call-hierarchy-plugin is updated in hackage to work with ghc 9.2
+ lib.optionalString (__elem config.compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926"]) ''
package haskell-language-server
flags: -haddockcomments
flags: -callhierarchy
'');
}
)
Expand Down
28 changes: 0 additions & 28 deletions nix-tools/.buildkite/fixed.nix

This file was deleted.

38 changes: 23 additions & 15 deletions nix-tools/.buildkite/nix-tools-build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#! /usr/bin/env nix-shell
#! nix-shell -I "nixpkgs=channel:nixos-21.11" --pure -i bash -p nixUnstable cabal-install ghc git nix-prefetch-git cacert
#! nix-shell -I "nixpkgs=channel:nixos-22.11" -i bash -p nixUnstable cabal-install ghc git nix-prefetch-git cacert

export NIX_PATH="nixpkgs=channel:nixos-21.11"
# The `nix-shell` is set to run without `--pure`.
# It is possible to use `--pure` if we need to, but it requires setting these.
# export LANG=en_US.UTF-8
# export LC_ALL=en_US.UTF-8
# export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive

export NIX_PATH="nixpkgs=channel:nixos-22.11"
index_state="2020-01-10T00:00:00Z"
expected_hash="0z2jc4fibfxz88pfgjq3wk5j3v7sn34xkwb8h60hbwfwhhy63vx6"

Expand All @@ -11,17 +17,16 @@ set -euo pipefail
# https://github.com/input-output-hk/haskell.nix/issues/57
rm -f .nix-tools.cache

echo "+++ Cabal configure"
echo "+++ Cabal update"
cabal new-update
cabal new-configure

echo
echo "+++ Run stable version of plan-to-nix"
echo "+++ Run stable version of make-install-plan and plan-to-nix"
nix build --impure --expr '(let haskellNix = import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}; in (import haskellNix.sources.nixpkgs haskellNix.nixpkgsArgs).haskell-nix.nix-tools.ghc8107)' -o nt
./nt/bin/make-install-plan
rm -rf .buildkite/nix1
./nt/bin/plan-to-nix --output .buildkite/nix1 --plan-json dist-newstyle/cache/plan.json

# Replace currently broken plan-to-nix output
cp .buildkite/fixed.nix .buildkite/nix1/default.nix
mv dist-newstyle/cabal-files .buildkite/nix1/cabal-files

echo
echo "+++ Build project"
Expand All @@ -34,23 +39,26 @@ echo "There are no tests -- https://github.com/input-output-hk/haskell.nix/issue
echo
echo "+++ Add runtime dependencies to PATH"

nix build -f channel:nixos-20.03 nix-prefetch-scripts -o nix-prefetch-scripts
nix build -f channel:nixos-20.03 git -o git
nix build -f channel:nixos-22.11 nix-prefetch-scripts -o nix-prefetch-scripts
nix build -f channel:nixos-22.11 git -o git
export PATH="$PWD/nix-prefetch-scripts/bin:$PWD/git/bin:$PATH"

echo
echo "+++ Run plan-to-nix again"
echo "+++ Run make-install-plan and plan-to-nix again"

# This file can interfere with the build.
# https://github.com/input-output-hk/haskell.nix/issues/57
rm -f .nix-tools.cache

rm -rf dist-newstyle

nix build -f .buildkite/nix1 nix-tools.components.exes.make-install-plan
./result/bin/make-install-plan

nix build -f .buildkite/nix1 nix-tools.components.exes.plan-to-nix
rm -rf .buildkite/nix2
./result/bin/plan-to-nix --output .buildkite/nix2 --plan-json dist-newstyle/cache/plan.json

# Add module needed to allow Cabal 3.2 to be installed
sed -i -e 's|modules = \[\]|modules = \[{ nonReinstallablePkgs = \[ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base" "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" "ghcjs-prim" "ghcjs-th" "ghc-boot" "ghc" "Win32" "array" "binary" "bytestring" "containers" "directory" "filepath" "ghc-boot" "ghc-compact" "ghc-prim" "hpc" "mtl" "parsec" "process" "text" "time" "transformers" "unix" "xhtml" "stm" "terminfo" \]; }\]|' \
.buildkite/nix2/default.nix
mv dist-newstyle/cabal-files .buildkite/nix2/cabal-files

echo
echo "+++ Build project"
Expand Down
2 changes: 1 addition & 1 deletion nix-tools/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ index-state: 2022-11-06T00:00:00Z

packages: .

allow-newer: hackage-db:Cabal, hpack:Cabal
allow-newer: hackage-db:Cabal, hpack:Cabal, hnix:aeson, hnix:relude

source-repository-package
type: git
Expand Down
4 changes: 2 additions & 2 deletions nix-tools/nix-tools.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ library
, Stack2nix.External.Resolve
, Stack2nix.Project
, Stack2nix.Stack
build-depends: base >= 4 && <4.15
build-depends: base >= 4 && <4.16
, Cabal >= 3.8 && <3.9
, Cabal-syntax >= 3.8 && <3.9
, aeson >= 2.0 && <2.1
, aeson >= 2.0 && <2.2
, aeson-pretty
, base16-bytestring
, bytestring
Expand Down
1 change: 1 addition & 0 deletions test/sublib-docs/sublib-docs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cabal-version: 2.2
-- init'. For further documentation, see
-- http://haskell.org/cabal/users-guide/


name: sublib-docs
version: 0.1.0.0
-- synopsis:
Expand Down
2 changes: 1 addition & 1 deletion test/tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash jq nix gnused
#! nix-shell -I "nixpkgs=channel:nixos-22.11" -i bash -p bash jq nix gnused

set -euo pipefail

Expand Down