diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index a84d394c0a..13abf8bdf7 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -269,7 +269,6 @@ let inherit compiler-nix-name; name = "hadrian"; compilerSelection = p: p.haskell.compiler; - index-state = buildPackages.haskell-nix.internalHackageIndexState; evalPackages = hadrianEvalPackages; modules = [{ reinstallableLibGhc = false; diff --git a/lib/call-cabal-project-to-nix.nix b/lib/call-cabal-project-to-nix.nix index 5d013827da..03c6cad9ad 100644 --- a/lib/call-cabal-project-to-nix.nix +++ b/lib/call-cabal-project-to-nix.nix @@ -151,7 +151,7 @@ in let let suitable-index-states = builtins.filter - (s: s >= index-state-max) # This compare is why we need zulu time + (s: s > index-state-max) # This compare is why we need zulu time (builtins.attrNames index-state-hashes); in if builtins.length suitable-index-states == 0 @@ -518,22 +518,30 @@ let json_cabal_file=$(mktemp) cabal2json $fixed_cabal_file > $json_cabal_file - exposed_modules="$(jq -r '.library."exposed-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file)" - reexported_modules="$(jq -r '.library."reexported-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file | sed 's/.* as //g')" + exposed_modules="$(jq -r '.components.lib."exposed-modules"//[]|.[]|select(type=="string")' $json_cabal_file)" + reexported_modules="$(jq -r '.components.lib."reexported-modules"//[]|.[]|select(type=="string")' $json_cabal_file | sed 's/.* as //g')" # FIXME This is a bandaid. Rather than doing this, conditionals should be interpreted. ${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isGhcjs '' - exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.arch == "javascript")|.then[]' $json_cabal_file)" + exposed_modules+=" $(jq -r '.components.lib."exposed-modules"//[]|.[]|select(type=="object" and ._if.arch == "javascript")|._then[]' $json_cabal_file)" ''} ${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isWindows '' - exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.os == "windows")|.then[]' $json_cabal_file)" + exposed_modules+=" $(jq -r '.components.lib."exposed-modules"//[]|.[]|select(type=="object" and ._if.os == "windows")|._then[]' $json_cabal_file)" ''} ${pkgs.lib.optionalString (!pkgs.stdenv.targetPlatform.isWindows) '' - exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.not.os == "windows")|.then[]' $json_cabal_file)" + exposed_modules+=" $(jq -r '.components.lib."exposed-modules"//[]|.[]|select(type=="object" and ._if.not.os == "windows")|._then[]' $json_cabal_file)" ''} EXPOSED_MODULES_${varname name}="$(tr '\n' ' ' <<< "$exposed_modules $reexported_modules")" - DEPS_${varname name}="$(jq -r '.library."build-depends"[]|select(type=="array")[],select(type=="object" and .if.not.flag != "vendor-filepath").then[]' $json_cabal_file | sed 's/^\([A-Za-z0-9-]*\).*$/\1/g' | sort -u | tr '\n' ' ')" + deps="$(jq -r '.components.lib."build-depends"[]|select(.package)|.package' $json_cabal_file)" + deps+=" $(jq -r '.components.lib."build-depends"[]|select((.if.flag or ._if.not.flag) and ._if.not.flag != "vendor-filepath")._then[]|.package' $json_cabal_file)" + ${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isWindows '' + deps+=" $(jq -r '.components.lib."build-depends"[]|select(._if.os == "windows")|._then[]|.package' $json_cabal_file)" + ''} + ${pkgs.lib.optionalString (!pkgs.stdenv.targetPlatform.isWindows) '' + deps+=" $(jq -r '.components.lib."build-depends"[]|select(._if.not.os == "windows")|._then[]|.package' $json_cabal_file)" + ''} + DEPS_${varname name}="$(tr '\n' ' ' <<< "$deps")" VER_${varname name}="$(jq -r '.version' $json_cabal_file)" PKGS+=" ${name}" LAST_PKG="${name}" diff --git a/nix-tools-static.nix b/nix-tools-static.nix index 9ab307a25f..a158cdae53 100644 --- a/nix-tools-static.nix +++ b/nix-tools-static.nix @@ -1,22 +1,22 @@ -pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.2.6/"; in { +pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.3.1/"; in { aarch64-darwin = pkgs.fetchurl { name = "aarch64-darwin-nix-tools-static"; url = "${baseurl}aarch64-darwin-nix-tools-static.zip"; - sha256 = "sha256-9WpTIWlpUvG3pI+tcbAMh6sMH0QO/coZrxDYWD43iq0="; + sha256 = "sha256-t/sxZAl/YH2vgjneIRainKlmYx2w/kXqrKGLwzDcb3Q="; }; x86_64-darwin = pkgs.fetchurl { name = "x86_64-darwin-nix-tools-static"; url = "${baseurl}x86_64-darwin-nix-tools-static.zip"; - sha256 = "sha256-UUr9bo2OpLPsvHRSeO2B6DKVDVTsHepRlTqN6UZoZ2M="; + sha256 = "sha256-SG21YIF9lBX5zCJfK0WsLZrFFjZPVwzD4zl8Je7VSNQ="; }; aarch64-linux = pkgs.fetchurl { name = "aarch64-linux-nix-tools-static"; url = "${baseurl}aarch64-linux-nix-tools-static.zip"; - sha256 = "sha256-96s6RXN8st0JK0eYSOkTJvnlTxYVdE81+ZUGJEsC46A="; + sha256 = "sha256-/AJsmFO3xYi+CBHLXFcj0YdZ9LvPpwPyqo4OYNLsM3s="; }; x86_64-linux = pkgs.fetchurl { name = "x86_64-linux-nix-tools-static"; url = "${baseurl}x86_64-linux-nix-tools-static.zip"; - sha256 = "sha256-LMFVUKNycjVFBb3ChZsPbRNgab50zOHl7nMBrDdeTrQ="; + sha256 = "sha256-SNzh+OYfVZYlgsyifG0ZkxMKh/zJYSrA25I7HFRbKyI="; }; } diff --git a/nix-tools/cabal.project b/nix-tools/cabal.project index 902e02ba31..536360b4e7 100644 --- a/nix-tools/cabal.project +++ b/nix-tools/cabal.project @@ -1,4 +1,8 @@ -index-state: 2024-10-15T20:31:31Z +index-state: 2025-04-12T00:00:00Z + +-- Needed for building aarch64-linux musl version with GHC 9.6 +constraints: containers installed, Cabal >=3.14.1.0 +allow-older: Cabal-syntax-json:base, Cabal-syntax-json:containers packages: nix-tools @@ -36,5 +40,5 @@ source-repository-package source-repository-package type: git location: https://github.com/andreabedini/Cabal-syntax-json.git - tag: b7192832f730d9181a013ef7c77f2ad0b30cca43 - --sha256: sha256-Yw2HQOCmjOvfKHi3xWbSniAZfyrshOvsgmUbqFmDDpU= + tag: b0033ed4d00a09340c64f4290cc649f4009deabd + --sha256: sha256-Aymi25AQLSMextVeXbsMnaOppxAO93qVbwo7Vt44ej4= diff --git a/nix-tools/flake.lock b/nix-tools/flake.lock index 06581f1296..5c98214994 100644 --- a/nix-tools/flake.lock +++ b/nix-tools/flake.lock @@ -120,11 +120,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1729124899, - "narHash": "sha256-cmb4iMcgk5+jUGMiZGNMzPCAnG17Kz9J6WIitYM17Fc=", + "lastModified": 1744676755, + "narHash": "sha256-UxlAdjsE/mDKkONhvkOHeqDlExp6fw757+3iwGeUeFM=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "138edf81c8bcc4209e9706966f7feece70c37a96", + "rev": "a81af937e40034d4c89b80728f937bff6b997121", "type": "github" }, "original": { @@ -133,6 +133,23 @@ "type": "github" } }, + "hackage-for-stackage": { + "flake": false, + "locked": { + "lastModified": 1744676745, + "narHash": "sha256-Wzgh3li2OARjgAwl2P0CmNAsqLJUT1Px4YtYtVRpILc=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "e1d749fd0df3cf34bcb0b5c4958e0f2a715f1e23", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "for-stackage", + "repo": "hackage.nix", + "type": "github" + } + }, "haskellNix": { "inputs": { "HTTP": "HTTP", @@ -143,8 +160,11 @@ "flake-compat": "flake-compat", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", + "hackage-for-stackage": "hackage-for-stackage", + "hls": "hls", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", + "hls-2.10": "hls-2.10", "hls-2.2": "hls-2.2", "hls-2.3": "hls-2.3", "hls-2.4": "hls-2.4", @@ -154,30 +174,25 @@ "hls-2.8": "hls-2.8", "hls-2.9": "hls-2.9", "hpc-coveralls": "hpc-coveralls", - "hydra": "hydra", "iserv-proxy": "iserv-proxy", "nixpkgs": [ "haskellNix", "nixpkgs-unstable" ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-2205": "nixpkgs-2205", - "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", "nixpkgs-2311": "nixpkgs-2311", "nixpkgs-2405": "nixpkgs-2405", + "nixpkgs-2411": "nixpkgs-2411", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1729126246, - "narHash": "sha256-OXGwQF3AMERYaVdImhGLlvJgOE8Zr0yURef4J7zlp6k=", + "lastModified": 1744678331, + "narHash": "sha256-R6Z3kRSRoENSPxJbaZXbHKGhNjH7x6NRppUlpOJxOsE=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "c2070f089bf688571c14af77744982c86f0c2e21", + "rev": "3a97196af86fa053ed267a91234f4e24511c7fd9", "type": "github" }, "original": { @@ -186,6 +201,22 @@ "type": "github" } }, + "hls": { + "flake": false, + "locked": { + "lastModified": 1741604408, + "narHash": "sha256-tuq3+Ip70yu89GswZ7DSINBpwRprnWnl6xDYnS4GOsc=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "682d6894c94087da5e566771f25311c47e145359", + "type": "github" + }, + "original": { + "owner": "haskell", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-1.10": { "flake": false, "locked": { @@ -220,6 +251,23 @@ "type": "github" } }, + "hls-2.10": { + "flake": false, + "locked": { + "lastModified": 1743069404, + "narHash": "sha256-q4kDFyJDDeoGqfEtrZRx4iqMVEC2MOzCToWsFY+TOzY=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "2318c61db3a01e03700bd4b05665662929b7fe8b", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-2.2": { "flake": false, "locked": { @@ -342,11 +390,11 @@ "hls-2.9": { "flake": false, "locked": { - "lastModified": 1720003792, - "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", + "lastModified": 1719993701, + "narHash": "sha256-wy348++MiMm/xwtI9M3vVpqj2qfGgnDcZIGXw8sF1sA=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", + "rev": "90319a7e62ab93ab65a95f8f2bcf537e34dae76a", "type": "github" }, "original": { @@ -372,37 +420,14 @@ "type": "github" } }, - "hydra": { - "inputs": { - "nix": "nix", - "nixpkgs": [ - "haskellNix", - "hydra", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671755331, - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", - "owner": "NixOS", - "repo": "hydra", - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", - "type": "github" - }, - "original": { - "id": "hydra", - "type": "indirect" - } - }, "iserv-proxy": { "flake": false, "locked": { - "lastModified": 1717479972, - "narHash": "sha256-7vE3RQycHI1YT9LHJ1/fUaeln2vIpYm6Mmn8FTpYeVo=", + "lastModified": 1742121966, + "narHash": "sha256-x4bg4OoKAPnayom0nWc0BmlxgRMMHk6lEPvbiyFBq1s=", "owner": "stable-haskell", "repo": "iserv-proxy", - "rev": "2ed34002247213fc435d0062350b91bab920626e", + "rev": "e9dc86ed6ad71f0368c16672081c8f26406c3a7e", "type": "github" }, "original": { @@ -412,139 +437,6 @@ "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1661606874, - "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", - "owner": "NixOS", - "repo": "nix", - "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "2.11.0", - "repo": "nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1657693803, - "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2003": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105": { - "locked": { - "lastModified": 1659914493, - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2111": { - "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2205": { - "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2211": { - "locked": { - "lastModified": 1688392541, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2305": { "locked": { "lastModified": 1705033721, @@ -579,11 +471,11 @@ }, "nixpkgs-2405": { "locked": { - "lastModified": 1726447378, - "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", + "lastModified": 1735564410, + "narHash": "sha256-HB/FA0+1gpSs8+/boEavrGJH+Eq08/R2wWNph1sM1Dg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", + "rev": "1e7a8f391f1a490460760065fa0630b5520f9cf8", "type": "github" }, "original": { @@ -593,29 +485,29 @@ "type": "github" } }, - "nixpkgs-regression": { + "nixpkgs-2411": { "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "lastModified": 1739151041, + "narHash": "sha256-uNszcul7y++oBiyYXjHEDw/AHeLNp8B6pyWOB+RLA/4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "rev": "94792ab2a6beaec81424445bf917ca2556fbeade", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixpkgs-24.11-darwin", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1726583932, - "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", + "lastModified": 1737110817, + "narHash": "sha256-DSenga8XjPaUV5KUFW/i3rNkN7jm9XmguW+qQ1ZJTR4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "658e7223191d2598641d50ee4e898126768fe847", + "rev": "041c867bad68dfe34b78b2813028a2e2ea70a23c", "type": "github" }, "original": { @@ -654,11 +546,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1729039017, - "narHash": "sha256-fGExfgG+7UNSOV8YfOrWPpOHWrCjA02gQkeSBhaAzjQ=", + "lastModified": 1744675976, + "narHash": "sha256-WvQ2HI/OtCNjUO1NE/fEdwCeTwf0rXu25Y6CcUXpo3Y=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "df1d8f0960407551fea7af7af75a9c2f9e18de97", + "rev": "5a0a1124c429fdb16f1cde0f4c85c0ee658b9fba", "type": "github" }, "original": { diff --git a/nix-tools/nix-tools/lib-cabal2nix/Cabal2Nix.hs b/nix-tools/nix-tools/lib-cabal2nix/Cabal2Nix.hs index d35c14b48b..a0156f1df4 100644 --- a/nix-tools/nix-tools/lib-cabal2nix/Cabal2Nix.hs +++ b/nix-tools/nix-tools/lib-cabal2nix/Cabal2Nix.hs @@ -10,7 +10,7 @@ import Distribution.Simple.PackageDescription (readGenericPackageDescription) import Distribution.Verbosity (normal) import Distribution.Pretty ( pretty, prettyShow ) import Distribution.Utils.ShortText (fromShortText) -import Distribution.Utils.Path (getSymbolicPath) +import Distribution.Utils.Path (getSymbolicPath, makeSymbolicPath) import Data.Char (toUpper) import System.FilePath import Data.ByteString (ByteString) @@ -97,7 +97,7 @@ data CabalDetailLevel = MinimalDetails | FullDetails deriving (Show, Eq) cabal2nix :: Bool -> CabalDetailLevel -> Maybe Src -> CabalFile -> IO NExpr cabal2nix isLocal fileDetails src = \case (OnDisk path) -> gpd2nix isLocal fileDetails src Nothing - <$> readGenericPackageDescription normal path + <$> readGenericPackageDescription normal Nothing (makeSymbolicPath path) (InMemory gen _ body) -> gpd2nix isLocal fileDetails src (genExtra <$> gen) <$> case runParseResult (parseGenericPackageDescription body) of (_, Left (_, err)) -> error ("Failed to parse in-memory cabal file: " ++ show err) @@ -137,11 +137,11 @@ instance IsComponent ForeignLib where instance IsComponent Executable where getBuildInfo = buildInfo - getMainPath Executable {modulePath = p} = Just p + getMainPath Executable {modulePath = p} = Just (getSymbolicPath p) instance IsComponent TestSuite where getBuildInfo = testBuildInfo - getMainPath TestSuite {testInterface = (TestSuiteExeV10 _ p)} = Just p + getMainPath TestSuite {testInterface = (TestSuiteExeV10 _ p)} = Just (getSymbolicPath p) getMainPath _ = Nothing instance IsComponent Benchmark where @@ -211,11 +211,11 @@ toNixPackageDescription isLocal detailLevel pd = mkNonRecSet $ else [ "detailLevel" $= mkStr (fromString (show detailLevel)) , "licenseFiles" $= toNix (map getSymbolicPath (licenseFiles pd)) - , "dataDir" $= mkStr (fromString (dataDir pd)) - , "dataFiles" $= toNix (dataFiles pd) - , "extraSrcFiles" $= toNix (extraSrcFiles pd) - , "extraTmpFiles" $= toNix (extraTmpFiles pd) - , "extraDocFiles" $= toNix (extraDocFiles pd) + , "dataDir" $= mkStr (fromString (getSymbolicPath (dataDir pd))) + , "dataFiles" $= toNix (map getSymbolicPath (dataFiles pd)) + , "extraSrcFiles" $= toNix (map getSymbolicPath (extraSrcFiles pd)) + , "extraTmpFiles" $= toNix (map getSymbolicPath (extraTmpFiles pd)) + , "extraDocFiles" $= toNix (map getSymbolicPath (extraDocFiles pd)) ] where toSetupDepends (Dependency pkg _ libs) = SetupDependency pkg <$> toList libs @@ -328,7 +328,7 @@ toNixGenericPackageDescription isLocal detailLevel gpd = mkNonRecSet mkNonRecSet ( [ "depends" $= toNix deps | Just deps <- [shakeTree . fmap ( (>>= depends) . targetBuildDepends . getBuildInfo) $ comp ] ] ++ [ "libs" $= toNix deps | Just deps <- [shakeTree . fmap ( fmap mkSysDep . extraLibs . getBuildInfo) $ comp ] ] ++ - [ "frameworks" $= toNix deps | Just deps <- [shakeTree . fmap ( fmap mkSysDep . frameworks . getBuildInfo) $ comp ] ] ++ + [ "frameworks" $= toNix deps | Just deps <- [shakeTree . fmap ( fmap mkSysDep . fmap getSymbolicPath . frameworks . getBuildInfo) $ comp ] ] ++ [ "pkgconfig" $= toNix deps | Just deps <- [shakeTree . fmap ( pkgconfigDepends . getBuildInfo) $ comp ] ] ++ [ "build-tools" $= toNix deps | Just deps <- [shakeTree . fmap ( toolDeps . getBuildInfo) $ comp ] ] ++ [ "buildable" $= boolTreeToNix (and <$> b) | Just b <- [shakeTree . fmap ((:[]) . buildable . getBuildInfo) $ comp ] ] ++ @@ -336,14 +336,14 @@ toNixGenericPackageDescription isLocal detailLevel gpd = mkNonRecSet then [] else [ "modules" $= toNix mods | Just mods <- [shakeTree . fmap (fmap ModuleName.toFilePath . modules) $ comp ] ] ++ - [ "asmSources" $= toNix src | Just src <- [shakeTree . fmap (asmSources . getBuildInfo) $ comp ] ] ++ - [ "cmmSources" $= toNix src | Just src <- [shakeTree . fmap (cmmSources . getBuildInfo) $ comp ] ] ++ - [ "cSources" $= toNix src | Just src <- [shakeTree . fmap (cSources . getBuildInfo) $ comp ] ] ++ - [ "cxxSources" $= toNix src | Just src <- [shakeTree . fmap (cxxSources . getBuildInfo) $ comp ] ] ++ - [ "jsSources" $= toNix src | Just src <- [shakeTree . fmap (jsSources . getBuildInfo) $ comp ] ] ++ - [ "hsSourceDirs" $= toNix (fmap getSymbolicPath <$> dir) | Just dir <- [shakeTree . fmap (hsSourceDirs . getBuildInfo) $ comp ] ] ++ - [ "includeDirs" $= toNix dir | Just dir <- [shakeTree . fmap (includeDirs . getBuildInfo) $ comp] ] ++ - [ "includes" $= toNix dir | Just dir <- [shakeTree . fmap (includes . getBuildInfo) $ comp] ] ++ + [ "asmSources" $= toNix (fmap getSymbolicPath <$> src) | Just src <- [shakeTree . fmap (asmSources . getBuildInfo) $ comp ] ] ++ + [ "cmmSources" $= toNix (fmap getSymbolicPath <$> src) | Just src <- [shakeTree . fmap (cmmSources . getBuildInfo) $ comp ] ] ++ + [ "cSources" $= toNix (fmap getSymbolicPath <$> src) | Just src <- [shakeTree . fmap (cSources . getBuildInfo) $ comp ] ] ++ + [ "cxxSources" $= toNix (fmap getSymbolicPath <$> src) | Just src <- [shakeTree . fmap (cxxSources . getBuildInfo) $ comp ] ] ++ + [ "jsSources" $= toNix (fmap getSymbolicPath <$> src) | Just src <- [shakeTree . fmap (jsSources . getBuildInfo) $ comp ] ] ++ + [ "hsSourceDirs" $= toNix (fmap getSymbolicPath <$> dir) | Just dir <- [shakeTree . fmap (hsSourceDirs . getBuildInfo) $ comp ] ] ++ + [ "includeDirs" $= toNix (fmap getSymbolicPath <$> dir) | Just dir <- [shakeTree . fmap (includeDirs . getBuildInfo) $ comp] ] ++ + [ "includes" $= toNix (fmap getSymbolicPath <$> dir) | Just dir <- [shakeTree . fmap (includes . getBuildInfo) $ comp] ] ++ [ "mainPath" $= toNix p | Just p <- [shakeTree . fmap (maybeToList . getMainPath) $ comp] ]) where name = fromString $ unUnqualComponentName unQualName depends (Dependency pkg _ libs) = HaskellLibDependency pkg <$> toList libs diff --git a/nix-tools/nix-tools/make-install-plan/ProjectPlanOutput.hs b/nix-tools/nix-tools/make-install-plan/ProjectPlanOutput.hs index 374dc15e9c..b1fa805141 100644 --- a/nix-tools/nix-tools/make-install-plan/ProjectPlanOutput.hs +++ b/nix-tools/nix-tools/make-install-plan/ProjectPlanOutput.hs @@ -53,6 +53,7 @@ import qualified Data.Map as Map import System.FilePath import Distribution.Client.ProjectPlanning +import Distribution.Utils.Path (makeSymbolicPath, getSymbolicPath) ----------------------------------------------------------------------------- -- Writing plan.json files @@ -230,7 +231,7 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig targ | elabSetupScriptCliVersion elab < mkVersion [3, 7, 0, 0] = "build-info" J..= J.Null | otherwise = - "build-info" J..= J.String (buildInfoPref dist_dir) + "build-info" J..= J.String (getSymbolicPath (buildInfoPref (makeSymbolicPath dist_dir))) packageLocationToJ :: PackageLocation (Maybe FilePath) -> J.Value packageLocationToJ pkgloc = diff --git a/nix-tools/nix-tools/nix-tools.cabal b/nix-tools/nix-tools/nix-tools.cabal index 27544a5b2e..1168ecf76b 100644 --- a/nix-tools/nix-tools/nix-tools.cabal +++ b/nix-tools/nix-tools/nix-tools.cabal @@ -15,14 +15,14 @@ common warnings common cabal-deps build-depends: - Cabal ^>=3.12, - Cabal-syntax ^>=3.12 + Cabal ^>=3.14, + Cabal-syntax ^>=3.14 common cabal-install-deps import: cabal-deps build-depends: - cabal-install ^>=3.12, - cabal-install-solver ^>=3.12 + cabal-install ^>=3.14, + cabal-install-solver ^>=3.14 library import: warnings diff --git a/nix-tools/nix-tools/setup-ghcjs/Setup.hs b/nix-tools/nix-tools/setup-ghcjs/Setup.hs index c4a20daba6..2b35578776 100644 --- a/nix-tools/nix-tools/setup-ghcjs/Setup.hs +++ b/nix-tools/nix-tools/setup-ghcjs/Setup.hs @@ -27,7 +27,7 @@ import Distribution.Simple.Test.LibV09 (stubName) import Distribution.Types.Executable (exeName, Executable(..)) import Distribution.Types.Benchmark (Benchmark(..)) import Distribution.Types.UnqualComponentName (unUnqualComponentName) - +import Distribution.Utils.Path (makeSymbolicPath, getSymbolicPath) emarProgram :: Program emarProgram = simpleProgram "emar" @@ -36,31 +36,31 @@ buildEMCCLib :: PackageDescription -> LocalBuildInfo -> IO () buildEMCCLib desc lbi = do let verbosity = verbose -- get build dir - createDirectoryIfMissingVerbose verbosity True ((buildDir lbi) "emcc") + createDirectoryIfMissingVerbose verbosity True ((getSymbolicPath (buildDir lbi)) "emcc") -- case library desc of Just lib -> do -- Let's see if we are going to export anything. If not there is likely no point in compiling anything -- from the C code. names <- forM (jsSources . libBuildInfo $ lib) $ \src -> do - unwords . concatMap (drop 2 . words) . filter (isPrefixOf "// EMCC:EXPORTED_FUNCTIONS") . lines <$> readFile src + unwords . concatMap (drop 2 . words) . filter (isPrefixOf "// EMCC:EXPORTED_FUNCTIONS") . lines <$> readFile (getSymbolicPath src) unless (null names) $ do let depIncludeDirs = concatMap IPI.includeDirs (topologicalOrder $ installedPkgs lbi) -- alright, let's compile all .c files into .o files with emcc, which is the `gcc` program. forM_ (cSources . libBuildInfo $ lib) $ \src -> do - let dst = (buildDir lbi) "emcc" (src -<.> "o") + let dst = (getSymbolicPath (buildDir lbi)) "emcc" (getSymbolicPath src -<.> "o") createDirectoryIfMissingVerbose verbosity True (takeDirectory dst) runDbProgram verbosity gccProgram (withPrograms lbi) $ - ["-c", src, "-o", dst] ++ ["-I" <> incDir | incDir <- (includeDirs . libBuildInfo $ lib) ++ depIncludeDirs] + ["-c", getSymbolicPath src, "-o", dst] ++ ["-I" <> getSymbolicPath incDir | incDir <- (includeDirs . libBuildInfo $ lib) ++ map makeSymbolicPath depIncludeDirs] -- and now construct a canonical `.js_a` file, *if* we have any cSources we turned into objects. unless (null . cSources . libBuildInfo $ lib) $ do - let dstLib = (buildDir lbi) "libEMCC" <> (unPackageName . pkgName . package $ desc) <> ".js_a" + let dstLib = (getSymbolicPath (buildDir lbi)) "libEMCC" <> (unPackageName . pkgName . package $ desc) <> ".js_a" runDbProgram verbosity emarProgram (withPrograms lbi) $ - [ "-r", dstLib ] ++ [ (buildDir lbi) "emcc" (src -<.> "o") | src <- cSources . libBuildInfo $ lib ] + [ "-r", dstLib ] ++ [ getSymbolicPath (buildDir lbi) "emcc" (getSymbolicPath src -<.> "o") | src <- cSources . libBuildInfo $ lib ] - let expLib = (buildDir lbi) "libEMCC" <> (unPackageName . pkgName . package $ desc) <> ".exported.js_a" + let expLib = getSymbolicPath (buildDir lbi) "libEMCC" <> (unPackageName . pkgName . package $ desc) <> ".exported.js_a" writeFile expLib (unwords names) -- if there's no lib, this is a fairly pointless exercise @@ -96,19 +96,19 @@ linkCLib libname desc lbi = do exfns <- concat <$> forM exff (fmap words . readFile) unless (null libs0 && null exfns) $ do libs1 <- case libs0 of - [] -> do writeFile (buildDir lbi "emcc_linking_dummy.c") "" + [] -> do writeFile (getSymbolicPath (buildDir lbi) "emcc_linking_dummy.c") "" runDbProgram verbosity gccProgram (withPrograms lbi) $ - ["-c", buildDir lbi "emcc_linking_dummy.c", "-o", buildDir lbi "emcc_linking_dummy.o"] - return [(buildDir lbi "emcc_linking_dummy.o")] + ["-c", getSymbolicPath (buildDir lbi) "emcc_linking_dummy.c", "-o", getSymbolicPath (buildDir lbi) "emcc_linking_dummy.o"] + return [(getSymbolicPath (buildDir lbi) "emcc_linking_dummy.o")] _ -> return libs0 - let dst = if libname == "emcc" "lib.js" then buildDir lbi + let dst = if libname == "emcc" "lib.js" then getSymbolicPath (buildDir lbi) -- who designed this shit in cabal? else case comp of - (CTest test@(TestSuite { testInterface = TestSuiteLibV09 _ _ })) -> buildDir lbi stubName test stubName test ++ "-tmp" - (CTest test@(TestSuite { testInterface = TestSuiteExeV10 _ _ })) -> buildDir lbi unUnqualComponentName (testName test) unUnqualComponentName (testName test) ++ "-tmp" - (CExe exe) -> buildDir lbi unUnqualComponentName (exeName exe) unUnqualComponentName (exeName exe) ++ "-tmp" - _ -> componentBuildDir lbi clbi + (CTest test@(TestSuite { testInterface = TestSuiteLibV09 _ _ })) -> getSymbolicPath (buildDir lbi) stubName test stubName test ++ "-tmp" + (CTest test@(TestSuite { testInterface = TestSuiteExeV10 _ _ })) -> getSymbolicPath (buildDir lbi) unUnqualComponentName (testName test) unUnqualComponentName (testName test) ++ "-tmp" + (CExe exe) -> getSymbolicPath (buildDir lbi) unUnqualComponentName (exeName exe) unUnqualComponentName (exeName exe) ++ "-tmp" + _ -> getSymbolicPath (componentBuildDir lbi clbi) dst' = dst libname createDirectoryIfMissingVerbose verbosity True (takeDirectory dst') runDbProgram verbosity gccProgram (withPrograms lbi) $ @@ -126,7 +126,7 @@ postBuildHook :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> I postBuildHook _args flags desc lbi = do case (takeFileName . programPath <$> lookupProgram ghcProgram (withPrograms lbi)) of Just "js-unknown-ghcjs-ghc" -> - readBuildTargets silent desc (buildArgs flags) >>= \case + readBuildTargets silent desc (buildTargets flags) >>= \case [BuildTargetComponent (CLibName _)] -> print "OK. Lib (Build)" >> buildEMCCLib desc lbi [BuildTargetComponent (CExeName _)] -> print "OK. Exe" [BuildTargetComponent (CTestName _)] -> print "OK. Test" @@ -142,7 +142,7 @@ postConfHook args flags desc lbi = do -- this is technically only needed if the package uses TH somewhere. linkEMCCTHLib desc lbi -- only link the final lib if we want to produce an output. - readBuildTargets silent desc (configArgs flags) >>= \case + readBuildTargets silent desc (configureArgs False flags) >>= \case [BuildTargetComponent (CLibName _)] -> print "OK. Lib" >> postConf simpleUserHooks args flags desc lbi [BuildTargetComponent (CExeName _)] -> print "OK. Exe (Link)" >> linkEMCCLib desc lbi [BuildTargetComponent (CTestName _)] -> print "OK. Test (Link)" >> linkEMCCLib desc lbi @@ -194,7 +194,7 @@ emccBuildHook desc lbi hooks flags = do -- emccCopyHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO () emccCopyHook desc lbi hooks flags = do - emccLibs <- filterM (\l -> doesFileExist (buildDir lbi "lib" <> l <> ".js_a")) + emccLibs <- filterM (\l -> doesFileExist (getSymbolicPath (buildDir lbi) "lib" <> l <> ".js_a")) [ "EMCC" <> (unPackageName . pkgName . package $ desc) , "EMCC" <> (unPackageName . pkgName . package $ desc) <> ".exported" ] print $ "EMCC extra lib files: " ++ intercalate ", " emccLibs @@ -210,7 +210,7 @@ emccCopyHook desc lbi hooks flags = do emccRegHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () emccRegHook desc lbi hooks flags = do - emccLibs <- filterM (\l -> doesFileExist (buildDir lbi "lib" <> l <> ".js_a")) + emccLibs <- filterM (\l -> doesFileExist (getSymbolicPath (buildDir lbi) "lib" <> l <> ".js_a")) [ "EMCC" <> (unPackageName . pkgName . package $ desc) , "EMCC" <> (unPackageName . pkgName . package $ desc) <> ".exported" ] print $ "EMCC extra lib files: " ++ intercalate ", " emccLibs @@ -226,7 +226,7 @@ emccRegHook desc lbi hooks flags = do emccUnregHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () emccUnregHook desc lbi hooks flags = do - emccLibs <- filterM (\l -> doesFileExist (buildDir lbi "lib" <> l <> ".js_a")) + emccLibs <- filterM (\l -> doesFileExist (getSymbolicPath (buildDir lbi) "lib" <> l <> ".js_a")) [ "EMCC" <> (unPackageName . pkgName . package $ desc) , "EMCC" <> (unPackageName . pkgName . package $ desc) <> ".exported" ] print $ "EMCC extra lib files: " ++ intercalate ", " emccLibs diff --git a/nix-tools/overlay.nix b/nix-tools/overlay.nix index 6035cda448..dd915b6f48 100644 --- a/nix-tools/overlay.nix +++ b/nix-tools/overlay.nix @@ -1,7 +1,7 @@ final: _prev: let - compiler-nix-name = "ghc9101"; + compiler-nix-name = "ghc96"; nix-tools = nix-tools-set { nix-tools = nix-tools-unchecked; diff --git a/nix-tools/static/packaging.nix b/nix-tools/static/packaging.nix index 0eb446d909..d6d7d25d8e 100644 --- a/nix-tools/static/packaging.nix +++ b/nix-tools/static/packaging.nix @@ -28,12 +28,13 @@ let text = '' for nixlib in $(otool -L "$1" |awk '/nix\/store/{ print $1 }'); do case "$nixlib" in - *libiconv.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.dylib "$1" ;; + *libiconv.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.dylib "$1" ;; *libiconv.2.dylib) install_name_tool -change "$nixlib" /usr/lib/libiconv.2.dylib "$1" ;; - *libffi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libffi.dylib "$1" ;; - *libc++.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libc++.dylib "$1" ;; - *libz.dylib) install_name_tool -change "$nixlib" /usr/lib/libz.dylib "$1" ;; - *libresolv.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libresolv.dylib "$1" ;; + *libffi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libffi.dylib "$1" ;; + *libc++.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libc++.dylib "$1" ;; + *libc++abi.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libc++abi.dylib "$1" ;; + *libz.dylib) install_name_tool -change "$nixlib" /usr/lib/libz.dylib "$1" ;; + *libresolv.*.dylib) install_name_tool -change "$nixlib" /usr/lib/libresolv.dylib "$1" ;; *) ;; esac done diff --git a/nix-tools/static/project.nix b/nix-tools/static/project.nix index e7ed7832e7..4202cc5e17 100644 --- a/nix-tools/static/project.nix +++ b/nix-tools/static/project.nix @@ -64,7 +64,7 @@ let static-nix-tools-project = pkgs.haskell-nix.project' { - compiler-nix-name = "ghc928"; + compiler-nix-name = "ghc96"; src = ../.; diff --git a/test/cabal.project.local b/test/cabal.project.local index cdecdf5ac2..fa75ea73b4 100644 --- a/test/cabal.project.local +++ b/test/cabal.project.local @@ -23,14 +23,14 @@ repository head.hackage.ghc.haskell.org f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d - --sha256: sha256-RQS0PUBA6nAD1T0OSVFhcF7ldh+6L+cW+k96Hgo3z5s= + --sha256: sha256-xilNP+uPmCGM1NXZJYgCEYXmGdjnE8todMdQKJ2BkJw= repository ghcjs-overlay url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b secure: True root-keys: key-threshold: 0 - --sha256: sha256-mHxgsrbjHdyE8yqOkhZsk4WGKGZDFqSn07ENMPy1rVA= + --sha256: sha256-RXRKmHMpOY7ePZGGabZ1YGhF42+eLslZEIMe2JUYwB0= if os(ghcjs) extra-packages: ghci diff --git a/test/gi-gtk/default.nix b/test/gi-gtk/default.nix index 1fe2389ecd..cdab43a1bb 100644 --- a/test/gi-gtk/default.nix +++ b/test/gi-gtk/default.nix @@ -10,8 +10,6 @@ let cabalProjectLocal = builtins.readFile ../cabal.project.local + '' -- The overloading feature of haskell-gi makes build times very long constraints: haskell-gi-overloading ==0.0 - -- Needed for the current nix-tools TODO remove once nix-tools is updated - constraints: Cabal <3.12 ''; };