-
Notifications
You must be signed in to change notification settings - Fork 45
Flakify the development shell #507
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| { | ||
| description = "Linear-base"; | ||
|
|
||
| inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
| inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
|
||
| outputs = { self, nixpkgs, flake-utils }: | ||
| flake-utils.lib.eachDefaultSystem (system: | ||
| let | ||
| pkgs = import nixpkgs { inherit system; inherit overlays; }; | ||
|
|
||
| # need to match Stackage LTS version from stack.yaml snapshot | ||
| stack-ghc-version = "ghc9103"; | ||
|
|
||
| # Versions used by CI's Cabal-based matrix | ||
| ci-ghc-versions = ["96" "98" "910" "912"]; | ||
|
|
||
| cabal-docspec = import ./nix/cabal-docspec.nix { inherit pkgs; }; | ||
|
|
||
| buildTools = ghc-ver: | ||
| let hask = pkgs.haskell.packages."${ghc-ver}"; in | ||
| [ | ||
| hask.ghc | ||
| pkgs.cabal-install | ||
| stack-wrapped | ||
| cabal-docspec | ||
| pkgs.ormolu # Haskell formatter | ||
| ]; | ||
|
|
||
| devTools = ghc-ver: | ||
| let hask = pkgs.haskell.packages."${ghc-ver}"; in | ||
| [ | ||
| hask.ghcid # Continuous terminal Haskell compile checker | ||
| hask.haskell-language-server # LSP server for editor | ||
| ]; | ||
|
aspiwack marked this conversation as resolved.
|
||
|
|
||
| mkCIShellFor = ghc-ver: pkgs.mkShell { | ||
| # Set UTF-8 local so that run-tests can parse GHC's unicode output. | ||
| LANG="C.UTF-8"; | ||
|
|
||
| buildInputs = buildTools "${ghc-ver}"; | ||
| }; | ||
|
|
||
| ci-shells = builtins.listToAttrs (map (ver: | ||
|
aspiwack marked this conversation as resolved.
|
||
| { name = "ci-${ver}"; value = mkCIShellFor "ghc${ver}"; } | ||
| ) ci-ghc-versions); | ||
|
|
||
| mkDevShellFor = ghc-ver: pkgs.mkShell { | ||
| # Set UTF-8 local so that run-tests can parse GHC's unicode output. | ||
| LANG="C.UTF-8"; | ||
|
|
||
| buildInputs = buildTools "${ghc-ver}" ++ devTools "${ghc-ver}"; | ||
|
|
||
| }; | ||
|
|
||
| cabal-dev-shells = builtins.listToAttrs (map (ver: | ||
| { name = "dev-${ver}"; value = mkDevShellFor "ghc${ver}"; } | ||
| ) ci-ghc-versions); | ||
|
|
||
| # See https://docs.haskellstack.org/en/stable/topics/nix_integration/ | ||
| stack-wrapped = pkgs.symlinkJoin { | ||
| name = "stack"; # will be available as the usual `stack` in terminal | ||
| paths = [ pkgs.stack ]; | ||
| buildInputs = [ pkgs.makeWrapper ]; | ||
| postBuild = '' | ||
| wrapProgram $out/bin/stack \ | ||
| --add-flags "\ | ||
| --no-nix \ | ||
| --system-ghc \ | ||
| --no-install-ghc \ | ||
| " | ||
| ''; | ||
| }; | ||
|
|
||
| overlays = [ | ||
| ]; | ||
|
|
||
| in { | ||
|
|
||
| devShells = ci-shells // cabal-dev-shells // { | ||
| default = mkDevShellFor stack-ghc-version; | ||
|
|
||
| ci-stack = mkCIShellFor stack-ghc-version;}; | ||
| } | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,10 @@ | ||
| #!/usr/bin/env bash | ||
| # Format linear-base using the version of Ormolu specified in stack.yaml. | ||
| # Format linear-base using the version of Ormolu from the PATH. It's recommended | ||
| # using the version provided by `flake.nix`, since it's the one used by the CI | ||
| # to enforce formatting. | ||
|
|
||
| set -e | ||
|
|
||
| export LANG="C.UTF-8" | ||
|
|
||
| stack build ormolu | ||
| ## We can't format cabal at the moment because `cabal format` inlines | ||
| ## common stanzas, which is very much something that we don't want. See | ||
| ## https://github.com/haskell/cabal/issues/5734 | ||
| # | ||
| # cabal format | ||
| stack exec ormolu -- -m inplace $(find . -type f -name "*.hs-boot" -o -name "*.hs") | ||
| ormolu -m inplace $(find . -type f -name "*.hs-boot" -o -name "*.hs") | ||
|
aspiwack marked this conversation as resolved.
|
||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.