Skip to content

Commit

Permalink
Bump GHC / Nix (#4)
Browse files Browse the repository at this point in the history
* WIP

* Fix Diagnose errors

* Bump GHC version in GH actions
  • Loading branch information
danieljharvey authored Jul 3, 2024
1 parent 1e7ecd0 commit 6570f36
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: mrkkrp/ormolu-action@v11
- uses: haskell-actions/run-ormolu@v14
with:
pattern: |
llvm-calc/**/*.hs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/llvm-calc-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.6.2'
ghc-version: '9.6.3'
cabal-version: '3.10.1.0'

- name: Test llvm-calc
Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ packages:
llvm-calc4/llvm-calc4.cabal,
vendored/**/*.cabal

with-compiler: ghc-9.6.2
with-compiler: ghc-9.6.3

package diagnose
flags: +megaparsec-compat
Expand Down
251 changes: 0 additions & 251 deletions cabal.project.freeze

This file was deleted.

12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 5 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,10 @@
let
pkgs = nixpkgs.legacyPackages.${system};

oldCompilerVersion = "ghc945";

# we are going to build ormolu and hlint with an old ghc that isn't
# broken
oldHaskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
"${oldCompilerVersion}" =
pkgs.haskell.packages."${oldCompilerVersion}".override {
overrides = self: super: {
# On aarch64-darwin, this creates a cycle for some reason; didn't look too much into it.
ghcid = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.ghcid (drv: { enableSeparateBinOutput = false; }));
# has wrong version of unix-compat, so we ignore it
shelly = pkgs.haskell.lib.doJailbreak super.shelly;
};

};
};
};

oldHaskellPackages = haskell.packages.${oldCompilerVersion};

# current compiler version, ideally, we'll put everything here
# eventually

compilerVersion = "ghc962";
compilerVersion = "ghc963";

# fix things
haskell = pkgs.haskell // {
Expand Down Expand Up @@ -72,9 +51,10 @@

devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
oldHaskellPackages.hlint
oldHaskellPackages.ormolu
ghcid
# hlint
# ormolu
# haskell-language-server # this simply does nothing atm
# ghcid
cabal-fmt
cabal-install
ghc
Expand Down
5 changes: 2 additions & 3 deletions llvm-calc/src/Calc/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ repl = do
Left bundle -> do
Diag.printDiagnostic
Diag.stderr
True
True
4
Diag.WithUnicode
(Diag.TabSize 4)
Diag.defaultStyle
(fromErrorBundle bundle input)
loop
Expand Down
5 changes: 2 additions & 3 deletions llvm-calc2/src/Calc/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ printDiagnostic :: (MonadIO m) => Diag.Diagnostic Text -> m ()
printDiagnostic =
Diag.printDiagnostic
Diag.stderr
True
True
4
Diag.WithUnicode
(Diag.TabSize 4)
Diag.defaultStyle

-- | turn Megaparsec error + input into a Diagnostic
Expand Down
2 changes: 1 addition & 1 deletion llvm-calc2/src/Calc/Typecheck/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typeErrorDiagnostic ::
Diag.Diagnostic Text
typeErrorDiagnostic input e =
let filename = "<repl>"
diag = Diag.addFile Diag.def filename (T.unpack input)
diag = Diag.addFile mempty filename (T.unpack input)
report = case e of
(PredicateIsNotBoolean _ foundType) ->
Diag.Err
Expand Down
Loading

0 comments on commit 6570f36

Please sign in to comment.