From 301c88ad016422ba51bea9d2246133d520184163 Mon Sep 17 00:00:00 2001 From: Magnus Viernickel Date: Wed, 29 May 2024 14:49:12 +0200 Subject: [PATCH] [chore] compatibility with ghc ghc 9.6 --- .github/workflows/test-flake.yml | 3 +- flake.lock | 102 +++++++---------------- flake.nix | 9 +- src/TransitiveAnns/Plugin/Annotations.hs | 2 +- 4 files changed, 41 insertions(+), 75 deletions(-) diff --git a/.github/workflows/test-flake.yml b/.github/workflows/test-flake.yml index fcc5e57..ca82e63 100644 --- a/.github/workflows/test-flake.yml +++ b/.github/workflows/test-flake.yml @@ -8,9 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v22 + - uses: cachix/install-nix-action@v27 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - run: nix flake check -Lv --allow-import-from-derivation --fallback --accept-flake-config - run: nix build .#transitive-anns -Lv --fallback --accept-flake-config + - run: nix build .#ghc94-transitive-anns -Lv --fallback --accept-flake-config - run: nix build .#ghc92-transitive-anns -Lv --fallback --accept-flake-config diff --git a/flake.lock b/flake.lock index 3eff135..db9e22a 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -16,24 +16,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -42,11 +24,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -57,11 +39,11 @@ }, "haskell-flake": { "locked": { - "lastModified": 1698070134, - "narHash": "sha256-wJq3FmAcZ09FbkghNynvujhmxTAXHJLNWwX9G5oYi8M=", + "lastModified": 1716841745, + "narHash": "sha256-opRlnyY/f041VPH4MxgUwq5bl821LbN5ugKMSlh8smc=", "owner": "srid", "repo": "haskell-flake", - "rev": "f1380932a7b6ec360020acb87dd39331ebabb04c", + "rev": "5a86b9d5a1ad01e46d44af5fdaea59555b1199ca", "type": "github" }, "original": { @@ -72,11 +54,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697915759, - "narHash": "sha256-WyMj5jGcecD+KC8gEs+wFth1J1wjisZf8kVZH13f1Zo=", + "lastModified": 1716914467, + "narHash": "sha256-KkT6YM/yNQqirtYj/frn6RRakliB8RDvGqVGGaNhdcU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "51d906d2341c9e866e48c2efcaac0f2d70bfd43e", + "rev": "4a3fc4cf736b7d2d288d7a8bf775ac8d4c0920b4", "type": "github" }, "original": { @@ -88,45 +70,39 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1696019113, - "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", - "type": "github" + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1689261696, - "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { @@ -141,11 +117,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1696343447, - "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", "type": "github" }, "original": { @@ -157,17 +133,16 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1697746376, - "narHash": "sha256-gu77VkgdfaHgNCVufeb6WP9oqFLjwK4jHcoPZmBVF3E=", + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "8cc349bfd082da8782b989cad2158c9ad5bd70fd", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", "type": "github" }, "original": { @@ -183,21 +158,6 @@ "parts": "parts", "pre-commit-hooks": "pre-commit-hooks" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index b5b1874..8af699e 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,6 @@ hlint.enable = true; alejandra.enable = true; - statix.enable = true; deadnix.enable = true; }; }; @@ -38,12 +37,18 @@ devShell.mkShellArgs.shellHook = config.pre-commit.installationScript; }; - haskellProjects.default = { + haskellProjects.ghc94 = { packages = {}; settings = {}; basePackages = pkgs.haskell.packages.ghc94; devShell.mkShellArgs.shellHook = config.pre-commit.installationScript; }; + haskellProjects.default = { + packages = {}; + settings = {}; + basePackages = pkgs.haskellPackages; + devShell.mkShellArgs.shellHook = config.pre-commit.installationScript; + }; }; }; } diff --git a/src/TransitiveAnns/Plugin/Annotations.hs b/src/TransitiveAnns/Plugin/Annotations.hs index 1e7b0ab..970bf0f 100644 --- a/src/TransitiveAnns/Plugin/Annotations.hs +++ b/src/TransitiveAnns/Plugin/Annotations.hs @@ -27,7 +27,7 @@ import qualified TransitiveAnns.Types as TA ------------------------------------------------------------------------------ -- | Get the name and set of referenced variables for a binding. hsBinds :: HsBindLR GhcTc GhcTc -> Maybe (Var, Set Var) -hsBinds (FunBind _ (L _ gl) mg _) = Just (gl, getVars mg) +hsBinds FunBind {fun_id = (L _ gl), fun_matches = mg} = Just (gl, getVars mg) hsBinds PatBind{} = Nothing hsBinds VarBind{} = Nothing #if MIN_VERSION_GLASGOW_HASKELL(9,4,0,0)