diff --git a/build.nix b/build.nix index d9f0790cf0..6939a16517 100644 --- a/build.nix +++ b/build.nix @@ -57,10 +57,15 @@ in rec { inherit evalPackages; src = pkgs.haskell-nix.sources."hls-2.2"; }; - } // pkgs.lib.optionalAttrs (ghcFromTo "9.0" "9.8.3" || ghcFromTo "9.10" "9.11") { - "hls-29" = tool compiler-nix-name "haskell-language-server" { + } // pkgs.lib.optionalAttrs (ghcFromTo "9.0" "9.11") { + "hls" = tool compiler-nix-name "haskell-language-server" { inherit evalPackages; - src = pkgs.haskell-nix.sources."hls-2.9"; + src = pkgs.haskell-nix.sources.hls; + cabalProjectLocal = '' + if impl(ghc >=9.6.7) && impl(ghc <9.7) || impl(ghc >=9.8.3) + constraints: ghc-lib-parser >=9.8.4 + allow-older: ghc-lib-parser:filepath + ''; }; }) ); diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index 5e6bd41a85..bcb4b861bb 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -209,7 +209,15 @@ let (enableFeature enableShared "shared") (enableFeature enableExecutableDynamic "executable-dynamic") (enableFeature doCoverage "coverage") - (enableFeature (enableLibraryForGhci && !stdenv.hostPlatform.isGhcjs) "library-for-ghci") + # For Android (or really anything that uses lld), -r will silently drop + # "lazy" symbols. Those are leaf symbols with no referenes. This however + # does not work when loading the objects into the linker, because then we + # occationally miss symbols when subsequent libraries depending on the one + # that dropped the symbol are loaded. bfd and lld support --whole-archive + # lld -r --whole-archive ... will _not_ drop lazy symbols. However the + # --whole-archive flag needs to come _before_ the objects, it's applied in + # sequence. The proper fix is thusly to add --while-archive to Cabal. + (enableFeature (enableLibraryForGhci && !stdenv.hostPlatform.isGhcjs && !stdenv.hostPlatform.isAndroid) "library-for-ghci") ] ++ lib.optionals (stdenv.hostPlatform.isMusl && (haskellLib.isExecutableType componentId)) [ # These flags will make sure the resulting executable is statically linked. # If it uses other libraries it may be necessary for to add more @@ -377,8 +385,8 @@ let inherit (package.identifier) version; nativeBuildInputs = [shellWrappers.drv] ++ attrs.nativeBuildInputs; }); - profiled = self (drvArgs // { enableLibraryProfiling = true; }); - dwarf = self (drvArgs // { enableDWARF = true; }); + profiled = lib.makeOverridable self (drvArgs // { enableLibraryProfiling = true; }); + dwarf = lib.makeOverridable self (drvArgs // { enableDWARF = true; }); } // lib.optionalAttrs (haskellLib.isLibrary componentId || haskellLib.isTest componentId) ({ inherit haddock; inherit (haddock) haddockDir; # This is null if `doHaddock = false` diff --git a/builder/default.nix b/builder/default.nix index 6a029e8964..98c1b977c5 100644 --- a/builder/default.nix +++ b/builder/default.nix @@ -68,7 +68,7 @@ let let haskellPackages = { # For musl we can use haddock from the buildGHC - ghc = if stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl && !haskellLib.isNativeMusl + ghc = if stdenv.targetPlatform.isMusl then ghc.buildGHC else ghc; inherit packages hoogle; diff --git a/builder/ghc-for-component-wrapper.nix b/builder/ghc-for-component-wrapper.nix index 8afb44d761..7d3c821250 100644 --- a/builder/ghc-for-component-wrapper.nix +++ b/builder/ghc-for-component-wrapper.nix @@ -23,7 +23,7 @@ let libDir = "$wrappedGhc/${configFiles.libDir}"; docDir = "$wrappedGhc/share/doc/ghc/html"; # For musl we can use haddock from the buildGHC - haddock = if stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl && !haskellLib.isNativeMusl + haddock = if stdenv.targetPlatform.isMusl then ghc.buildGHC else ghc; @@ -125,7 +125,7 @@ let done '' - + lib.optionalString (stdenv.targetPlatform.isMusl && !haskellLib.isNativeMusl && builtins.compareVersions ghc.version "9.9" >0) '' + + lib.optionalString (haskellLib.isNativeMusl && builtins.compareVersions ghc.version "9.9" >0) '' ln -s $wrappedGhc/bin/${targetPrefix}unlit $wrappedGhc/bin/unlit ln -s $wrappedGhc/bin/${ghcCommand}-iserv $wrappedGhc/bin/ghc-iserv ln -s $wrappedGhc/bin/${ghcCommand}-iserv-prof $wrappedGhc/bin/ghc-iserv-prof diff --git a/ci.nix b/ci.nix index f44c821ca6..91d82f4c33 100644 --- a/ci.nix +++ b/ci.nix @@ -58,13 +58,14 @@ # from here (so that is no longer cached) also remove ./materialized/ghcXXX. # Update supported-ghc-versions.md to reflect any changes made here. nixpkgs.lib.optionalAttrs (nixpkgsName == "R2411") { - ghc96 = false; - ghc98 = false; - ghc910 = false; - ghc912 = true; - } // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") { ghc96 = true; ghc98 = true; + ghc910 = true; + ghc9121 = true; + } // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") { + ghc96 = false; + ghc96X = true; + ghc98 = true; ghc98llvm = false; ghc910 = true; ghc910llvm = true; @@ -80,13 +81,13 @@ && (__match ".*llvm" compiler-nix-name == null) && ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) || (system == "aarch64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) - || (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc982" "ghc983" "ghc984"]) - || (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc982" "ghc983" "ghc984"]) + || (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc96720250227" "ghc982" "ghc983" "ghc984"]) + || (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc96720250227" "ghc982" "ghc983" "ghc984"]) )) { inherit (lib.systems.examples) ghcjs; - } // lib.optionalAttrs ( - (__match ".*llvm" compiler-nix-name == null) - && ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc966"]) # Not sure why GHC 9.6.6 TH code now wants `log1pf` + } // lib.optionalAttrs (nixpkgsName == "unstable" + && (__match ".*llvm" compiler-nix-name == null) + && ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc966" "ghc96720250227"]) # Not sure why GHC 9.6.6 TH code now wants `log1pf` || (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity inherit (lib.systems.examples) mingwW64; } // lib.optionalAttrs (nixpkgsName == "unstable" @@ -98,7 +99,12 @@ # Musl cross only works on linux # aarch64 cross only works on linux inherit (lib.systems.examples) musl64 aarch64-multiplatform; - } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928"]) { + } // lib.optionalAttrs (__match ".*llvm" compiler-nix-name == null && system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) { + # Out llvm versions of GHC seem to break for musl32 + inherit (lib.systems.examples) musl32; + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "R2411" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) { + inherit (lib.systems.examples) aarch64-android-prebuilt armv7a-android-prebuilt; + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc8107" "ghc902"]) { # TODO fix this for the compilers we build with hadrian (ghc >=9.4) inherit (lib.systems.examples) aarch64-multiplatform-musl; } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc8107" "ghc902"]) { diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index f72a3b8a95..11be98da5f 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -45,9 +45,9 @@ let self = , enableDWARF ? false -, enableTerminfo ? +, enableTerminfo ? !stdenv.targetPlatform.isAndroid && # Terminfo does not work on older ghc cross arm and windows compilers - (!haskell-nix.haskellLib.isCrossTarget || !(stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isWindows) || builtins.compareVersions ghc-version "8.10" >= 0) + (!haskell-nix.haskellLib.isCrossTarget || !(stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isWindows) || builtins.compareVersions ghc-version "8.10" >= 0) , # Wheter to build in NUMA support enableNUMA ? true @@ -62,7 +62,7 @@ let self = , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ - disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64 + disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isAndroid , useLdGold ? # might be better check to see if cc is clang/llvm? @@ -169,8 +169,9 @@ let WITH_TERMINFO=NO '' # musl doesn't have a system-linker. Only on x86, and on x86 we need it, as - # our elf linker for x86_64 is broken. - + lib.optionalString (targetPlatform.isAndroid || (targetPlatform.isMusl && !targetPlatform.isx86)) '' + # our elf linker for x86_64 is broken. The i686 one seems also to not exist. + # So it's really _just_ x86_64. + + lib.optionalString (targetPlatform.isAndroid || (targetPlatform.isMusl && !targetPlatform.isx86_64)) '' compiler_CONFIGURE_OPTS += --flags=-dynamic-system-linker '' # While split sections are now enabled by default in ghc 8.8 for windows, @@ -183,12 +184,14 @@ let SplitSections = NO '' + lib.optionalString (!enableLibraryProfiling) '' BUILD_PROF_LIBS = NO + '' + lib.optionalString (disableLargeAddressSpace) '' + libraries/base_CONFIGURE_OPTS += --configure-option=--with-libcharset=no ''; # `--with` flags for libraries needed for RTS linker configureFlags = [ "--datadir=$doc/share/doc/ghc" - ] ++ lib.optionals (!targetPlatform.isGhcjs) ["--with-curses-includes=${targetPackages.ncurses.dev}/include" "--with-curses-libraries=${targetPackages.ncurses.out}/lib" + ] ++ lib.optionals (!targetPlatform.isGhcjs && !targetPlatform.isAndroid) ["--with-curses-includes=${targetPackages.ncurses.dev}/include" "--with-curses-libraries=${targetPackages.ncurses.out}/lib" ] ++ lib.optionals (targetLibffi != null && !targetPlatform.isGhcjs) ["--with-system-libffi" "--with-ffi-includes=${targetLibffi.dev}/include" "--with-ffi-libraries=${targetLibffi.out}/lib" ] ++ lib.optionals (!enableIntegerSimple && !targetPlatform.isGhcjs) [ "--with-gmp-includes=${targetGmp.dev}/include" "--with-gmp-libraries=${targetGmp.out}/lib" @@ -216,23 +219,24 @@ let # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 # https://github.com/haskell/cabal/issues/8882 "fp_cv_prog_ar_supports_dash_l=no" - ] ++ lib.optional (targetPlatform.isGhcjs) "--target=javascript-unknown-ghcjs"; # TODO use configurePlatforms once tripple is updated in nixpkgs + ] ++ lib.optionals (targetPlatform.isDarwin) [ + "--without-libcharset" + ] ++ lib.optional (targetPlatform.isGhcjs) "--target=javascript-unknown-ghcjs" # TODO use configurePlatforms once tripple is updated in nixpkgs + ; # Splicer will pull out correct variations - libDeps = platform: lib.optional (enableTerminfo && !targetPlatform.isGhcjs) [ targetPackages.ncurses targetPackages.ncurses.dev ] + libDeps = platform: lib.optional (enableTerminfo && !targetPlatform.isGhcjs && !targetPlatform.isAndroid) [ targetPackages.ncurses targetPackages.ncurses.dev ] ++ lib.optional (!targetPlatform.isGhcjs) targetLibffi ++ lib.optional (!enableIntegerSimple && !targetPlatform.isGhcjs) gmp ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv ++ lib.optional (enableNUMA && platform.isLinux && !platform.isAarch32 && !platform.isAndroid) numactl - # Even with terminfo disabled some older ghc cross arm and windows compilers do not build unless `ncurses` is found and they seem to want the buildPlatform version - ++ lib.optional (!enableTerminfo && haskell-nix.haskellLib.isCrossTarget && (stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isWindows) && builtins.compareVersions ghc-version "8.10" < 0) ncurses.dev ++ lib.optional enableDWARF (lib.getLib elfutils); toolsForTarget = if targetPlatform.isGhcjs then [ buildPackages.emscripten ] else if hostPlatform == buildPlatform - then [ targetPackages.stdenv.cc ] ++ lib.optionals useLLVM [llvmPackages.llvm llvmPackages.clang] + then [ targetPackages.stdenv.cc ] ++ lib.optionals useLLVM ([llvmPackages.llvm] ++ lib.optional (!targetPlatform.useAndroidPrebuilt) llvmPackages.clang) else assert targetPlatform == hostPlatform; # build != host == target [ stdenv.cc ] ++ lib.optional useLLVM buildLlvmPackages.llvm; @@ -244,7 +248,7 @@ let # for musl only; but I'd like to stay far away from the unnecessary # bindist logic as we can. It's slow, and buggy, and doesn't provide any # value for us. - installStage1 = useHadrian && (haskell-nix.haskellLib.isCrossTarget || stdenv.targetPlatform.isMusl); + installStage1 = useHadrian && (with haskell-nix.haskellLib; isCrossTarget || isNativeMusl); hadrian = let @@ -345,7 +349,14 @@ let " '*.ghc.cabal.configure.opts += --flags=-dynamic-system-linker'" # The following is required if we build on aarch64-darwin for aarch64-iOS. Otherwise older # iPhones/iPads/... won't understand the compiled code, as the compiler will emit LDSETALH - # + lib.optionalString (targetPlatform.???) "'*.rts.ghc.c.opts += -optc-mcpu=apple-a7 -optc-march=armv8-a+norcpc'" + # FIXME: we should have iOS as an argument to this derivation, and then make this, as well as + # disableLargeAddress space conditional on iOS = true. + + lib.optionalString (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) + " '*.*.ghc.c.opts += -optc-mcpu=apple-a7 -optc-march=armv8-a+norcpc'" + + lib.optionalString (targetPlatform.isAndroid && targetPlatform.isAarch32) + " 'stage1.*.ghc.c.opts += -optc-march=armv7-a -optc-mfloat-abi=softfp -optc-mfpu=vfpv3-d16'" + + lib.optionalString (targetPlatform.isAndroid && targetPlatform.isAarch64) + " 'stage1.*.ghc.c.opts += -optc-march=armv8-a'" # For GHC versions in the 9.x range that don't support the +native_bignum flavour transformer yet + lib.optionalString ((enableNativeBignum && !hadrianHasNativeBignumFlavour)) " --bignum=native" @@ -462,7 +473,10 @@ stdenv.mkDerivation (rec { export NIX_LDFLAGS+=" -rpath $out/lib/${targetPrefix}ghc-${ghc-version}" '' + lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" - '' + lib.optionalString targetPlatform.useAndroidPrebuilt '' + '' + + # we really want "+armv7-a,+soft-float,+neon" as features, but llvm will + # fail with those :facepalm: + lib.optionalString targetPlatform.useAndroidPrebuilt '' sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets '' + lib.optionalString targetPlatform.isMusl '' echo "patching llvm-targets for musl targets..." @@ -537,7 +551,7 @@ stdenv.mkDerivation (rec { ++ lib.optional stdenv.targetPlatform.isMusl "pie" ++ lib.optional enableDWARF "fortify"; - postInstall = lib.optionalString (enableNUMA && targetPlatform.isLinux) '' + postInstall = lib.optionalString (enableNUMA && targetPlatform.isLinux && !targetPlatform.isAarch32 && !targetPlatform.isAndroid) '' # Patch rts.conf to ensure libnuma can be found for file in $(find "$out/lib" -name "rts*.conf"); do @@ -731,7 +745,7 @@ stdenv.mkDerivation (rec { --replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib' find . -name 'system*.conf*' cat mk/system-cxx-std-lib-1.0.conf - '' + lib.optionalString (installStage1 && stdenv.targetPlatform.isMusl) '' + '' + lib.optionalString (installStage1 && haskell-nix.haskellLib.isNativeMusl) '' substituteInPlace hadrian/cfg/system.config \ --replace 'cross-compiling = YES' \ 'cross-compiling = NO' @@ -781,7 +795,7 @@ stdenv.mkDerivation (rec { dontStrip = true; dontPatchELF = true; noAuditTmpdir = true; -} // lib.optionalAttrs (stdenv.buildPlatform.isDarwin || stdenv.targetPlatform.isWindows) { +} // { # ghc install on macOS wants to run `xattr -r -c` # The macOS version fails because it wants python 2. # The nix version of xattr does not support those args. @@ -821,12 +835,13 @@ stdenv.mkDerivation (rec { --replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib' find . -name 'system*.conf*' cat mk/system-cxx-std-lib-1.0.conf - '' + lib.optionalString (installStage1 && !haskell-nix.haskellLib.isCrossTarget && stdenv.targetPlatform.isMusl) '' + '' + lib.optionalString (installStage1 && haskell-nix.haskellLib.isNativeMusl) '' substituteInPlace hadrian/cfg/system.config \ --replace 'cross-compiling = YES' \ 'cross-compiling = NO' ''; buildPhase = '' + runHook preBuild ${hadrian}/bin/hadrian ${hadrianArgs} '' + lib.optionalString (installStage1 && !stdenv.targetPlatform.isGhcjs && builtins.compareVersions ghc-version "9.8" < 0) '' ${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:libiserv @@ -841,6 +856,8 @@ stdenv.mkDerivation (rec { mv $exe ${targetPrefix}$exe done popd + '' + '' + runHook postBuild ''; # Hadrian's installation only works for native compilers, and is broken for cross compilers. diff --git a/flake.lock b/flake.lock index d588d75547..60e03f9a57 100644 --- a/flake.lock +++ b/flake.lock @@ -150,6 +150,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": { @@ -306,11 +322,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": { @@ -339,11 +355,11 @@ "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": { @@ -403,11 +419,11 @@ }, "nixpkgs-2411": { "locked": { - "lastModified": 1737255904, - "narHash": "sha256-r3fxHvh+M/mBgCZXOACzRFPsJdix2QSsKazb7VCXXo0=", + "lastModified": 1739151041, + "narHash": "sha256-uNszcul7y++oBiyYXjHEDw/AHeLNp8B6pyWOB+RLA/4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eacdab35066b0bb1c9413c96898e326b76398a81", + "rev": "94792ab2a6beaec81424445bf917ca2556fbeade", "type": "github" }, "original": { @@ -461,6 +477,7 @@ "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.2": "hls-2.2", diff --git a/flake.nix b/flake.nix index e803b54be0..24d0689fac 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ "hls-2.7" = { url = "github:haskell/haskell-language-server/2.7.0.0"; flake = false; }; "hls-2.8" = { url = "github:haskell/haskell-language-server/2.8.0.0"; flake = false; }; "hls-2.9" = { url = "github:haskell/haskell-language-server/2.9.0.1"; flake = false; }; + "hls" = { url = "github:haskell/haskell-language-server"; flake = false; }; hackage = { url = "github:input-output-hk/hackage.nix"; flake = false; diff --git a/lazy-inputs/default.nix b/lazy-inputs/default.nix index a1b1f446bc..1e626d0335 100644 --- a/lazy-inputs/default.nix +++ b/lazy-inputs/default.nix @@ -29,6 +29,7 @@ in { inherit ((callFlake { pkgs = final; src = ./ghc964; }).defaultNix) ghc964; inherit ((callFlake { pkgs = final; src = ./ghc965; }).defaultNix) ghc965; inherit ((callFlake { pkgs = final; src = ./ghc966; }).defaultNix) ghc966; + inherit ((callFlake { pkgs = final; src = ./ghc96X; }).defaultNix) ghc96X; inherit ((callFlake { pkgs = final; src = ./ghc981; }).defaultNix) ghc981; inherit ((callFlake { pkgs = final; src = ./ghc982; }).defaultNix) ghc982; inherit ((callFlake { pkgs = final; src = ./ghc983; }).defaultNix) ghc983; diff --git a/lazy-inputs/ghc912X/flake.lock b/lazy-inputs/ghc912X/flake.lock index 9b29a431ef..e3ba39af8b 100644 --- a/lazy-inputs/ghc912X/flake.lock +++ b/lazy-inputs/ghc912X/flake.lock @@ -3,11 +3,11 @@ "ghc912X": { "flake": false, "locked": { - "lastModified": 1734278290, - "narHash": "sha256-oSiGEkiQlkmCr7qsFUJ9qpwsU4AumOIpFn6zN4ByMNg=", + "lastModified": 1739998238, + "narHash": "sha256-CgmWnocb0K2fy89koME7H2tTFEOhjxZ9G+C+PQDKoZA=", "ref": "ghc-9.12", - "rev": "daf659b6e3c8f2a84100fbee797cd9d457c00df5", - "revCount": 67524, + "rev": "a73d6c7f5d18dc6b5366a9b87a899978fadfb2ab", + "revCount": 67541, "submodules": true, "type": "git", "url": "https://gitlab.haskell.org/ghc/ghc" diff --git a/lazy-inputs/ghc96X/flake.lock b/lazy-inputs/ghc96X/flake.lock new file mode 100644 index 0000000000..ee8f170a5a --- /dev/null +++ b/lazy-inputs/ghc96X/flake.lock @@ -0,0 +1,30 @@ +{ + "nodes": { + "ghc96X": { + "flake": false, + "locked": { + "lastModified": 1740624264, + "narHash": "sha256-2gLt3yKMnddXHepwi97eYUs9O+PycsS7nRI0yOtycKw=", + "ref": "ghc-9.6", + "rev": "2b22b6ae69c94e721fde8af0108eb0feed97cc82", + "revCount": 61113, + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + }, + "original": { + "ref": "ghc-9.6", + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + } + }, + "root": { + "inputs": { + "ghc96X": "ghc96X" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/lazy-inputs/ghc96X/flake.nix b/lazy-inputs/ghc96X/flake.nix new file mode 100644 index 0000000000..1b973d0649 --- /dev/null +++ b/lazy-inputs/ghc96X/flake.nix @@ -0,0 +1,12 @@ +{ + description = "Lazy Input for Haskell.nix"; + + inputs = { + ghc96X = { + flake = false; + url = "git+https://gitlab.haskell.org/ghc/ghc?ref=ghc-9.6&submodules=1"; + }; + }; + + outputs = inputs: inputs; +} diff --git a/lib/call-cabal-project-to-nix.nix b/lib/call-cabal-project-to-nix.nix index c8ba1c746b..3c80b333c3 100644 --- a/lib/call-cabal-project-to-nix.nix +++ b/lib/call-cabal-project-to-nix.nix @@ -334,8 +334,14 @@ let echo ',("target arch","${ if pkgs.stdenv.targetPlatform.isx86_64 then "ArchX86_64" + else if pkgs.stdenv.targetPlatform.isx86 + then "ArchX86" + else if pkgs.stdenv.targetPlatform.isRiscV64 + then "ArchRISCV64" else if pkgs.stdenv.targetPlatform.isAarch64 then "ArchAArch64" + else if pkgs.stdenv.targetPlatform.isAarch32 + then "ArchAArch32" else if pkgs.stdenv.targetPlatform.isJavaScript then "ArchJavaScript" else throw "Unknown target arch ${pkgs.stdenv.targetPlatform.config}" @@ -681,8 +687,8 @@ let cabal.project.freeze chmod +w cabal.project.freeze ''} - export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt - export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt + export SSL_CERT_FILE=${evalPackages.cacert}/etc/ssl/certs/ca-bundle.crt + export GIT_SSL_CAINFO=${evalPackages.cacert}/etc/ssl/certs/ca-bundle.crt export CABAL_DIR=${ # This creates `.cabal` directory that is as it would have diff --git a/lib/check.nix b/lib/check.nix index 81a0047dd1..6471d6401e 100644 --- a/lib/check.nix +++ b/lib/check.nix @@ -1,7 +1,10 @@ { stdenv, lib, haskellLib, buildPackages }: -let self = drv: +let self = drvOrig: let + # Work around problem running dynamicially linked Android executables with qemu. + drv = drvOrig.override (lib.optionalAttrs stdenv.hostPlatform.isAndroid { setupBuildFlags = ["--ghc-option=-optl-static" ]; }); + component = drv.config; # This derivation can be used to execute test component. @@ -65,4 +68,4 @@ in stdenv.mkDerivation (( } // lib.optionalAttrs (drv ? LOCALE_ARCHIVE) { inherit (drv) LOCALE_ARCHIVE; } ); -in self \ No newline at end of file +in self diff --git a/lib/default.nix b/lib/default.nix index 88fef4a056..2d7a0aebb0 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -256,9 +256,9 @@ in { isCrossTarget = stdenv.targetPlatform != stdenv.hostPlatform && !(stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl && stdenv.hostPlatform.linuxArch == stdenv.targetPlatform.linuxArch); # Native musl build-host-target combo - isNativeMusl = stdenv.hostPlatform.isMusl - && stdenv.buildPlatform == stdenv.hostPlatform - && stdenv.hostPlatform == stdenv.targetPlatform; + isNativeMusl = stdenv.targetPlatform.isMusl + && stdenv.buildPlatform.linuxArch == stdenv.hostPlatform.linuxArch + && stdenv.hostPlatform.linuxArch == stdenv.targetPlatform.linuxArch; # Takes a version number, module or list of modules (for cabalProject) # and converts it to an list of project modules. This allows @@ -593,6 +593,8 @@ in { then "arm" else if hostPlatform.isAarch64 then "aarch64" + else if hostPlatform.isi686 + then "i386" else abort "Don't know which QEMU to use for hostPlatform ${hostPlatform.config}. Please provide qemuSuffix"; # How to run ldd when checking for static linking diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/base.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/base.nix new file mode 100644 index 0000000000..1f649a4341 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/base.nix @@ -0,0 +1,49 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "base"; version = "4.18.3.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "Core Libraries Committee "; + author = ""; + homepage = ""; + url = ""; + synopsis = "Core data structures and operations"; + description = "Haskell's base library provides, among other things, core types (e.g. [Bool](\"Data.Bool\") and [Int](\"Data.Int\")),\ndata structures (e.g. [List](\"Data.List\"), [Tuple](\"Data.Tuple\") and [Maybe](\"Data.Maybe\")),\nthe [Exception](\"Control.Exception\") mechanism, and the [IO](\"System.IO\") & [Concurrency](\"Control.Concurrent\") operations.\nThe \"Prelude\" module, which is imported by default, exposes a curated set of types and functions from other modules.\n\nOther data structures like [Map](https://hackage.haskell.org/package/containers/docs/Data-Map.html),\n[Set](https://hackage.haskell.org/package/containers/docs/Data-Set.html) are available in the [containers](https://hackage.haskell.org/package/containers) library.\nTo work with textual data, use the [text](https://hackage.haskell.org/package/text/docs/Data-Text.html) library."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."wsock32" or (errorHandler.sysDepError "wsock32")) + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."shell32" or (errorHandler.sysDepError "shell32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."kernel32" or (errorHandler.sysDepError "kernel32")) + (pkgs."advapi32" or (errorHandler.sysDepError "advapi32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ws2_32" or (errorHandler.sysDepError "ws2_32")) + (pkgs."shlwapi" or (errorHandler.sysDepError "shlwapi")) + (pkgs."ole32" or (errorHandler.sysDepError "ole32")) + (pkgs."rpcrt4" or (errorHandler.sysDepError "rpcrt4")) + (pkgs."ntdll" or (errorHandler.sysDepError "ntdll")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/deriveConstants.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/deriveConstants.nix new file mode 100644 index 0000000000..135cdd02f6 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/deriveConstants.nix @@ -0,0 +1,39 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "deriveConstants"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Derive header files containing various constants for the GHC build process"; + description = "This utility is responsible for generating a number of C header files\nneeded during the GHC build process. See @rts/include/ghc.mk@ in the GHC\nbuild system for details."; + buildType = "Simple"; + }; + components = { + exes = { + "deriveConstants" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/genprimopcode.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/genprimopcode.nix new file mode 100644 index 0000000000..49bbe516ba --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/genprimopcode.nix @@ -0,0 +1,40 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { build-tool-depends = true; }; + package = { + specVersion = "2.0"; + identifier = { name = "genprimopcode"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Generates various files implementing GHC's primitive operations."; + description = "This utility reads a textual description of GHC's primitive operations\n(@primops.txt.pp@) and produces a number of outputs. These include,\n\n* the @GHC.Prim@ module included in the @ghc-prim@ package.\n* the @GHC.PrimopWrappers@ module included in the @ghc-prim@ package.\n* an LaTeX document describing the primitive operations."; + buildType = "Simple"; + }; + components = { + exes = { + "genprimopcode" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + ]; + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-bignum.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-bignum.nix new file mode 100644 index 0000000000..46af6e0e9f --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-bignum.nix @@ -0,0 +1,37 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { native = false; ffi = false; gmp = false; check = false; }; + package = { + specVersion = "2.0"; + identifier = { name = "ghc-bignum"; version = "1.3"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = "Sylvain Henry"; + homepage = ""; + url = ""; + synopsis = "GHC BigNum library"; + description = "This package provides the low-level implementation of the standard\n'BigNat', 'Natural' and 'Integer' types."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + ]; + buildable = (if !flags.native && !flags.gmp && !flags.ffi + then false + else true) && (if flags.native && (flags.gmp || flags.ffi) + then false + else true) && (if flags.gmp && flags.ffi then false else true); + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-boot.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-boot.nix new file mode 100644 index 0000000000..bdb3851804 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-boot.nix @@ -0,0 +1,46 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-boot"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Shared functionality between GHC and its boot libraries"; + description = "This library is shared between GHC, ghc-pkg, and other boot\nlibraries.\n.\nA note about \"GHC.Unit.Database\": it only deals with the subset of\nthe package database that the compiler cares about: modules\npaths etc and not package metadata like description, authors\netc. It is thus not a library interface to ghc-pkg and is *not*\nsuitable for modifying GHC package databases.\n.\nThe package database format and this library are constructed in\nsuch a way that while ghc-pkg depends on Cabal, the GHC library\nand program do not have to depend on Cabal."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-heap.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-heap.nix new file mode 100644 index 0000000000..f8edabe13b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-heap.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-heap"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Functions for walking GHC's heap"; + description = "This package provides functions for walking the GHC heap data structures\nand retrieving information about those data structures."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-prim.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-prim.nix new file mode 100644 index 0000000000..a657675b58 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc-prim.nix @@ -0,0 +1,47 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.2"; + identifier = { name = "ghc-prim"; version = "0.10.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "GHC primitives"; + description = "This package contains the primitive types and operations supplied by GHC.\nIt is an internal package, only for the use of GHC developers.\nGHC users should not use it! If you do use it then expect\nbreaking changes at any time without warning. You should prefer\nto import @GHC.Exts@ from the @base@ package instead."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + ]; + }; + components = { + "library" = { + depends = [ (hsPkgs."rts" or (errorHandler.buildDepError "rts")) ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ucrt" or (errorHandler.sysDepError "ucrt")) + ] ++ pkgs.lib.optionals (system.isLinux) [ + (pkgs."c" or (errorHandler.sysDepError "c")) + (pkgs."m" or (errorHandler.sysDepError "m")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc.nix new file mode 100644 index 0000000000..cb75e00e5c --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghc.nix @@ -0,0 +1,69 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { + internal-interpreter = false; + dynamic-system-linker = true; + build-tool-depends = true; + }; + package = { + specVersion = "2.2"; + identifier = { name = "ghc"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "glasgow-haskell-users@haskell.org"; + author = "The GHC Team"; + homepage = "http://www.haskell.org/ghc/"; + url = ""; + synopsis = "The GHC API"; + description = "GHC's functionality can be useful for more things than just\ncompiling Haskell programs. Important use cases are programs\nthat analyse (and perhaps transform) Haskell code. Others\ninclude loading Haskell code dynamically in a GHCi-like manner.\nFor this reason, a lot of GHC's functionality is made available\nthrough this package.\n\nSee \nfor more information."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."hpc" or (errorHandler.buildDepError "hpc")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + (hsPkgs."exceptions" or (errorHandler.buildDepError "exceptions")) + (hsPkgs."stm" or (errorHandler.buildDepError "stm")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + (hsPkgs.pkgsBuildBuild.genprimopcode.components.exes.genprimopcode or (pkgs.pkgsBuildBuild.genprimopcode or (errorHandler.buildToolDepError "genprimopcode:genprimopcode"))) + (hsPkgs.pkgsBuildBuild.deriveConstants.components.exes.deriveConstants or (pkgs.pkgsBuildBuild.deriveConstants or (errorHandler.buildToolDepError "deriveConstants:deriveConstants"))) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghci.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghci.nix new file mode 100644 index 0000000000..3cc6975487 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/ghci.nix @@ -0,0 +1,45 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { internal-interpreter = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "ghci"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "The library supporting GHC's interactive interpreter"; + description = "This library offers interfaces which mediate interactions between the\n@ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter\nbackend."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/hpc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/hpc.nix new file mode 100644 index 0000000000..c9d84dfbb7 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/hpc.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "hpc"; version = "0.6.2.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = "Andy Gill"; + homepage = ""; + url = ""; + synopsis = "Code Coverage Library for Haskell"; + description = "This package provides the code coverage library for Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/integer-gmp.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/integer-gmp.nix new file mode 100644 index 0000000000..94f930e70e --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/integer-gmp.nix @@ -0,0 +1,35 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.0"; + identifier = { name = "integer-gmp"; version = "1.1"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "hvr@gnu.org"; + author = "Herbert Valerio Riedel"; + homepage = "https://www.haskell.org/ghc/"; + url = ""; + synopsis = "Integer library based on GMP"; + description = "This package used to provide an implementation of the standard 'Integer'\ntype based on the\n.\n\nIt is now deprecated in favor of the 'ghc-bignum' package.\n\nIts purpose is to provide backward compatibility for codes directly\ndepending on the `integer-gmp` package."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/iserv.nix new file mode 100644 index 0000000000..9badbbf56b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/iserv.nix @@ -0,0 +1,42 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "GHC can be provided with a path to the iserv binary with\n@-pgmi=/path/to/iserv-bin@, and will in combination with\n@-fexternal-interpreter@, compile Template Haskell though the\n@iserv-bin@ delegate. This is very similar to how ghcjs has been\ncompiling Template Haskell, by spawning a separate delegate (so\ncalled runner on the javascript vm) and evaluating the splices\nthere.\n\nTo use iserv with cross compilers, please see @libraries/libiserv@\nand @utils/iserv-proxy@."; + buildType = "Simple"; + }; + components = { + exes = { + "iserv" = { + depends = [ + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/libiserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/libiserv.nix new file mode 100644 index 0000000000..ffe0a9ee99 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/libiserv.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { network = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "libiserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Provides shared functionality between iserv and iserv-proxy."; + description = "Provides shared functionality between iserv and iserv-proxy."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/remote-iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/remote-iserv.nix new file mode 100644 index 0000000000..3431eb0712 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/remote-iserv.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "remote-iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "Moritz Angermann "; + author = "Moritz Angermann "; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "This is a very simple remote runner for iserv, to be used together\nwith iserv-proxy. The foundamental idea is that this this wrapper\nstarts running libiserv on a given port to which iserv-proxy will\nthen connect."; + buildType = "Simple"; + }; + components = { + exes = { + "remote-iserv" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/template-haskell.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/template-haskell.nix new file mode 100644 index 0000000000..693b8f6a78 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-aarch64/template-haskell.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "template-haskell"; version = "2.20.0.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Support library for Template Haskell"; + description = "This package provides modules containing facilities for manipulating\nHaskell source code using Template Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."pretty" or (errorHandler.buildDepError "pretty")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/base.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/base.nix new file mode 100644 index 0000000000..1f649a4341 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/base.nix @@ -0,0 +1,49 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "base"; version = "4.18.3.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "Core Libraries Committee "; + author = ""; + homepage = ""; + url = ""; + synopsis = "Core data structures and operations"; + description = "Haskell's base library provides, among other things, core types (e.g. [Bool](\"Data.Bool\") and [Int](\"Data.Int\")),\ndata structures (e.g. [List](\"Data.List\"), [Tuple](\"Data.Tuple\") and [Maybe](\"Data.Maybe\")),\nthe [Exception](\"Control.Exception\") mechanism, and the [IO](\"System.IO\") & [Concurrency](\"Control.Concurrent\") operations.\nThe \"Prelude\" module, which is imported by default, exposes a curated set of types and functions from other modules.\n\nOther data structures like [Map](https://hackage.haskell.org/package/containers/docs/Data-Map.html),\n[Set](https://hackage.haskell.org/package/containers/docs/Data-Set.html) are available in the [containers](https://hackage.haskell.org/package/containers) library.\nTo work with textual data, use the [text](https://hackage.haskell.org/package/text/docs/Data-Text.html) library."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."wsock32" or (errorHandler.sysDepError "wsock32")) + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."shell32" or (errorHandler.sysDepError "shell32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."kernel32" or (errorHandler.sysDepError "kernel32")) + (pkgs."advapi32" or (errorHandler.sysDepError "advapi32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ws2_32" or (errorHandler.sysDepError "ws2_32")) + (pkgs."shlwapi" or (errorHandler.sysDepError "shlwapi")) + (pkgs."ole32" or (errorHandler.sysDepError "ole32")) + (pkgs."rpcrt4" or (errorHandler.sysDepError "rpcrt4")) + (pkgs."ntdll" or (errorHandler.sysDepError "ntdll")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/deriveConstants.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/deriveConstants.nix new file mode 100644 index 0000000000..135cdd02f6 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/deriveConstants.nix @@ -0,0 +1,39 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "deriveConstants"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Derive header files containing various constants for the GHC build process"; + description = "This utility is responsible for generating a number of C header files\nneeded during the GHC build process. See @rts/include/ghc.mk@ in the GHC\nbuild system for details."; + buildType = "Simple"; + }; + components = { + exes = { + "deriveConstants" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/genprimopcode.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/genprimopcode.nix new file mode 100644 index 0000000000..49bbe516ba --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/genprimopcode.nix @@ -0,0 +1,40 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { build-tool-depends = true; }; + package = { + specVersion = "2.0"; + identifier = { name = "genprimopcode"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Generates various files implementing GHC's primitive operations."; + description = "This utility reads a textual description of GHC's primitive operations\n(@primops.txt.pp@) and produces a number of outputs. These include,\n\n* the @GHC.Prim@ module included in the @ghc-prim@ package.\n* the @GHC.PrimopWrappers@ module included in the @ghc-prim@ package.\n* an LaTeX document describing the primitive operations."; + buildType = "Simple"; + }; + components = { + exes = { + "genprimopcode" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + ]; + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-bignum.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-bignum.nix new file mode 100644 index 0000000000..46af6e0e9f --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-bignum.nix @@ -0,0 +1,37 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { native = false; ffi = false; gmp = false; check = false; }; + package = { + specVersion = "2.0"; + identifier = { name = "ghc-bignum"; version = "1.3"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = "Sylvain Henry"; + homepage = ""; + url = ""; + synopsis = "GHC BigNum library"; + description = "This package provides the low-level implementation of the standard\n'BigNat', 'Natural' and 'Integer' types."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + ]; + buildable = (if !flags.native && !flags.gmp && !flags.ffi + then false + else true) && (if flags.native && (flags.gmp || flags.ffi) + then false + else true) && (if flags.gmp && flags.ffi then false else true); + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-boot.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-boot.nix new file mode 100644 index 0000000000..bdb3851804 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-boot.nix @@ -0,0 +1,46 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-boot"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Shared functionality between GHC and its boot libraries"; + description = "This library is shared between GHC, ghc-pkg, and other boot\nlibraries.\n.\nA note about \"GHC.Unit.Database\": it only deals with the subset of\nthe package database that the compiler cares about: modules\npaths etc and not package metadata like description, authors\netc. It is thus not a library interface to ghc-pkg and is *not*\nsuitable for modifying GHC package databases.\n.\nThe package database format and this library are constructed in\nsuch a way that while ghc-pkg depends on Cabal, the GHC library\nand program do not have to depend on Cabal."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-heap.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-heap.nix new file mode 100644 index 0000000000..f8edabe13b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-heap.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-heap"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Functions for walking GHC's heap"; + description = "This package provides functions for walking the GHC heap data structures\nand retrieving information about those data structures."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-prim.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-prim.nix new file mode 100644 index 0000000000..a657675b58 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc-prim.nix @@ -0,0 +1,47 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.2"; + identifier = { name = "ghc-prim"; version = "0.10.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "GHC primitives"; + description = "This package contains the primitive types and operations supplied by GHC.\nIt is an internal package, only for the use of GHC developers.\nGHC users should not use it! If you do use it then expect\nbreaking changes at any time without warning. You should prefer\nto import @GHC.Exts@ from the @base@ package instead."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + ]; + }; + components = { + "library" = { + depends = [ (hsPkgs."rts" or (errorHandler.buildDepError "rts")) ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ucrt" or (errorHandler.sysDepError "ucrt")) + ] ++ pkgs.lib.optionals (system.isLinux) [ + (pkgs."c" or (errorHandler.sysDepError "c")) + (pkgs."m" or (errorHandler.sysDepError "m")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc.nix new file mode 100644 index 0000000000..cb75e00e5c --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghc.nix @@ -0,0 +1,69 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { + internal-interpreter = false; + dynamic-system-linker = true; + build-tool-depends = true; + }; + package = { + specVersion = "2.2"; + identifier = { name = "ghc"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "glasgow-haskell-users@haskell.org"; + author = "The GHC Team"; + homepage = "http://www.haskell.org/ghc/"; + url = ""; + synopsis = "The GHC API"; + description = "GHC's functionality can be useful for more things than just\ncompiling Haskell programs. Important use cases are programs\nthat analyse (and perhaps transform) Haskell code. Others\ninclude loading Haskell code dynamically in a GHCi-like manner.\nFor this reason, a lot of GHC's functionality is made available\nthrough this package.\n\nSee \nfor more information."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."hpc" or (errorHandler.buildDepError "hpc")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + (hsPkgs."exceptions" or (errorHandler.buildDepError "exceptions")) + (hsPkgs."stm" or (errorHandler.buildDepError "stm")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + (hsPkgs.pkgsBuildBuild.genprimopcode.components.exes.genprimopcode or (pkgs.pkgsBuildBuild.genprimopcode or (errorHandler.buildToolDepError "genprimopcode:genprimopcode"))) + (hsPkgs.pkgsBuildBuild.deriveConstants.components.exes.deriveConstants or (pkgs.pkgsBuildBuild.deriveConstants or (errorHandler.buildToolDepError "deriveConstants:deriveConstants"))) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghci.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghci.nix new file mode 100644 index 0000000000..3cc6975487 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/ghci.nix @@ -0,0 +1,45 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { internal-interpreter = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "ghci"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "The library supporting GHC's interactive interpreter"; + description = "This library offers interfaces which mediate interactions between the\n@ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter\nbackend."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/hpc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/hpc.nix new file mode 100644 index 0000000000..c9d84dfbb7 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/hpc.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "hpc"; version = "0.6.2.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = "Andy Gill"; + homepage = ""; + url = ""; + synopsis = "Code Coverage Library for Haskell"; + description = "This package provides the code coverage library for Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/integer-gmp.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/integer-gmp.nix new file mode 100644 index 0000000000..94f930e70e --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/integer-gmp.nix @@ -0,0 +1,35 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.0"; + identifier = { name = "integer-gmp"; version = "1.1"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "hvr@gnu.org"; + author = "Herbert Valerio Riedel"; + homepage = "https://www.haskell.org/ghc/"; + url = ""; + synopsis = "Integer library based on GMP"; + description = "This package used to provide an implementation of the standard 'Integer'\ntype based on the\n.\n\nIt is now deprecated in favor of the 'ghc-bignum' package.\n\nIts purpose is to provide backward compatibility for codes directly\ndepending on the `integer-gmp` package."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/iserv.nix new file mode 100644 index 0000000000..2c395adde1 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/iserv.nix @@ -0,0 +1,41 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "GHC can be provided with a path to the iserv binary with\n@-pgmi=/path/to/iserv-bin@, and will in combination with\n@-fexternal-interpreter@, compile Template Haskell though the\n@iserv-bin@ delegate. This is very similar to how ghcjs has been\ncompiling Template Haskell, by spawning a separate delegate (so\ncalled runner on the javascript vm) and evaluating the splices\nthere."; + buildType = "Simple"; + }; + components = { + exes = { + "iserv" = { + depends = [ + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/remote-iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/remote-iserv.nix new file mode 100644 index 0000000000..10eadced2c --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/remote-iserv.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "remote-iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "Moritz Angermann "; + author = "Moritz Angermann "; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "This is a very simple remote runner for iserv, to be used together\nwith iserv-proxy. The foundamental idea is that this this wrapper\nstarts running the GHCi server on a given port to which iserv-proxy will\nthen connect."; + buildType = "Simple"; + }; + components = { + exes = { + "remote-iserv" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/template-haskell.nix b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/template-haskell.nix new file mode 100644 index 0000000000..693b8f6a78 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227-ghcjs/template-haskell.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "template-haskell"; version = "2.20.0.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Support library for Template Haskell"; + description = "This package provides modules containing facilities for manipulating\nHaskell source code using Template Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."pretty" or (errorHandler.buildDepError "pretty")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/base.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/base.nix new file mode 100644 index 0000000000..1f649a4341 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/base.nix @@ -0,0 +1,49 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "base"; version = "4.18.3.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "Core Libraries Committee "; + author = ""; + homepage = ""; + url = ""; + synopsis = "Core data structures and operations"; + description = "Haskell's base library provides, among other things, core types (e.g. [Bool](\"Data.Bool\") and [Int](\"Data.Int\")),\ndata structures (e.g. [List](\"Data.List\"), [Tuple](\"Data.Tuple\") and [Maybe](\"Data.Maybe\")),\nthe [Exception](\"Control.Exception\") mechanism, and the [IO](\"System.IO\") & [Concurrency](\"Control.Concurrent\") operations.\nThe \"Prelude\" module, which is imported by default, exposes a curated set of types and functions from other modules.\n\nOther data structures like [Map](https://hackage.haskell.org/package/containers/docs/Data-Map.html),\n[Set](https://hackage.haskell.org/package/containers/docs/Data-Set.html) are available in the [containers](https://hackage.haskell.org/package/containers) library.\nTo work with textual data, use the [text](https://hackage.haskell.org/package/text/docs/Data-Text.html) library."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."wsock32" or (errorHandler.sysDepError "wsock32")) + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."shell32" or (errorHandler.sysDepError "shell32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."kernel32" or (errorHandler.sysDepError "kernel32")) + (pkgs."advapi32" or (errorHandler.sysDepError "advapi32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ws2_32" or (errorHandler.sysDepError "ws2_32")) + (pkgs."shlwapi" or (errorHandler.sysDepError "shlwapi")) + (pkgs."ole32" or (errorHandler.sysDepError "ole32")) + (pkgs."rpcrt4" or (errorHandler.sysDepError "rpcrt4")) + (pkgs."ntdll" or (errorHandler.sysDepError "ntdll")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/deriveConstants.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/deriveConstants.nix new file mode 100644 index 0000000000..135cdd02f6 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/deriveConstants.nix @@ -0,0 +1,39 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "deriveConstants"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Derive header files containing various constants for the GHC build process"; + description = "This utility is responsible for generating a number of C header files\nneeded during the GHC build process. See @rts/include/ghc.mk@ in the GHC\nbuild system for details."; + buildType = "Simple"; + }; + components = { + exes = { + "deriveConstants" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/genprimopcode.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/genprimopcode.nix new file mode 100644 index 0000000000..49bbe516ba --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/genprimopcode.nix @@ -0,0 +1,40 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { build-tool-depends = true; }; + package = { + specVersion = "2.0"; + identifier = { name = "genprimopcode"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Generates various files implementing GHC's primitive operations."; + description = "This utility reads a textual description of GHC's primitive operations\n(@primops.txt.pp@) and produces a number of outputs. These include,\n\n* the @GHC.Prim@ module included in the @ghc-prim@ package.\n* the @GHC.PrimopWrappers@ module included in the @ghc-prim@ package.\n* an LaTeX document describing the primitive operations."; + buildType = "Simple"; + }; + components = { + exes = { + "genprimopcode" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + ]; + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-bignum.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-bignum.nix new file mode 100644 index 0000000000..46af6e0e9f --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-bignum.nix @@ -0,0 +1,37 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { native = false; ffi = false; gmp = false; check = false; }; + package = { + specVersion = "2.0"; + identifier = { name = "ghc-bignum"; version = "1.3"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = "Sylvain Henry"; + homepage = ""; + url = ""; + synopsis = "GHC BigNum library"; + description = "This package provides the low-level implementation of the standard\n'BigNat', 'Natural' and 'Integer' types."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + ]; + buildable = (if !flags.native && !flags.gmp && !flags.ffi + then false + else true) && (if flags.native && (flags.gmp || flags.ffi) + then false + else true) && (if flags.gmp && flags.ffi then false else true); + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-boot.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-boot.nix new file mode 100644 index 0000000000..bdb3851804 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-boot.nix @@ -0,0 +1,46 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-boot"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Shared functionality between GHC and its boot libraries"; + description = "This library is shared between GHC, ghc-pkg, and other boot\nlibraries.\n.\nA note about \"GHC.Unit.Database\": it only deals with the subset of\nthe package database that the compiler cares about: modules\npaths etc and not package metadata like description, authors\netc. It is thus not a library interface to ghc-pkg and is *not*\nsuitable for modifying GHC package databases.\n.\nThe package database format and this library are constructed in\nsuch a way that while ghc-pkg depends on Cabal, the GHC library\nand program do not have to depend on Cabal."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-heap.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-heap.nix new file mode 100644 index 0000000000..f8edabe13b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-heap.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-heap"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Functions for walking GHC's heap"; + description = "This package provides functions for walking the GHC heap data structures\nand retrieving information about those data structures."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-prim.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-prim.nix new file mode 100644 index 0000000000..a657675b58 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc-prim.nix @@ -0,0 +1,47 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.2"; + identifier = { name = "ghc-prim"; version = "0.10.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "GHC primitives"; + description = "This package contains the primitive types and operations supplied by GHC.\nIt is an internal package, only for the use of GHC developers.\nGHC users should not use it! If you do use it then expect\nbreaking changes at any time without warning. You should prefer\nto import @GHC.Exts@ from the @base@ package instead."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + ]; + }; + components = { + "library" = { + depends = [ (hsPkgs."rts" or (errorHandler.buildDepError "rts")) ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ucrt" or (errorHandler.sysDepError "ucrt")) + ] ++ pkgs.lib.optionals (system.isLinux) [ + (pkgs."c" or (errorHandler.sysDepError "c")) + (pkgs."m" or (errorHandler.sysDepError "m")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/ghc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc.nix new file mode 100644 index 0000000000..cb75e00e5c --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/ghc.nix @@ -0,0 +1,69 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { + internal-interpreter = false; + dynamic-system-linker = true; + build-tool-depends = true; + }; + package = { + specVersion = "2.2"; + identifier = { name = "ghc"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "glasgow-haskell-users@haskell.org"; + author = "The GHC Team"; + homepage = "http://www.haskell.org/ghc/"; + url = ""; + synopsis = "The GHC API"; + description = "GHC's functionality can be useful for more things than just\ncompiling Haskell programs. Important use cases are programs\nthat analyse (and perhaps transform) Haskell code. Others\ninclude loading Haskell code dynamically in a GHCi-like manner.\nFor this reason, a lot of GHC's functionality is made available\nthrough this package.\n\nSee \nfor more information."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."hpc" or (errorHandler.buildDepError "hpc")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + (hsPkgs."exceptions" or (errorHandler.buildDepError "exceptions")) + (hsPkgs."stm" or (errorHandler.buildDepError "stm")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + (hsPkgs.pkgsBuildBuild.genprimopcode.components.exes.genprimopcode or (pkgs.pkgsBuildBuild.genprimopcode or (errorHandler.buildToolDepError "genprimopcode:genprimopcode"))) + (hsPkgs.pkgsBuildBuild.deriveConstants.components.exes.deriveConstants or (pkgs.pkgsBuildBuild.deriveConstants or (errorHandler.buildToolDepError "deriveConstants:deriveConstants"))) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/ghci.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/ghci.nix new file mode 100644 index 0000000000..3cc6975487 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/ghci.nix @@ -0,0 +1,45 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { internal-interpreter = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "ghci"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "The library supporting GHC's interactive interpreter"; + description = "This library offers interfaces which mediate interactions between the\n@ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter\nbackend."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/hpc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/hpc.nix new file mode 100644 index 0000000000..c9d84dfbb7 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/hpc.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "hpc"; version = "0.6.2.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = "Andy Gill"; + homepage = ""; + url = ""; + synopsis = "Code Coverage Library for Haskell"; + description = "This package provides the code coverage library for Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/integer-gmp.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/integer-gmp.nix new file mode 100644 index 0000000000..94f930e70e --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/integer-gmp.nix @@ -0,0 +1,35 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.0"; + identifier = { name = "integer-gmp"; version = "1.1"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "hvr@gnu.org"; + author = "Herbert Valerio Riedel"; + homepage = "https://www.haskell.org/ghc/"; + url = ""; + synopsis = "Integer library based on GMP"; + description = "This package used to provide an implementation of the standard 'Integer'\ntype based on the\n.\n\nIt is now deprecated in favor of the 'ghc-bignum' package.\n\nIts purpose is to provide backward compatibility for codes directly\ndepending on the `integer-gmp` package."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/iserv.nix new file mode 100644 index 0000000000..9badbbf56b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/iserv.nix @@ -0,0 +1,42 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "GHC can be provided with a path to the iserv binary with\n@-pgmi=/path/to/iserv-bin@, and will in combination with\n@-fexternal-interpreter@, compile Template Haskell though the\n@iserv-bin@ delegate. This is very similar to how ghcjs has been\ncompiling Template Haskell, by spawning a separate delegate (so\ncalled runner on the javascript vm) and evaluating the splices\nthere.\n\nTo use iserv with cross compilers, please see @libraries/libiserv@\nand @utils/iserv-proxy@."; + buildType = "Simple"; + }; + components = { + exes = { + "iserv" = { + depends = [ + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/libiserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/libiserv.nix new file mode 100644 index 0000000000..ffe0a9ee99 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/libiserv.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { network = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "libiserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Provides shared functionality between iserv and iserv-proxy."; + description = "Provides shared functionality between iserv and iserv-proxy."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/remote-iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/remote-iserv.nix new file mode 100644 index 0000000000..3431eb0712 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/remote-iserv.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "remote-iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "Moritz Angermann "; + author = "Moritz Angermann "; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "This is a very simple remote runner for iserv, to be used together\nwith iserv-proxy. The foundamental idea is that this this wrapper\nstarts running libiserv on a given port to which iserv-proxy will\nthen connect."; + buildType = "Simple"; + }; + components = { + exes = { + "remote-iserv" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227/template-haskell.nix b/materialized/ghc-boot-packages-nix/ghc96720250227/template-haskell.nix new file mode 100644 index 0000000000..693b8f6a78 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227/template-haskell.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "template-haskell"; version = "2.20.0.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Support library for Template Haskell"; + description = "This package provides modules containing facilities for manipulating\nHaskell source code using Template Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."pretty" or (errorHandler.buildDepError "pretty")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/base.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/base.nix new file mode 100644 index 0000000000..1f649a4341 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/base.nix @@ -0,0 +1,49 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "base"; version = "4.18.3.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "Core Libraries Committee "; + author = ""; + homepage = ""; + url = ""; + synopsis = "Core data structures and operations"; + description = "Haskell's base library provides, among other things, core types (e.g. [Bool](\"Data.Bool\") and [Int](\"Data.Int\")),\ndata structures (e.g. [List](\"Data.List\"), [Tuple](\"Data.Tuple\") and [Maybe](\"Data.Maybe\")),\nthe [Exception](\"Control.Exception\") mechanism, and the [IO](\"System.IO\") & [Concurrency](\"Control.Concurrent\") operations.\nThe \"Prelude\" module, which is imported by default, exposes a curated set of types and functions from other modules.\n\nOther data structures like [Map](https://hackage.haskell.org/package/containers/docs/Data-Map.html),\n[Set](https://hackage.haskell.org/package/containers/docs/Data-Set.html) are available in the [containers](https://hackage.haskell.org/package/containers) library.\nTo work with textual data, use the [text](https://hackage.haskell.org/package/text/docs/Data-Text.html) library."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."wsock32" or (errorHandler.sysDepError "wsock32")) + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."shell32" or (errorHandler.sysDepError "shell32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."kernel32" or (errorHandler.sysDepError "kernel32")) + (pkgs."advapi32" or (errorHandler.sysDepError "advapi32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ws2_32" or (errorHandler.sysDepError "ws2_32")) + (pkgs."shlwapi" or (errorHandler.sysDepError "shlwapi")) + (pkgs."ole32" or (errorHandler.sysDepError "ole32")) + (pkgs."rpcrt4" or (errorHandler.sysDepError "rpcrt4")) + (pkgs."ntdll" or (errorHandler.sysDepError "ntdll")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/deriveConstants.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/deriveConstants.nix new file mode 100644 index 0000000000..135cdd02f6 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/deriveConstants.nix @@ -0,0 +1,39 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "deriveConstants"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Derive header files containing various constants for the GHC build process"; + description = "This utility is responsible for generating a number of C header files\nneeded during the GHC build process. See @rts/include/ghc.mk@ in the GHC\nbuild system for details."; + buildType = "Simple"; + }; + components = { + exes = { + "deriveConstants" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/genprimopcode.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/genprimopcode.nix new file mode 100644 index 0000000000..49bbe516ba --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/genprimopcode.nix @@ -0,0 +1,40 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { build-tool-depends = true; }; + package = { + specVersion = "2.0"; + identifier = { name = "genprimopcode"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Generates various files implementing GHC's primitive operations."; + description = "This utility reads a textual description of GHC's primitive operations\n(@primops.txt.pp@) and produces a number of outputs. These include,\n\n* the @GHC.Prim@ module included in the @ghc-prim@ package.\n* the @GHC.PrimopWrappers@ module included in the @ghc-prim@ package.\n* an LaTeX document describing the primitive operations."; + buildType = "Simple"; + }; + components = { + exes = { + "genprimopcode" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + ]; + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-bignum.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-bignum.nix new file mode 100644 index 0000000000..46af6e0e9f --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-bignum.nix @@ -0,0 +1,37 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { native = false; ffi = false; gmp = false; check = false; }; + package = { + specVersion = "2.0"; + identifier = { name = "ghc-bignum"; version = "1.3"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = "Sylvain Henry"; + homepage = ""; + url = ""; + synopsis = "GHC BigNum library"; + description = "This package provides the low-level implementation of the standard\n'BigNat', 'Natural' and 'Integer' types."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + ]; + buildable = (if !flags.native && !flags.gmp && !flags.ffi + then false + else true) && (if flags.native && (flags.gmp || flags.ffi) + then false + else true) && (if flags.gmp && flags.ffi then false else true); + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-boot.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-boot.nix new file mode 100644 index 0000000000..bdb3851804 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-boot.nix @@ -0,0 +1,46 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-boot"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Shared functionality between GHC and its boot libraries"; + description = "This library is shared between GHC, ghc-pkg, and other boot\nlibraries.\n.\nA note about \"GHC.Unit.Database\": it only deals with the subset of\nthe package database that the compiler cares about: modules\npaths etc and not package metadata like description, authors\netc. It is thus not a library interface to ghc-pkg and is *not*\nsuitable for modifying GHC package databases.\n.\nThe package database format and this library are constructed in\nsuch a way that while ghc-pkg depends on Cabal, the GHC library\nand program do not have to depend on Cabal."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-heap.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-heap.nix new file mode 100644 index 0000000000..f8edabe13b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-heap.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-heap"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Functions for walking GHC's heap"; + description = "This package provides functions for walking the GHC heap data structures\nand retrieving information about those data structures."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-prim.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-prim.nix new file mode 100644 index 0000000000..a657675b58 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc-prim.nix @@ -0,0 +1,47 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.2"; + identifier = { name = "ghc-prim"; version = "0.10.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "GHC primitives"; + description = "This package contains the primitive types and operations supplied by GHC.\nIt is an internal package, only for the use of GHC developers.\nGHC users should not use it! If you do use it then expect\nbreaking changes at any time without warning. You should prefer\nto import @GHC.Exts@ from the @base@ package instead."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + ]; + }; + components = { + "library" = { + depends = [ (hsPkgs."rts" or (errorHandler.buildDepError "rts")) ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ucrt" or (errorHandler.sysDepError "ucrt")) + ] ++ pkgs.lib.optionals (system.isLinux) [ + (pkgs."c" or (errorHandler.sysDepError "c")) + (pkgs."m" or (errorHandler.sysDepError "m")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc.nix new file mode 100644 index 0000000000..cb75e00e5c --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghc.nix @@ -0,0 +1,69 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { + internal-interpreter = false; + dynamic-system-linker = true; + build-tool-depends = true; + }; + package = { + specVersion = "2.2"; + identifier = { name = "ghc"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "glasgow-haskell-users@haskell.org"; + author = "The GHC Team"; + homepage = "http://www.haskell.org/ghc/"; + url = ""; + synopsis = "The GHC API"; + description = "GHC's functionality can be useful for more things than just\ncompiling Haskell programs. Important use cases are programs\nthat analyse (and perhaps transform) Haskell code. Others\ninclude loading Haskell code dynamically in a GHCi-like manner.\nFor this reason, a lot of GHC's functionality is made available\nthrough this package.\n\nSee \nfor more information."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."hpc" or (errorHandler.buildDepError "hpc")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + (hsPkgs."exceptions" or (errorHandler.buildDepError "exceptions")) + (hsPkgs."stm" or (errorHandler.buildDepError "stm")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + (hsPkgs.pkgsBuildBuild.genprimopcode.components.exes.genprimopcode or (pkgs.pkgsBuildBuild.genprimopcode or (errorHandler.buildToolDepError "genprimopcode:genprimopcode"))) + (hsPkgs.pkgsBuildBuild.deriveConstants.components.exes.deriveConstants or (pkgs.pkgsBuildBuild.deriveConstants or (errorHandler.buildToolDepError "deriveConstants:deriveConstants"))) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghci.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghci.nix new file mode 100644 index 0000000000..3cc6975487 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/ghci.nix @@ -0,0 +1,45 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { internal-interpreter = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "ghci"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "The library supporting GHC's interactive interpreter"; + description = "This library offers interfaces which mediate interactions between the\n@ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter\nbackend."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/hpc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/hpc.nix new file mode 100644 index 0000000000..c9d84dfbb7 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/hpc.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "hpc"; version = "0.6.2.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = "Andy Gill"; + homepage = ""; + url = ""; + synopsis = "Code Coverage Library for Haskell"; + description = "This package provides the code coverage library for Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/integer-gmp.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/integer-gmp.nix new file mode 100644 index 0000000000..94f930e70e --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/integer-gmp.nix @@ -0,0 +1,35 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.0"; + identifier = { name = "integer-gmp"; version = "1.1"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "hvr@gnu.org"; + author = "Herbert Valerio Riedel"; + homepage = "https://www.haskell.org/ghc/"; + url = ""; + synopsis = "Integer library based on GMP"; + description = "This package used to provide an implementation of the standard 'Integer'\ntype based on the\n.\n\nIt is now deprecated in favor of the 'ghc-bignum' package.\n\nIts purpose is to provide backward compatibility for codes directly\ndepending on the `integer-gmp` package."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/iserv.nix new file mode 100644 index 0000000000..9badbbf56b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/iserv.nix @@ -0,0 +1,42 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "GHC can be provided with a path to the iserv binary with\n@-pgmi=/path/to/iserv-bin@, and will in combination with\n@-fexternal-interpreter@, compile Template Haskell though the\n@iserv-bin@ delegate. This is very similar to how ghcjs has been\ncompiling Template Haskell, by spawning a separate delegate (so\ncalled runner on the javascript vm) and evaluating the splices\nthere.\n\nTo use iserv with cross compilers, please see @libraries/libiserv@\nand @utils/iserv-proxy@."; + buildType = "Simple"; + }; + components = { + exes = { + "iserv" = { + depends = [ + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/libiserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/libiserv.nix new file mode 100644 index 0000000000..ffe0a9ee99 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/libiserv.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { network = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "libiserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Provides shared functionality between iserv and iserv-proxy."; + description = "Provides shared functionality between iserv and iserv-proxy."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/remote-iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/remote-iserv.nix new file mode 100644 index 0000000000..3431eb0712 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/remote-iserv.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "remote-iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "Moritz Angermann "; + author = "Moritz Angermann "; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "This is a very simple remote runner for iserv, to be used together\nwith iserv-proxy. The foundamental idea is that this this wrapper\nstarts running libiserv on a given port to which iserv-proxy will\nthen connect."; + buildType = "Simple"; + }; + components = { + exes = { + "remote-iserv" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/template-haskell.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/template-haskell.nix new file mode 100644 index 0000000000..693b8f6a78 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm-aarch64/template-haskell.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "template-haskell"; version = "2.20.0.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Support library for Template Haskell"; + description = "This package provides modules containing facilities for manipulating\nHaskell source code using Template Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."pretty" or (errorHandler.buildDepError "pretty")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/base.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/base.nix new file mode 100644 index 0000000000..1f649a4341 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/base.nix @@ -0,0 +1,49 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "base"; version = "4.18.3.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "Core Libraries Committee "; + author = ""; + homepage = ""; + url = ""; + synopsis = "Core data structures and operations"; + description = "Haskell's base library provides, among other things, core types (e.g. [Bool](\"Data.Bool\") and [Int](\"Data.Int\")),\ndata structures (e.g. [List](\"Data.List\"), [Tuple](\"Data.Tuple\") and [Maybe](\"Data.Maybe\")),\nthe [Exception](\"Control.Exception\") mechanism, and the [IO](\"System.IO\") & [Concurrency](\"Control.Concurrent\") operations.\nThe \"Prelude\" module, which is imported by default, exposes a curated set of types and functions from other modules.\n\nOther data structures like [Map](https://hackage.haskell.org/package/containers/docs/Data-Map.html),\n[Set](https://hackage.haskell.org/package/containers/docs/Data-Set.html) are available in the [containers](https://hackage.haskell.org/package/containers) library.\nTo work with textual data, use the [text](https://hackage.haskell.org/package/text/docs/Data-Text.html) library."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."wsock32" or (errorHandler.sysDepError "wsock32")) + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."shell32" or (errorHandler.sysDepError "shell32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."kernel32" or (errorHandler.sysDepError "kernel32")) + (pkgs."advapi32" or (errorHandler.sysDepError "advapi32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ws2_32" or (errorHandler.sysDepError "ws2_32")) + (pkgs."shlwapi" or (errorHandler.sysDepError "shlwapi")) + (pkgs."ole32" or (errorHandler.sysDepError "ole32")) + (pkgs."rpcrt4" or (errorHandler.sysDepError "rpcrt4")) + (pkgs."ntdll" or (errorHandler.sysDepError "ntdll")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/deriveConstants.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/deriveConstants.nix new file mode 100644 index 0000000000..135cdd02f6 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/deriveConstants.nix @@ -0,0 +1,39 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "deriveConstants"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Derive header files containing various constants for the GHC build process"; + description = "This utility is responsible for generating a number of C header files\nneeded during the GHC build process. See @rts/include/ghc.mk@ in the GHC\nbuild system for details."; + buildType = "Simple"; + }; + components = { + exes = { + "deriveConstants" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/genprimopcode.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/genprimopcode.nix new file mode 100644 index 0000000000..49bbe516ba --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/genprimopcode.nix @@ -0,0 +1,40 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { build-tool-depends = true; }; + package = { + specVersion = "2.0"; + identifier = { name = "genprimopcode"; version = "0.1"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Generates various files implementing GHC's primitive operations."; + description = "This utility reads a textual description of GHC's primitive operations\n(@primops.txt.pp@) and produces a number of outputs. These include,\n\n* the @GHC.Prim@ module included in the @ghc-prim@ package.\n* the @GHC.PrimopWrappers@ module included in the @ghc-prim@ package.\n* an LaTeX document describing the primitive operations."; + buildType = "Simple"; + }; + components = { + exes = { + "genprimopcode" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + ]; + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-bignum.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-bignum.nix new file mode 100644 index 0000000000..46af6e0e9f --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-bignum.nix @@ -0,0 +1,37 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { native = false; ffi = false; gmp = false; check = false; }; + package = { + specVersion = "2.0"; + identifier = { name = "ghc-bignum"; version = "1.3"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = "Sylvain Henry"; + homepage = ""; + url = ""; + synopsis = "GHC BigNum library"; + description = "This package provides the low-level implementation of the standard\n'BigNat', 'Natural' and 'Integer' types."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + ]; + buildable = (if !flags.native && !flags.gmp && !flags.ffi + then false + else true) && (if flags.native && (flags.gmp || flags.ffi) + then false + else true) && (if flags.gmp && flags.ffi then false else true); + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-boot.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-boot.nix new file mode 100644 index 0000000000..bdb3851804 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-boot.nix @@ -0,0 +1,46 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-boot"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Shared functionality between GHC and its boot libraries"; + description = "This library is shared between GHC, ghc-pkg, and other boot\nlibraries.\n.\nA note about \"GHC.Unit.Database\": it only deals with the subset of\nthe package database that the compiler cares about: modules\npaths etc and not package metadata like description, authors\netc. It is thus not a library interface to ghc-pkg and is *not*\nsuitable for modifying GHC package databases.\n.\nThe package database format and this library are constructed in\nsuch a way that while ghc-pkg depends on Cabal, the GHC library\nand program do not have to depend on Cabal."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-heap.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-heap.nix new file mode 100644 index 0000000000..f8edabe13b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-heap.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "3.0"; + identifier = { name = "ghc-heap"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Functions for walking GHC's heap"; + description = "This package provides functions for walking the GHC heap data structures\nand retrieving information about those data structures."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-prim.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-prim.nix new file mode 100644 index 0000000000..a657675b58 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc-prim.nix @@ -0,0 +1,47 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.2"; + identifier = { name = "ghc-prim"; version = "0.10.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "GHC primitives"; + description = "This package contains the primitive types and operations supplied by GHC.\nIt is an internal package, only for the use of GHC developers.\nGHC users should not use it! If you do use it then expect\nbreaking changes at any time without warning. You should prefer\nto import @GHC.Exts@ from the @base@ package instead."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + ]; + }; + components = { + "library" = { + depends = [ (hsPkgs."rts" or (errorHandler.buildDepError "rts")) ]; + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."user32" or (errorHandler.sysDepError "user32")) + (pkgs."mingw32" or (errorHandler.sysDepError "mingw32")) + (pkgs."mingwex" or (errorHandler.sysDepError "mingwex")) + (pkgs."ucrt" or (errorHandler.sysDepError "ucrt")) + ] ++ pkgs.lib.optionals (system.isLinux) [ + (pkgs."c" or (errorHandler.sysDepError "c")) + (pkgs."m" or (errorHandler.sysDepError "m")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc.nix new file mode 100644 index 0000000000..cb75e00e5c --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghc.nix @@ -0,0 +1,69 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { + internal-interpreter = false; + dynamic-system-linker = true; + build-tool-depends = true; + }; + package = { + specVersion = "2.2"; + identifier = { name = "ghc"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "glasgow-haskell-users@haskell.org"; + author = "The GHC Team"; + homepage = "http://www.haskell.org/ghc/"; + url = ""; + synopsis = "The GHC API"; + description = "GHC's functionality can be useful for more things than just\ncompiling Haskell programs. Important use cases are programs\nthat analyse (and perhaps transform) Haskell code. Others\ninclude loading Haskell code dynamically in a GHCi-like manner.\nFor this reason, a lot of GHC's functionality is made available\nthrough this package.\n\nSee \nfor more information."; + buildType = "Custom"; + setup-depends = [ + (hsPkgs.pkgsBuildBuild.base or (pkgs.pkgsBuildBuild.base or (errorHandler.setupDepError "base"))) + (hsPkgs.pkgsBuildBuild.Cabal or (pkgs.pkgsBuildBuild.Cabal or (errorHandler.setupDepError "Cabal"))) + (hsPkgs.pkgsBuildBuild.directory or (pkgs.pkgsBuildBuild.directory or (errorHandler.setupDepError "directory"))) + (hsPkgs.pkgsBuildBuild.process or (pkgs.pkgsBuildBuild.process or (errorHandler.setupDepError "process"))) + (hsPkgs.pkgsBuildBuild.filepath or (pkgs.pkgsBuildBuild.filepath or (errorHandler.setupDepError "filepath"))) + ]; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."hpc" or (errorHandler.buildDepError "hpc")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + (hsPkgs."exceptions" or (errorHandler.buildDepError "exceptions")) + (hsPkgs."stm" or (errorHandler.buildDepError "stm")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + build-tools = pkgs.lib.optionals (flags.build-tool-depends) [ + (hsPkgs.pkgsBuildBuild.alex.components.exes.alex or (pkgs.pkgsBuildBuild.alex or (errorHandler.buildToolDepError "alex:alex"))) + (hsPkgs.pkgsBuildBuild.happy.components.exes.happy or (pkgs.pkgsBuildBuild.happy or (errorHandler.buildToolDepError "happy:happy"))) + (hsPkgs.pkgsBuildBuild.genprimopcode.components.exes.genprimopcode or (pkgs.pkgsBuildBuild.genprimopcode or (errorHandler.buildToolDepError "genprimopcode:genprimopcode"))) + (hsPkgs.pkgsBuildBuild.deriveConstants.components.exes.deriveConstants or (pkgs.pkgsBuildBuild.deriveConstants or (errorHandler.buildToolDepError "deriveConstants:deriveConstants"))) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghci.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghci.nix new file mode 100644 index 0000000000..3cc6975487 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/ghci.nix @@ -0,0 +1,45 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { internal-interpreter = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "ghci"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "The library supporting GHC's interactive interpreter"; + description = "This library offers interfaces which mediate interactions between the\n@ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter\nbackend."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."rts" or (errorHandler.buildDepError "rts")) + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."ghc-boot" or (errorHandler.buildDepError "ghc-boot")) + (hsPkgs."ghc-heap" or (errorHandler.buildDepError "ghc-heap")) + (hsPkgs."template-haskell" or (errorHandler.buildDepError "template-haskell")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/hpc.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/hpc.nix new file mode 100644 index 0000000000..c9d84dfbb7 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/hpc.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "hpc"; version = "0.6.2.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "ghc-devs@haskell.org"; + author = "Andy Gill"; + homepage = ""; + url = ""; + synopsis = "Code Coverage Library for Haskell"; + description = "This package provides the code coverage library for Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/integer-gmp.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/integer-gmp.nix new file mode 100644 index 0000000000..94f930e70e --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/integer-gmp.nix @@ -0,0 +1,35 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "2.0"; + identifier = { name = "integer-gmp"; version = "1.1"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "hvr@gnu.org"; + author = "Herbert Valerio Riedel"; + homepage = "https://www.haskell.org/ghc/"; + url = ""; + synopsis = "Integer library based on GMP"; + description = "This package used to provide an implementation of the standard 'Integer'\ntype based on the\n.\n\nIt is now deprecated in favor of the 'ghc-bignum' package.\n\nIts purpose is to provide backward compatibility for codes directly\ndepending on the `integer-gmp` package."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."ghc-bignum" or (errorHandler.buildDepError "ghc-bignum")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/iserv.nix new file mode 100644 index 0000000000..9badbbf56b --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/iserv.nix @@ -0,0 +1,42 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "GHC can be provided with a path to the iserv binary with\n@-pgmi=/path/to/iserv-bin@, and will in combination with\n@-fexternal-interpreter@, compile Template Haskell though the\n@iserv-bin@ delegate. This is very similar to how ghcjs has been\ncompiling Template Haskell, by spawning a separate delegate (so\ncalled runner on the javascript vm) and evaluating the splices\nthere.\n\nTo use iserv with cross compilers, please see @libraries/libiserv@\nand @utils/iserv-proxy@."; + buildType = "Simple"; + }; + components = { + exes = { + "iserv" = { + depends = [ + (hsPkgs."array" or (errorHandler.buildDepError "array")) + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/libiserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/libiserv.nix new file mode 100644 index 0000000000..ffe0a9ee99 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/libiserv.nix @@ -0,0 +1,38 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = { network = false; }; + package = { + specVersion = "1.10"; + identifier = { name = "libiserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "XXX"; + author = "XXX"; + homepage = ""; + url = ""; + synopsis = "Provides shared functionality between iserv and iserv-proxy."; + description = "Provides shared functionality between iserv and iserv-proxy."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."binary" or (errorHandler.buildDepError "binary")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + (hsPkgs."ghci" or (errorHandler.buildDepError "ghci")) + ] ++ pkgs.lib.optional (!system.isWindows) (hsPkgs."unix" or (errorHandler.buildDepError "unix")); + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/remote-iserv.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/remote-iserv.nix new file mode 100644 index 0000000000..3431eb0712 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/remote-iserv.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "remote-iserv"; version = "9.6.7.20250227"; }; + license = "BSD-3-Clause"; + copyright = "XXX"; + maintainer = "Moritz Angermann "; + author = "Moritz Angermann "; + homepage = ""; + url = ""; + synopsis = "iserv allows GHC to delegate Template Haskell computations"; + description = "This is a very simple remote runner for iserv, to be used together\nwith iserv-proxy. The foundamental idea is that this this wrapper\nstarts running libiserv on a given port to which iserv-proxy will\nthen connect."; + buildType = "Simple"; + }; + components = { + exes = { + "remote-iserv" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."libiserv" or (errorHandler.buildDepError "libiserv")) + ]; + buildable = true; + }; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc-boot-packages-nix/ghc96720250227llvm/template-haskell.nix b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/template-haskell.nix new file mode 100644 index 0000000000..693b8f6a78 --- /dev/null +++ b/materialized/ghc-boot-packages-nix/ghc96720250227llvm/template-haskell.nix @@ -0,0 +1,36 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "template-haskell"; version = "2.20.0.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Support library for Template Haskell"; + description = "This package provides modules containing facilities for manipulating\nHaskell source code using Template Haskell.\n\nSee for more\ninformation."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."ghc-boot-th" or (errorHandler.buildDepError "ghc-boot-th")) + (hsPkgs."ghc-prim" or (errorHandler.buildDepError "ghc-prim")) + (hsPkgs."pretty" or (errorHandler.buildDepError "pretty")) + ]; + buildable = true; + }; + }; + } // rec { src = pkgs.lib.mkDefault ./.; } diff --git a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal-syntax.nix b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal-syntax.nix index dabbcbdee8..6d39b652d7 100644 --- a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal-syntax.nix +++ b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal-syntax.nix @@ -10,10 +10,10 @@ ({ flags = {}; package = { - specVersion = "1.22"; - identifier = { name = "Cabal-syntax"; version = "3.8.1.0"; }; + specVersion = "2.2"; + identifier = { name = "Cabal-syntax"; version = "3.10.3.0"; }; license = "BSD-3-Clause"; - copyright = "2003-2022, Cabal Development Team (see AUTHORS file)"; + copyright = "2003-2023, Cabal Development Team (see AUTHORS file)"; maintainer = "cabal-devel@haskell.org"; author = "Cabal Development Team "; homepage = "http://www.haskell.org/cabal/"; @@ -47,9 +47,9 @@ }; } // { src = pkgs.lib.mkDefault (pkgs.fetchurl { - url = "http://hackage.haskell.org/package/Cabal-syntax-3.8.1.0.tar.gz"; - sha256 = "07e8ddb19fe01781485f1522b6afc22aba680b0ab28ebe6bbfb84a2dd698ce0f"; + url = "http://hackage.haskell.org/package/Cabal-syntax-3.10.3.0.tar.gz"; + sha256 = "75d6a0aa9c00990a0d6e7720ac50c6954f6c942fa1be42c8add7f1c025f7e212"; }); }) // { - package-description-override = "cabal-version: 1.22\r\nname: Cabal-syntax\r\nversion: 3.8.1.0\r\nx-revision: 3\r\ncopyright: 2003-2022, Cabal Development Team (see AUTHORS file)\r\nlicense: BSD3\r\nlicense-file: LICENSE\r\nauthor: Cabal Development Team \r\nmaintainer: cabal-devel@haskell.org\r\nhomepage: http://www.haskell.org/cabal/\r\nbug-reports: https://github.com/haskell/cabal/issues\r\nsynopsis: A library for working with .cabal files\r\ndescription:\r\n This library provides tools for reading and manipulating the .cabal file\r\n format.\r\ncategory: Distribution\r\nbuild-type: Simple\r\n\r\nextra-source-files:\r\n README.md ChangeLog.md\r\n\r\nsource-repository head\r\n type: git\r\n location: https://github.com/haskell/cabal/\r\n subdir: Cabal-syntax\r\n\r\nlibrary\r\n default-language: Haskell2010\r\n hs-source-dirs: src\r\n\r\n build-depends:\r\n array >= 0.4.0.1 && < 0.6,\r\n base >= 4.9 && < 5,\r\n binary >= 0.7 && < 0.9,\r\n bytestring >= 0.10.0.0 && < 0.12,\r\n containers >= 0.5.0.0 && < 0.7,\r\n deepseq >= 1.3.0.1 && < 1.5,\r\n directory >= 1.2 && < 1.4,\r\n filepath >= 1.3.0.1 && < 1.5,\r\n mtl >= 2.1 && < 2.4,\r\n parsec >= 3.1.13.0 && < 3.2,\r\n pretty >= 1.1.1 && < 1.2,\r\n text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1),\r\n time >= 1.4.0.1 && < 1.13,\r\n -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity\r\n -- See also https://github.com/ekmett/transformers-compat/issues/35\r\n transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7)\r\n\r\n if os(windows)\r\n build-depends: Win32 >= 2.3.0.0 && < 2.14\r\n else\r\n build-depends: unix >= 2.6.0.0 && < 2.9\r\n\r\n ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates\r\n ghc-options: -Wcompat -Wnoncanonical-monad-instances\r\n\r\n if impl(ghc < 8.8)\r\n ghc-options: -Wnoncanonical-monadfail-instances\r\n\r\n exposed-modules:\r\n Distribution.Backpack\r\n Distribution.CabalSpecVersion\r\n Distribution.Compat.Binary\r\n Distribution.Compat.CharParsing\r\n Distribution.Compat.DList\r\n Distribution.Compat.Exception\r\n Distribution.Compat.Graph\r\n Distribution.Compat.Lens\r\n Distribution.Compat.MonadFail\r\n Distribution.Compat.Newtype\r\n Distribution.Compat.NonEmptySet\r\n Distribution.Compat.Parsing\r\n Distribution.Compat.Prelude\r\n Distribution.Compat.Semigroup\r\n Distribution.Compat.Typeable\r\n Distribution.Compiler\r\n Distribution.FieldGrammar\r\n Distribution.FieldGrammar.Class\r\n Distribution.FieldGrammar.FieldDescrs\r\n Distribution.FieldGrammar.Newtypes\r\n Distribution.FieldGrammar.Parsec\r\n Distribution.FieldGrammar.Pretty\r\n Distribution.Fields\r\n Distribution.Fields.ConfVar\r\n Distribution.Fields.Field\r\n Distribution.Fields.Lexer\r\n Distribution.Fields.LexerMonad\r\n Distribution.Fields.ParseResult\r\n Distribution.Fields.Parser\r\n Distribution.Fields.Pretty\r\n Distribution.InstalledPackageInfo\r\n Distribution.License\r\n Distribution.ModuleName\r\n Distribution.Package\r\n Distribution.PackageDescription\r\n Distribution.PackageDescription.Configuration\r\n Distribution.PackageDescription.FieldGrammar\r\n Distribution.PackageDescription.Parsec\r\n Distribution.PackageDescription.PrettyPrint\r\n Distribution.PackageDescription.Quirks\r\n Distribution.PackageDescription.Utils\r\n Distribution.Parsec\r\n Distribution.Parsec.Error\r\n Distribution.Parsec.FieldLineStream\r\n Distribution.Parsec.Position\r\n Distribution.Parsec.Warning\r\n Distribution.Pretty\r\n Distribution.SPDX\r\n Distribution.SPDX.License\r\n Distribution.SPDX.LicenseExceptionId\r\n Distribution.SPDX.LicenseExpression\r\n Distribution.SPDX.LicenseId\r\n Distribution.SPDX.LicenseListVersion\r\n Distribution.SPDX.LicenseReference\r\n Distribution.System\r\n Distribution.Text\r\n Distribution.Types.AbiDependency\r\n Distribution.Types.AbiHash\r\n Distribution.Types.Benchmark\r\n Distribution.Types.Benchmark.Lens\r\n Distribution.Types.BenchmarkInterface\r\n Distribution.Types.BenchmarkType\r\n Distribution.Types.BuildInfo\r\n Distribution.Types.BuildInfo.Lens\r\n Distribution.Types.BuildType\r\n Distribution.Types.Component\r\n Distribution.Types.ComponentId\r\n Distribution.Types.ComponentName\r\n Distribution.Types.ComponentRequestedSpec\r\n Distribution.Types.CondTree\r\n Distribution.Types.Condition\r\n Distribution.Types.ConfVar\r\n Distribution.Types.Dependency\r\n Distribution.Types.DependencyMap\r\n Distribution.Types.ExeDependency\r\n Distribution.Types.Executable\r\n Distribution.Types.Executable.Lens\r\n Distribution.Types.ExecutableScope\r\n Distribution.Types.ExposedModule\r\n Distribution.Types.Flag\r\n Distribution.Types.ForeignLib\r\n Distribution.Types.ForeignLib.Lens\r\n Distribution.Types.ForeignLibOption\r\n Distribution.Types.ForeignLibType\r\n Distribution.Types.GenericPackageDescription\r\n Distribution.Types.GenericPackageDescription.Lens\r\n Distribution.Types.HookedBuildInfo\r\n Distribution.Types.IncludeRenaming\r\n Distribution.Types.InstalledPackageInfo\r\n Distribution.Types.InstalledPackageInfo.Lens\r\n Distribution.Types.InstalledPackageInfo.FieldGrammar\r\n Distribution.Types.LegacyExeDependency\r\n Distribution.Types.Lens\r\n Distribution.Types.Library\r\n Distribution.Types.Library.Lens\r\n Distribution.Types.LibraryName\r\n Distribution.Types.LibraryVisibility\r\n Distribution.Types.Mixin\r\n Distribution.Types.Module\r\n Distribution.Types.ModuleReexport\r\n Distribution.Types.ModuleRenaming\r\n Distribution.Types.MungedPackageId\r\n Distribution.Types.MungedPackageName\r\n Distribution.Types.PackageDescription\r\n Distribution.Types.PackageDescription.Lens\r\n Distribution.Types.PackageId\r\n Distribution.Types.PackageId.Lens\r\n Distribution.Types.PackageName\r\n Distribution.Types.PackageVersionConstraint\r\n Distribution.Types.PkgconfigDependency\r\n Distribution.Types.PkgconfigName\r\n Distribution.Types.PkgconfigVersion\r\n Distribution.Types.PkgconfigVersionRange\r\n Distribution.Types.SetupBuildInfo\r\n Distribution.Types.SetupBuildInfo.Lens\r\n Distribution.Types.SourceRepo\r\n Distribution.Types.SourceRepo.Lens\r\n Distribution.Types.TestSuite\r\n Distribution.Types.TestSuite.Lens\r\n Distribution.Types.TestSuiteInterface\r\n Distribution.Types.TestType\r\n Distribution.Types.UnitId\r\n Distribution.Types.UnqualComponentName\r\n Distribution.Types.Version\r\n Distribution.Types.VersionInterval\r\n Distribution.Types.VersionInterval.Legacy\r\n Distribution.Types.VersionRange\r\n Distribution.Types.VersionRange.Internal\r\n Distribution.Utils.Base62\r\n Distribution.Utils.Generic\r\n Distribution.Utils.MD5\r\n Distribution.Utils.Path\r\n Distribution.Utils.ShortText\r\n Distribution.Utils.String\r\n Distribution.Utils.Structured\r\n Distribution.Version\r\n Language.Haskell.Extension\r\n\r\n other-extensions:\r\n BangPatterns\r\n CPP\r\n DefaultSignatures\r\n DeriveDataTypeable\r\n DeriveFoldable\r\n DeriveFunctor\r\n DeriveGeneric\r\n DeriveTraversable\r\n ExistentialQuantification\r\n FlexibleContexts\r\n FlexibleInstances\r\n GeneralizedNewtypeDeriving\r\n ImplicitParams\r\n KindSignatures\r\n NondecreasingIndentation\r\n OverloadedStrings\r\n PatternSynonyms\r\n RankNTypes\r\n RecordWildCards\r\n ScopedTypeVariables\r\n StandaloneDeriving\r\n Trustworthy\r\n TypeFamilies\r\n TypeOperators\r\n TypeSynonymInstances\r\n UndecidableInstances\r\n"; + package-description-override = "cabal-version: 2.2\nname: Cabal-syntax\nversion: 3.10.3.0\ncopyright: 2003-2023, Cabal Development Team (see AUTHORS file)\nlicense: BSD-3-Clause\nlicense-file: LICENSE\nauthor: Cabal Development Team \nmaintainer: cabal-devel@haskell.org\nhomepage: http://www.haskell.org/cabal/\nbug-reports: https://github.com/haskell/cabal/issues\nsynopsis: A library for working with .cabal files\ndescription:\n This library provides tools for reading and manipulating the .cabal file\n format.\ncategory: Distribution\nbuild-type: Simple\n\nextra-doc-files:\n README.md ChangeLog.md\n\nsource-repository head\n type: git\n location: https://github.com/haskell/cabal/\n subdir: Cabal-syntax\n\nlibrary\n default-language: Haskell2010\n hs-source-dirs: src\n\n build-depends:\n array >= 0.4.0.1 && < 0.6,\n base >= 4.9 && < 5,\n binary >= 0.7 && < 0.9,\n bytestring >= 0.10.0.0 && < 0.13,\n containers >= 0.5.0.0 && < 0.8,\n deepseq >= 1.3.0.1 && < 1.6,\n directory >= 1.2 && < 1.4,\n filepath >= 1.3.0.1 && < 1.6,\n mtl >= 2.1 && < 2.4,\n parsec >= 3.1.13.0 && < 3.2,\n pretty >= 1.1.1 && < 1.2,\n text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2),\n time >= 1.4.0.1 && < 1.13,\n -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity\n -- See also https://github.com/ekmett/transformers-compat/issues/35\n transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7)\n\n if os(windows)\n build-depends: Win32 >= 2.3.0.0 && < 2.14\n else\n build-depends: unix >= 2.6.0.0 && < 2.9\n\n ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates\n\n if impl(ghc >= 8.0)\n ghc-options: -Wcompat -Wnoncanonical-monad-instances\n\n if impl(ghc >= 8.0) && impl(ghc < 8.8)\n ghc-options: -Wnoncanonical-monadfail-instances\n\n exposed-modules:\n Distribution.Backpack\n Distribution.CabalSpecVersion\n Distribution.Compat.Binary\n Distribution.Compat.CharParsing\n Distribution.Compat.DList\n Distribution.Compat.Exception\n Distribution.Compat.Graph\n Distribution.Compat.Lens\n Distribution.Compat.MonadFail\n Distribution.Compat.Newtype\n Distribution.Compat.NonEmptySet\n Distribution.Compat.Parsing\n Distribution.Compat.Prelude\n Distribution.Compat.Semigroup\n Distribution.Compat.Typeable\n Distribution.Compiler\n Distribution.FieldGrammar\n Distribution.FieldGrammar.Class\n Distribution.FieldGrammar.FieldDescrs\n Distribution.FieldGrammar.Newtypes\n Distribution.FieldGrammar.Parsec\n Distribution.FieldGrammar.Pretty\n Distribution.Fields\n Distribution.Fields.ConfVar\n Distribution.Fields.Field\n Distribution.Fields.Lexer\n Distribution.Fields.LexerMonad\n Distribution.Fields.ParseResult\n Distribution.Fields.Parser\n Distribution.Fields.Pretty\n Distribution.InstalledPackageInfo\n Distribution.License\n Distribution.ModuleName\n Distribution.Package\n Distribution.PackageDescription\n Distribution.PackageDescription.Configuration\n Distribution.PackageDescription.FieldGrammar\n Distribution.PackageDescription.Parsec\n Distribution.PackageDescription.PrettyPrint\n Distribution.PackageDescription.Quirks\n Distribution.PackageDescription.Utils\n Distribution.Parsec\n Distribution.Parsec.Error\n Distribution.Parsec.FieldLineStream\n Distribution.Parsec.Position\n Distribution.Parsec.Warning\n Distribution.Pretty\n Distribution.SPDX\n Distribution.SPDX.License\n Distribution.SPDX.LicenseExceptionId\n Distribution.SPDX.LicenseExpression\n Distribution.SPDX.LicenseId\n Distribution.SPDX.LicenseListVersion\n Distribution.SPDX.LicenseReference\n Distribution.System\n Distribution.Text\n Distribution.Types.AbiDependency\n Distribution.Types.AbiHash\n Distribution.Types.Benchmark\n Distribution.Types.Benchmark.Lens\n Distribution.Types.BenchmarkInterface\n Distribution.Types.BenchmarkType\n Distribution.Types.BuildInfo\n Distribution.Types.BuildInfo.Lens\n Distribution.Types.BuildType\n Distribution.Types.Component\n Distribution.Types.ComponentId\n Distribution.Types.ComponentName\n Distribution.Types.ComponentRequestedSpec\n Distribution.Types.CondTree\n Distribution.Types.Condition\n Distribution.Types.ConfVar\n Distribution.Types.Dependency\n Distribution.Types.DependencyMap\n Distribution.Types.ExeDependency\n Distribution.Types.Executable\n Distribution.Types.Executable.Lens\n Distribution.Types.ExecutableScope\n Distribution.Types.ExposedModule\n Distribution.Types.Flag\n Distribution.Types.ForeignLib\n Distribution.Types.ForeignLib.Lens\n Distribution.Types.ForeignLibOption\n Distribution.Types.ForeignLibType\n Distribution.Types.GenericPackageDescription\n Distribution.Types.GenericPackageDescription.Lens\n Distribution.Types.HookedBuildInfo\n Distribution.Types.IncludeRenaming\n Distribution.Types.InstalledPackageInfo\n Distribution.Types.InstalledPackageInfo.Lens\n Distribution.Types.InstalledPackageInfo.FieldGrammar\n Distribution.Types.LegacyExeDependency\n Distribution.Types.Lens\n Distribution.Types.Library\n Distribution.Types.Library.Lens\n Distribution.Types.LibraryName\n Distribution.Types.LibraryVisibility\n Distribution.Types.Mixin\n Distribution.Types.Module\n Distribution.Types.ModuleReexport\n Distribution.Types.ModuleRenaming\n Distribution.Types.MungedPackageId\n Distribution.Types.MungedPackageName\n Distribution.Types.PackageDescription\n Distribution.Types.PackageDescription.Lens\n Distribution.Types.PackageId\n Distribution.Types.PackageId.Lens\n Distribution.Types.PackageName\n Distribution.Types.PackageVersionConstraint\n Distribution.Types.PkgconfigDependency\n Distribution.Types.PkgconfigName\n Distribution.Types.PkgconfigVersion\n Distribution.Types.PkgconfigVersionRange\n Distribution.Types.SetupBuildInfo\n Distribution.Types.SetupBuildInfo.Lens\n Distribution.Types.SourceRepo\n Distribution.Types.SourceRepo.Lens\n Distribution.Types.TestSuite\n Distribution.Types.TestSuite.Lens\n Distribution.Types.TestSuiteInterface\n Distribution.Types.TestType\n Distribution.Types.UnitId\n Distribution.Types.UnqualComponentName\n Distribution.Types.Version\n Distribution.Types.VersionInterval\n Distribution.Types.VersionInterval.Legacy\n Distribution.Types.VersionRange\n Distribution.Types.VersionRange.Internal\n Distribution.Utils.Base62\n Distribution.Utils.Generic\n Distribution.Utils.MD5\n Distribution.Utils.Path\n Distribution.Utils.ShortText\n Distribution.Utils.String\n Distribution.Utils.Structured\n Distribution.Version\n Language.Haskell.Extension\n\n other-extensions:\n BangPatterns\n CPP\n DefaultSignatures\n DeriveDataTypeable\n DeriveFoldable\n DeriveFunctor\n DeriveGeneric\n DeriveTraversable\n ExistentialQuantification\n FlexibleContexts\n FlexibleInstances\n GeneralizedNewtypeDeriving\n ImplicitParams\n KindSignatures\n NondecreasingIndentation\n OverloadedStrings\n PatternSynonyms\n RankNTypes\n RecordWildCards\n ScopedTypeVariables\n StandaloneDeriving\n Trustworthy\n TypeFamilies\n TypeOperators\n TypeSynonymInstances\n UndecidableInstances\n"; } \ No newline at end of file diff --git a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal.nix b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal.nix index be0b5019d9..ceef26dc73 100644 --- a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal.nix +++ b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/Cabal.nix @@ -10,10 +10,10 @@ ({ flags = {}; package = { - specVersion = "1.22"; - identifier = { name = "Cabal"; version = "3.8.1.0"; }; + specVersion = "2.2"; + identifier = { name = "Cabal"; version = "3.10.3.0"; }; license = "BSD-3-Clause"; - copyright = "2003-2022, Cabal Development Team (see AUTHORS file)"; + copyright = "2003-2023, Cabal Development Team (see AUTHORS file)"; maintainer = "cabal-devel@haskell.org"; author = "Cabal Development Team "; homepage = "http://www.haskell.org/cabal/"; @@ -24,7 +24,7 @@ }; components = { "library" = { - depends = ([ + depends = [ (hsPkgs."Cabal-syntax" or (errorHandler.buildDepError "Cabal-syntax")) (hsPkgs."array" or (errorHandler.buildDepError "array")) (hsPkgs."base" or (errorHandler.buildDepError "base")) @@ -40,7 +40,7 @@ (hsPkgs."mtl" or (errorHandler.buildDepError "mtl")) (hsPkgs."text" or (errorHandler.buildDepError "text")) (hsPkgs."parsec" or (errorHandler.buildDepError "parsec")) - ] ++ pkgs.lib.optional (compiler.isGhc && compiler.version.ge "8.2") (hsPkgs."process" or (errorHandler.buildDepError "process"))) ++ (if system.isWindows + ] ++ (if system.isWindows then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); buildable = true; @@ -48,9 +48,9 @@ }; } // { src = pkgs.lib.mkDefault (pkgs.fetchurl { - url = "http://hackage.haskell.org/package/Cabal-3.8.1.0.tar.gz"; - sha256 = "7464cbe6c2f3d7e5d0232023a1a7330621f8b24853cb259fc89a2af85b736608"; + url = "http://hackage.haskell.org/package/Cabal-3.10.3.0.tar.gz"; + sha256 = "cb7f7c66626d7555f799e786513ddd65a874fd23f1cf312990c7a48abfc0b2c6"; }); }) // { - package-description-override = "cabal-version: 1.22\r\nname: Cabal\r\nversion: 3.8.1.0\r\nx-revision: 2\r\ncopyright: 2003-2022, Cabal Development Team (see AUTHORS file)\r\nlicense: BSD3\r\nlicense-file: LICENSE\r\nauthor: Cabal Development Team \r\nmaintainer: cabal-devel@haskell.org\r\nhomepage: http://www.haskell.org/cabal/\r\nbug-reports: https://github.com/haskell/cabal/issues\r\nsynopsis: A framework for packaging Haskell software\r\ndescription:\r\n The Haskell Common Architecture for Building Applications and\r\n Libraries: a framework defining a common interface for authors to more\r\n easily build their Haskell applications in a portable way.\r\n .\r\n The Haskell Cabal is part of a larger infrastructure for distributing,\r\n organizing, and cataloging Haskell libraries and tools.\r\ncategory: Distribution\r\nbuild-type: Simple\r\n-- If we use a new Cabal feature, this needs to be changed to Custom so\r\n-- we can bootstrap.\r\n\r\nextra-source-files:\r\n README.md ChangeLog.md\r\n\r\nsource-repository head\r\n type: git\r\n location: https://github.com/haskell/cabal/\r\n subdir: Cabal\r\n\r\nlibrary\r\n default-language: Haskell2010\r\n hs-source-dirs: src\r\n\r\n build-depends:\r\n Cabal-syntax >= 3.8 && < 3.9,\r\n array >= 0.4.0.1 && < 0.6,\r\n base >= 4.6 && < 5,\r\n bytestring >= 0.10.0.0 && < 0.12,\r\n containers >= 0.5.0.0 && < 0.7,\r\n deepseq >= 1.3.0.1 && < 1.5,\r\n directory >= 1.2 && < 1.4,\r\n filepath >= 1.3.0.1 && < 1.5,\r\n pretty >= 1.1.1 && < 1.2,\r\n process >= 1.2.1.0 && < 1.7,\r\n time >= 1.4.0.1 && < 1.13\r\n\r\n -- PR #8802: moved conditional process lower bound to cabal-install package\r\n if impl(ghc >=8.2)\r\n build-depends: process >= 1.2.1.0\r\n\r\n if os(windows)\r\n build-depends: Win32 >= 2.3.0.0 && < 2.14\r\n else\r\n build-depends: unix >= 2.6.0.0 && < 2.9\r\n\r\n ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates\r\n ghc-options: -Wcompat -Wnoncanonical-monad-instances\r\n\r\n if impl(ghc <8.8)\r\n ghc-options: -Wnoncanonical-monadfail-instances\r\n\r\n exposed-modules:\r\n Distribution.Backpack.Configure\r\n Distribution.Backpack.ComponentsGraph\r\n Distribution.Backpack.ConfiguredComponent\r\n Distribution.Backpack.DescribeUnitId\r\n Distribution.Backpack.FullUnitId\r\n Distribution.Backpack.LinkedComponent\r\n Distribution.Backpack.ModSubst\r\n Distribution.Backpack.ModuleShape\r\n Distribution.Backpack.PreModuleShape\r\n Distribution.Utils.IOData\r\n Distribution.Utils.LogProgress\r\n Distribution.Utils.MapAccum\r\n Distribution.Compat.CreatePipe\r\n Distribution.Compat.Directory\r\n Distribution.Compat.Environment\r\n Distribution.Compat.FilePath\r\n Distribution.Compat.Internal.TempFile\r\n Distribution.Compat.ResponseFile\r\n Distribution.Compat.Prelude.Internal\r\n Distribution.Compat.Process\r\n Distribution.Compat.Stack\r\n Distribution.Compat.Time\r\n Distribution.Make\r\n Distribution.PackageDescription.Check\r\n Distribution.ReadE\r\n Distribution.Simple\r\n Distribution.Simple.Bench\r\n Distribution.Simple.Build\r\n Distribution.Simple.Build.Macros\r\n Distribution.Simple.Build.PathsModule\r\n Distribution.Simple.BuildPaths\r\n Distribution.Simple.BuildTarget\r\n Distribution.Simple.BuildToolDepends\r\n Distribution.Simple.CCompiler\r\n Distribution.Simple.Command\r\n Distribution.Simple.Compiler\r\n Distribution.Simple.Configure\r\n Distribution.Simple.Flag\r\n Distribution.Simple.GHC\r\n Distribution.Simple.GHCJS\r\n Distribution.Simple.Haddock\r\n Distribution.Simple.Glob\r\n Distribution.Simple.HaskellSuite\r\n Distribution.Simple.Hpc\r\n Distribution.Simple.Install\r\n Distribution.Simple.InstallDirs\r\n Distribution.Simple.InstallDirs.Internal\r\n Distribution.Simple.LocalBuildInfo\r\n Distribution.Simple.PackageDescription\r\n Distribution.Simple.PackageIndex\r\n Distribution.Simple.PreProcess\r\n Distribution.Simple.PreProcess.Unlit\r\n Distribution.Simple.Program\r\n Distribution.Simple.Program.Ar\r\n Distribution.Simple.Program.Builtin\r\n Distribution.Simple.Program.Db\r\n Distribution.Simple.Program.Find\r\n Distribution.Simple.Program.GHC\r\n Distribution.Simple.Program.HcPkg\r\n Distribution.Simple.Program.Hpc\r\n Distribution.Simple.Program.Internal\r\n Distribution.Simple.Program.Ld\r\n Distribution.Simple.Program.ResponseFile\r\n Distribution.Simple.Program.Run\r\n Distribution.Simple.Program.Script\r\n Distribution.Simple.Program.Strip\r\n Distribution.Simple.Program.Types\r\n Distribution.Simple.Register\r\n Distribution.Simple.Setup\r\n Distribution.Simple.ShowBuildInfo\r\n Distribution.Simple.SrcDist\r\n Distribution.Simple.Test\r\n Distribution.Simple.Test.ExeV10\r\n Distribution.Simple.Test.LibV09\r\n Distribution.Simple.Test.Log\r\n Distribution.Simple.UHC\r\n Distribution.Simple.UserHooks\r\n Distribution.Simple.Utils\r\n Distribution.TestSuite\r\n Distribution.Types.AnnotatedId\r\n Distribution.Types.ComponentInclude\r\n Distribution.Types.DumpBuildInfo\r\n Distribution.Types.PackageName.Magic\r\n Distribution.Types.ComponentLocalBuildInfo\r\n Distribution.Types.LocalBuildInfo\r\n Distribution.Types.TargetInfo\r\n Distribution.Types.GivenComponent\r\n Distribution.Utils.Json\r\n Distribution.Utils.NubList\r\n Distribution.Utils.Progress\r\n Distribution.Verbosity\r\n Distribution.Verbosity.Internal\r\n\r\n -- We reexport all of Cabal-syntax to aid in compatibility for downstream\r\n -- users. In the future we may opt to deprecate some or all of these exports.\r\n -- See haskell/Cabal#7974.\r\n reexported-modules:\r\n Distribution.Backpack,\r\n Distribution.CabalSpecVersion,\r\n Distribution.Compat.Binary,\r\n Distribution.Compat.CharParsing,\r\n Distribution.Compat.DList,\r\n Distribution.Compat.Exception,\r\n Distribution.Compat.Graph,\r\n Distribution.Compat.Lens,\r\n Distribution.Compat.MonadFail,\r\n Distribution.Compat.Newtype,\r\n Distribution.Compat.NonEmptySet,\r\n Distribution.Compat.Parsing,\r\n Distribution.Compat.Prelude,\r\n Distribution.Compat.Semigroup,\r\n Distribution.Compat.Typeable,\r\n Distribution.Compiler,\r\n Distribution.FieldGrammar,\r\n Distribution.FieldGrammar.Class,\r\n Distribution.FieldGrammar.FieldDescrs,\r\n Distribution.FieldGrammar.Newtypes,\r\n Distribution.FieldGrammar.Parsec,\r\n Distribution.FieldGrammar.Pretty,\r\n Distribution.Fields,\r\n Distribution.Fields.ConfVar,\r\n Distribution.Fields.Field,\r\n Distribution.Fields.Lexer,\r\n Distribution.Fields.LexerMonad,\r\n Distribution.Fields.ParseResult,\r\n Distribution.Fields.Parser,\r\n Distribution.Fields.Pretty,\r\n Distribution.InstalledPackageInfo,\r\n Distribution.License,\r\n Distribution.ModuleName,\r\n Distribution.Package,\r\n Distribution.PackageDescription,\r\n Distribution.PackageDescription.Configuration,\r\n Distribution.PackageDescription.FieldGrammar,\r\n Distribution.PackageDescription.Parsec,\r\n Distribution.PackageDescription.PrettyPrint,\r\n Distribution.PackageDescription.Quirks,\r\n Distribution.PackageDescription.Utils,\r\n Distribution.Parsec,\r\n Distribution.Parsec.Error,\r\n Distribution.Parsec.FieldLineStream,\r\n Distribution.Parsec.Position,\r\n Distribution.Parsec.Warning,\r\n Distribution.Pretty,\r\n Distribution.SPDX,\r\n Distribution.SPDX.License,\r\n Distribution.SPDX.LicenseExceptionId,\r\n Distribution.SPDX.LicenseExpression,\r\n Distribution.SPDX.LicenseId,\r\n Distribution.SPDX.LicenseListVersion,\r\n Distribution.SPDX.LicenseReference,\r\n Distribution.System,\r\n Distribution.Text,\r\n Distribution.Types.AbiDependency,\r\n Distribution.Types.AbiHash,\r\n Distribution.Types.Benchmark,\r\n Distribution.Types.Benchmark.Lens,\r\n Distribution.Types.BenchmarkInterface,\r\n Distribution.Types.BenchmarkType,\r\n Distribution.Types.BuildInfo,\r\n Distribution.Types.BuildInfo.Lens,\r\n Distribution.Types.BuildType,\r\n Distribution.Types.Component,\r\n Distribution.Types.ComponentId,\r\n Distribution.Types.ComponentName,\r\n Distribution.Types.ComponentRequestedSpec,\r\n Distribution.Types.CondTree,\r\n Distribution.Types.Condition,\r\n Distribution.Types.ConfVar,\r\n Distribution.Types.Dependency,\r\n Distribution.Types.DependencyMap,\r\n Distribution.Types.ExeDependency,\r\n Distribution.Types.Executable,\r\n Distribution.Types.Executable.Lens,\r\n Distribution.Types.ExecutableScope,\r\n Distribution.Types.ExposedModule,\r\n Distribution.Types.Flag,\r\n Distribution.Types.ForeignLib,\r\n Distribution.Types.ForeignLib.Lens,\r\n Distribution.Types.ForeignLibOption,\r\n Distribution.Types.ForeignLibType,\r\n Distribution.Types.GenericPackageDescription,\r\n Distribution.Types.GenericPackageDescription.Lens,\r\n Distribution.Types.HookedBuildInfo,\r\n Distribution.Types.IncludeRenaming,\r\n Distribution.Types.InstalledPackageInfo,\r\n Distribution.Types.InstalledPackageInfo.Lens,\r\n Distribution.Types.InstalledPackageInfo.FieldGrammar,\r\n Distribution.Types.LegacyExeDependency,\r\n Distribution.Types.Lens,\r\n Distribution.Types.Library,\r\n Distribution.Types.Library.Lens,\r\n Distribution.Types.LibraryName,\r\n Distribution.Types.LibraryVisibility,\r\n Distribution.Types.Mixin,\r\n Distribution.Types.Module,\r\n Distribution.Types.ModuleReexport,\r\n Distribution.Types.ModuleRenaming,\r\n Distribution.Types.MungedPackageId,\r\n Distribution.Types.MungedPackageName,\r\n Distribution.Types.PackageDescription,\r\n Distribution.Types.PackageDescription.Lens,\r\n Distribution.Types.PackageId,\r\n Distribution.Types.PackageId.Lens,\r\n Distribution.Types.PackageName,\r\n Distribution.Types.PackageVersionConstraint,\r\n Distribution.Types.PkgconfigDependency,\r\n Distribution.Types.PkgconfigName,\r\n Distribution.Types.PkgconfigVersion,\r\n Distribution.Types.PkgconfigVersionRange,\r\n Distribution.Types.SetupBuildInfo,\r\n Distribution.Types.SetupBuildInfo.Lens,\r\n Distribution.Types.SourceRepo,\r\n Distribution.Types.SourceRepo.Lens,\r\n Distribution.Types.TestSuite,\r\n Distribution.Types.TestSuite.Lens,\r\n Distribution.Types.TestSuiteInterface,\r\n Distribution.Types.TestType,\r\n Distribution.Types.UnitId,\r\n Distribution.Types.UnqualComponentName,\r\n Distribution.Types.Version,\r\n Distribution.Types.VersionInterval,\r\n Distribution.Types.VersionInterval.Legacy,\r\n Distribution.Types.VersionRange,\r\n Distribution.Types.VersionRange.Internal,\r\n Distribution.Utils.Base62,\r\n Distribution.Utils.Generic,\r\n Distribution.Utils.MD5,\r\n Distribution.Utils.Path,\r\n Distribution.Utils.ShortText,\r\n Distribution.Utils.String,\r\n Distribution.Utils.Structured,\r\n Distribution.Version,\r\n Language.Haskell.Extension\r\n\r\n -- Parsec parser-related modules\r\n build-depends:\r\n -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity\r\n -- See also https://github.com/ekmett/transformers-compat/issues/35\r\n transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7),\r\n mtl >= 2.1 && < 2.4,\r\n text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1),\r\n parsec >= 3.1.13.0 && < 3.2\r\n\r\n other-modules:\r\n Distribution.Backpack.PreExistingComponent\r\n Distribution.Backpack.ReadyComponent\r\n Distribution.Backpack.MixLink\r\n Distribution.Backpack.ModuleScope\r\n Distribution.Backpack.UnifyM\r\n Distribution.Backpack.Id\r\n Distribution.Utils.UnionFind\r\n Distribution.Compat.Async\r\n Distribution.Compat.CopyFile\r\n Distribution.Compat.GetShortPathName\r\n Distribution.Compat.SnocList\r\n Distribution.GetOpt\r\n Distribution.Lex\r\n Distribution.Simple.Build.Macros.Z\r\n Distribution.Simple.Build.PathsModule.Z\r\n Distribution.Simple.GHC.EnvironmentParser\r\n Distribution.Simple.GHC.Internal\r\n Distribution.Simple.GHC.ImplInfo\r\n Distribution.ZinzaPrelude\r\n Paths_Cabal\r\n\r\n other-extensions:\r\n BangPatterns\r\n CPP\r\n DefaultSignatures\r\n DeriveDataTypeable\r\n DeriveFoldable\r\n DeriveFunctor\r\n DeriveGeneric\r\n DeriveTraversable\r\n ExistentialQuantification\r\n FlexibleContexts\r\n FlexibleInstances\r\n GeneralizedNewtypeDeriving\r\n ImplicitParams\r\n KindSignatures\r\n LambdaCase\r\n NondecreasingIndentation\r\n OverloadedStrings\r\n PatternSynonyms\r\n RankNTypes\r\n RecordWildCards\r\n ScopedTypeVariables\r\n StandaloneDeriving\r\n Trustworthy\r\n TypeFamilies\r\n TypeOperators\r\n TypeSynonymInstances\r\n UndecidableInstances\r\n"; + package-description-override = "cabal-version: 2.2\nname: Cabal\nversion: 3.10.3.0\ncopyright: 2003-2023, Cabal Development Team (see AUTHORS file)\nlicense: BSD-3-Clause\nlicense-file: LICENSE\nauthor: Cabal Development Team \nmaintainer: cabal-devel@haskell.org\nhomepage: http://www.haskell.org/cabal/\nbug-reports: https://github.com/haskell/cabal/issues\nsynopsis: A framework for packaging Haskell software\ndescription:\n The Haskell Common Architecture for Building Applications and\n Libraries: a framework defining a common interface for authors to more\n easily build their Haskell applications in a portable way.\n .\n The Haskell Cabal is part of a larger infrastructure for distributing,\n organizing, and cataloging Haskell libraries and tools.\ncategory: Distribution\nbuild-type: Simple\n-- If we use a new Cabal feature, this needs to be changed to Custom so\n-- we can bootstrap.\n\nextra-doc-files:\n README.md ChangeLog.md\n\nsource-repository head\n type: git\n location: https://github.com/haskell/cabal/\n subdir: Cabal\n\nlibrary\n default-language: Haskell2010\n hs-source-dirs: src\n\n build-depends:\n Cabal-syntax ^>= 3.10,\n array >= 0.4.0.1 && < 0.6,\n base >= 4.9 && < 5,\n bytestring >= 0.10.0.0 && < 0.13,\n containers >= 0.5.0.0 && < 0.8,\n deepseq >= 1.3.0.1 && < 1.6,\n directory >= 1.2 && < 1.4,\n filepath >= 1.3.0.1 && < 1.6,\n pretty >= 1.1.1 && < 1.2,\n process >= 1.2.1.0 && < 1.7,\n time >= 1.4.0.1 && < 1.13\n\n if os(windows)\n build-depends: Win32 >= 2.3.0.0 && < 2.15\n else\n build-depends: unix >= 2.6.0.0 && < 2.9\n\n ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates\n\n if impl(ghc >= 8.0)\n ghc-options: -Wcompat -Wnoncanonical-monad-instances\n\n if impl(ghc >= 8.0) && impl(ghc < 8.8)\n ghc-options: -Wnoncanonical-monadfail-instances\n\n exposed-modules:\n Distribution.Backpack.Configure\n Distribution.Backpack.ComponentsGraph\n Distribution.Backpack.ConfiguredComponent\n Distribution.Backpack.DescribeUnitId\n Distribution.Backpack.FullUnitId\n Distribution.Backpack.LinkedComponent\n Distribution.Backpack.ModSubst\n Distribution.Backpack.ModuleShape\n Distribution.Backpack.PreModuleShape\n Distribution.Utils.IOData\n Distribution.Utils.LogProgress\n Distribution.Utils.MapAccum\n Distribution.Compat.CreatePipe\n Distribution.Compat.Directory\n Distribution.Compat.Environment\n Distribution.Compat.FilePath\n Distribution.Compat.Internal.TempFile\n Distribution.Compat.ResponseFile\n Distribution.Compat.Prelude.Internal\n Distribution.Compat.Process\n Distribution.Compat.Stack\n Distribution.Compat.Time\n Distribution.Make\n Distribution.PackageDescription.Check\n Distribution.ReadE\n Distribution.Simple\n Distribution.Simple.Bench\n Distribution.Simple.Build\n Distribution.Simple.Build.Macros\n Distribution.Simple.Build.PackageInfoModule\n Distribution.Simple.Build.PathsModule\n Distribution.Simple.BuildPaths\n Distribution.Simple.BuildTarget\n Distribution.Simple.BuildToolDepends\n Distribution.Simple.CCompiler\n Distribution.Simple.Command\n Distribution.Simple.Compiler\n Distribution.Simple.Configure\n Distribution.Simple.Flag\n Distribution.Simple.GHC\n Distribution.Simple.GHCJS\n Distribution.Simple.Haddock\n Distribution.Simple.Glob\n Distribution.Simple.HaskellSuite\n Distribution.Simple.Hpc\n Distribution.Simple.Install\n Distribution.Simple.InstallDirs\n Distribution.Simple.InstallDirs.Internal\n Distribution.Simple.LocalBuildInfo\n Distribution.Simple.PackageDescription\n Distribution.Simple.PackageIndex\n Distribution.Simple.PreProcess\n Distribution.Simple.PreProcess.Unlit\n Distribution.Simple.Program\n Distribution.Simple.Program.Ar\n Distribution.Simple.Program.Builtin\n Distribution.Simple.Program.Db\n Distribution.Simple.Program.Find\n Distribution.Simple.Program.GHC\n Distribution.Simple.Program.HcPkg\n Distribution.Simple.Program.Hpc\n Distribution.Simple.Program.Internal\n Distribution.Simple.Program.Ld\n Distribution.Simple.Program.ResponseFile\n Distribution.Simple.Program.Run\n Distribution.Simple.Program.Script\n Distribution.Simple.Program.Strip\n Distribution.Simple.Program.Types\n Distribution.Simple.Register\n Distribution.Simple.Setup\n Distribution.Simple.ShowBuildInfo\n Distribution.Simple.SrcDist\n Distribution.Simple.Test\n Distribution.Simple.Test.ExeV10\n Distribution.Simple.Test.LibV09\n Distribution.Simple.Test.Log\n Distribution.Simple.UHC\n Distribution.Simple.UserHooks\n Distribution.Simple.Utils\n Distribution.TestSuite\n Distribution.Types.AnnotatedId\n Distribution.Types.ComponentInclude\n Distribution.Types.DumpBuildInfo\n Distribution.Types.PackageName.Magic\n Distribution.Types.ComponentLocalBuildInfo\n Distribution.Types.LocalBuildInfo\n Distribution.Types.TargetInfo\n Distribution.Types.GivenComponent\n Distribution.Utils.Json\n Distribution.Utils.NubList\n Distribution.Utils.Progress\n Distribution.Verbosity\n Distribution.Verbosity.Internal\n\n -- We reexport all of Cabal-syntax to aid in compatibility for downstream\n -- users. In the future we may opt to deprecate some or all of these exports.\n -- See haskell/Cabal#7974.\n reexported-modules:\n Distribution.Backpack,\n Distribution.CabalSpecVersion,\n Distribution.Compat.Binary,\n Distribution.Compat.CharParsing,\n Distribution.Compat.DList,\n Distribution.Compat.Exception,\n Distribution.Compat.Graph,\n Distribution.Compat.Lens,\n Distribution.Compat.MonadFail,\n Distribution.Compat.Newtype,\n Distribution.Compat.NonEmptySet,\n Distribution.Compat.Parsing,\n Distribution.Compat.Prelude,\n Distribution.Compat.Semigroup,\n Distribution.Compat.Typeable,\n Distribution.Compiler,\n Distribution.FieldGrammar,\n Distribution.FieldGrammar.Class,\n Distribution.FieldGrammar.FieldDescrs,\n Distribution.FieldGrammar.Newtypes,\n Distribution.FieldGrammar.Parsec,\n Distribution.FieldGrammar.Pretty,\n Distribution.Fields,\n Distribution.Fields.ConfVar,\n Distribution.Fields.Field,\n Distribution.Fields.Lexer,\n Distribution.Fields.LexerMonad,\n Distribution.Fields.ParseResult,\n Distribution.Fields.Parser,\n Distribution.Fields.Pretty,\n Distribution.InstalledPackageInfo,\n Distribution.License,\n Distribution.ModuleName,\n Distribution.Package,\n Distribution.PackageDescription,\n Distribution.PackageDescription.Configuration,\n Distribution.PackageDescription.FieldGrammar,\n Distribution.PackageDescription.Parsec,\n Distribution.PackageDescription.PrettyPrint,\n Distribution.PackageDescription.Quirks,\n Distribution.PackageDescription.Utils,\n Distribution.Parsec,\n Distribution.Parsec.Error,\n Distribution.Parsec.FieldLineStream,\n Distribution.Parsec.Position,\n Distribution.Parsec.Warning,\n Distribution.Pretty,\n Distribution.SPDX,\n Distribution.SPDX.License,\n Distribution.SPDX.LicenseExceptionId,\n Distribution.SPDX.LicenseExpression,\n Distribution.SPDX.LicenseId,\n Distribution.SPDX.LicenseListVersion,\n Distribution.SPDX.LicenseReference,\n Distribution.System,\n Distribution.Text,\n Distribution.Types.AbiDependency,\n Distribution.Types.AbiHash,\n Distribution.Types.Benchmark,\n Distribution.Types.Benchmark.Lens,\n Distribution.Types.BenchmarkInterface,\n Distribution.Types.BenchmarkType,\n Distribution.Types.BuildInfo,\n Distribution.Types.BuildInfo.Lens,\n Distribution.Types.BuildType,\n Distribution.Types.Component,\n Distribution.Types.ComponentId,\n Distribution.Types.ComponentName,\n Distribution.Types.ComponentRequestedSpec,\n Distribution.Types.CondTree,\n Distribution.Types.Condition,\n Distribution.Types.ConfVar,\n Distribution.Types.Dependency,\n Distribution.Types.DependencyMap,\n Distribution.Types.ExeDependency,\n Distribution.Types.Executable,\n Distribution.Types.Executable.Lens,\n Distribution.Types.ExecutableScope,\n Distribution.Types.ExposedModule,\n Distribution.Types.Flag,\n Distribution.Types.ForeignLib,\n Distribution.Types.ForeignLib.Lens,\n Distribution.Types.ForeignLibOption,\n Distribution.Types.ForeignLibType,\n Distribution.Types.GenericPackageDescription,\n Distribution.Types.GenericPackageDescription.Lens,\n Distribution.Types.HookedBuildInfo,\n Distribution.Types.IncludeRenaming,\n Distribution.Types.InstalledPackageInfo,\n Distribution.Types.InstalledPackageInfo.Lens,\n Distribution.Types.InstalledPackageInfo.FieldGrammar,\n Distribution.Types.LegacyExeDependency,\n Distribution.Types.Lens,\n Distribution.Types.Library,\n Distribution.Types.Library.Lens,\n Distribution.Types.LibraryName,\n Distribution.Types.LibraryVisibility,\n Distribution.Types.Mixin,\n Distribution.Types.Module,\n Distribution.Types.ModuleReexport,\n Distribution.Types.ModuleRenaming,\n Distribution.Types.MungedPackageId,\n Distribution.Types.MungedPackageName,\n Distribution.Types.PackageDescription,\n Distribution.Types.PackageDescription.Lens,\n Distribution.Types.PackageId,\n Distribution.Types.PackageId.Lens,\n Distribution.Types.PackageName,\n Distribution.Types.PackageVersionConstraint,\n Distribution.Types.PkgconfigDependency,\n Distribution.Types.PkgconfigName,\n Distribution.Types.PkgconfigVersion,\n Distribution.Types.PkgconfigVersionRange,\n Distribution.Types.SetupBuildInfo,\n Distribution.Types.SetupBuildInfo.Lens,\n Distribution.Types.SourceRepo,\n Distribution.Types.SourceRepo.Lens,\n Distribution.Types.TestSuite,\n Distribution.Types.TestSuite.Lens,\n Distribution.Types.TestSuiteInterface,\n Distribution.Types.TestType,\n Distribution.Types.UnitId,\n Distribution.Types.UnqualComponentName,\n Distribution.Types.Version,\n Distribution.Types.VersionInterval,\n Distribution.Types.VersionInterval.Legacy,\n Distribution.Types.VersionRange,\n Distribution.Types.VersionRange.Internal,\n Distribution.Utils.Base62,\n Distribution.Utils.Generic,\n Distribution.Utils.MD5,\n Distribution.Utils.Path,\n Distribution.Utils.ShortText,\n Distribution.Utils.String,\n Distribution.Utils.Structured,\n Distribution.Version,\n Language.Haskell.Extension\n\n -- Parsec parser-related modules\n build-depends:\n -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity\n -- See also https://github.com/ekmett/transformers-compat/issues/35\n transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7),\n mtl >= 2.1 && < 2.4,\n text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2),\n parsec >= 3.1.13.0 && < 3.2\n\n other-modules:\n Distribution.Backpack.PreExistingComponent\n Distribution.Backpack.ReadyComponent\n Distribution.Backpack.MixLink\n Distribution.Backpack.ModuleScope\n Distribution.Backpack.UnifyM\n Distribution.Backpack.Id\n Distribution.Utils.UnionFind\n Distribution.Compat.Async\n Distribution.Compat.CopyFile\n Distribution.Compat.GetShortPathName\n Distribution.Compat.SnocList\n Distribution.GetOpt\n Distribution.Lex\n Distribution.Simple.Build.Macros.Z\n Distribution.Simple.Build.PackageInfoModule.Z\n Distribution.Simple.Build.PathsModule.Z\n Distribution.Simple.GHC.EnvironmentParser\n Distribution.Simple.GHC.Internal\n Distribution.Simple.GHC.ImplInfo\n Distribution.Simple.ConfigureScript\n Distribution.ZinzaPrelude\n Paths_Cabal\n\n autogen-modules:\n Paths_Cabal\n\n other-extensions:\n BangPatterns\n CPP\n DefaultSignatures\n DeriveDataTypeable\n DeriveFoldable\n DeriveFunctor\n DeriveGeneric\n DeriveTraversable\n ExistentialQuantification\n FlexibleContexts\n FlexibleInstances\n GeneralizedNewtypeDeriving\n ImplicitParams\n KindSignatures\n LambdaCase\n NondecreasingIndentation\n OverloadedStrings\n PatternSynonyms\n RankNTypes\n RecordWildCards\n ScopedTypeVariables\n StandaloneDeriving\n Trustworthy\n TypeFamilies\n TypeOperators\n TypeSynonymInstances\n UndecidableInstances\n"; } \ No newline at end of file diff --git a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/directory.nix b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/directory.nix new file mode 100644 index 0000000000..dc12137aeb --- /dev/null +++ b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/directory.nix @@ -0,0 +1,66 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + ({ + flags = { os-string = false; }; + package = { + specVersion = "2.2"; + identifier = { name = "directory"; version = "1.3.9.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Platform-agnostic library for filesystem operations"; + description = "This library provides a basic set of operations for manipulating files and\ndirectories in a portable way."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = ([ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ + (hsPkgs."unix" or (errorHandler.buildDepError "unix")) + ])) ++ (if flags.os-string + then [ + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."os-string" or (errorHandler.buildDepError "os-string")) + ] + else [ + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + ]); + buildable = true; + }; + tests = { + "test" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + buildable = true; + }; + }; + }; + } // { + src = pkgs.lib.mkDefault (pkgs.fetchurl { + url = "http://hackage.haskell.org/package/directory-1.3.9.0.tar.gz"; + sha256 = "20a24846117fc5f8751d974b7de07210a161989410467e9adca525381b8e64cc"; + }); + }) // { + package-description-override = "cabal-version: 2.2\nname: directory\nversion: 1.3.9.0\nlicense: BSD-3-Clause\nlicense-file: LICENSE\nmaintainer: libraries@haskell.org\nbug-reports: https://github.com/haskell/directory/issues\nsynopsis: Platform-agnostic library for filesystem operations\ndescription:\n This library provides a basic set of operations for manipulating files and\n directories in a portable way.\ncategory: System\nbuild-type: Configure\ntested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.4 || == 9.4.3\n\nextra-tmp-files:\n autom4te.cache\n config.log\n config.status\n HsDirectoryConfig.h\n\nextra-doc-files:\n README.md\n changelog.md\n\nextra-source-files:\n HsDirectoryConfig.h.in\n System/Directory/Internal/*.h\n configure\n configure.ac\n tests/*.hs\n tests/util.inl\n\nsource-repository head\n type: git\n location: https://github.com/haskell/directory\n\nflag os-string\n description: Use the new os-string package\n default: False\n manual: False\n\nLibrary\n default-language: Haskell2010\n other-extensions: CApiFFI, CPP\n\n exposed-modules:\n System.Directory\n System.Directory.OsPath\n System.Directory.Internal\n System.Directory.Internal.Prelude\n other-modules:\n System.Directory.Internal.C_utimensat\n System.Directory.Internal.Common\n System.Directory.Internal.Config\n System.Directory.Internal.Posix\n System.Directory.Internal.Windows\n\n include-dirs: .\n\n build-depends:\n base >= 4.13.0 && < 4.21,\n file-io >= 0.1.4 && < 0.2,\n time >= 1.8.0 && < 1.15,\n if os(windows)\n build-depends: Win32 >= 2.13.3 && < 2.15\n else\n build-depends: unix >= 2.8.0 && < 2.9\n\n if flag(os-string)\n build-depends: filepath >= 1.5.0.0, os-string >= 2.0.0\n else\n build-depends: filepath >= 1.4.100.0 && < 1.5.0.0\n\n ghc-options: -Wall\n\ntest-suite test\n default-language: Haskell2010\n other-extensions: BangPatterns, CPP\n default-extensions: OverloadedStrings\n ghc-options: -Wall\n hs-source-dirs: tests\n main-is: Main.hs\n type: exitcode-stdio-1.0\n build-depends: base, directory, filepath, time\n if os(windows)\n build-depends: Win32\n else\n build-depends: unix\n other-modules:\n TestUtils\n Util\n -- test-modules-begin\n CanonicalizePath\n CopyFile001\n CopyFile002\n CopyFileWithMetadata\n CreateDirectory001\n CreateDirectoryIfMissing001\n CurrentDirectory001\n Directory001\n DoesDirectoryExist001\n DoesPathExist\n FileTime\n FindFile001\n GetDirContents001\n GetDirContents002\n GetFileSize\n GetHomeDirectory001\n GetHomeDirectory002\n GetPermissions001\n LongPaths\n MakeAbsolute\n MinimizeNameConflicts\n PathIsSymbolicLink\n RemoveDirectoryRecursive001\n RemovePathForcibly\n RenameDirectory\n RenameFile001\n RenamePath\n Simplify\n T8482\n WithCurrentDirectory\n Xdg\n -- test-modules-end\n"; + } \ No newline at end of file diff --git a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/file-io.nix b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/file-io.nix new file mode 100644 index 0000000000..04cc73221f --- /dev/null +++ b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/file-io.nix @@ -0,0 +1,120 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + ({ + flags = { os-string = false; }; + package = { + specVersion = "2.4"; + identifier = { name = "file-io"; version = "0.1.4"; }; + license = "BSD-3-Clause"; + copyright = "Julian Ospald 2022"; + maintainer = "hasufell@posteo.de"; + author = "Julian Ospald"; + homepage = "https://github.com/hasufell/file-io"; + url = ""; + synopsis = "Basic file IO operations via 'OsPath'"; + description = "Basic file IO operations like Prelude, but for 'OsPath'."; + buildType = "Simple"; + }; + components = { + "library" = { + depends = ([ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ + (hsPkgs."unix" or (errorHandler.buildDepError "unix")) + ])) ++ (if flags.os-string + then [ + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."os-string" or (errorHandler.buildDepError "os-string")) + ] + else [ + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + ]); + buildable = true; + }; + tests = { + "T15" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."tasty" or (errorHandler.buildDepError "tasty")) + (hsPkgs."tasty-hunit" or (errorHandler.buildDepError "tasty-hunit")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."temporary" or (errorHandler.buildDepError "temporary")) + ] ++ pkgs.lib.optional (system.isWindows) (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")); + buildable = true; + }; + "T15Win" = { + depends = if system.isWindows + then [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."tasty" or (errorHandler.buildDepError "tasty")) + (hsPkgs."tasty-hunit" or (errorHandler.buildDepError "tasty-hunit")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."temporary" or (errorHandler.buildDepError "temporary")) + (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) + ] + else [ (hsPkgs."base" or (errorHandler.buildDepError "base")) ]; + buildable = true; + }; + "T14" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."temporary" or (errorHandler.buildDepError "temporary")) + ]; + buildable = true; + }; + "T8" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."temporary" or (errorHandler.buildDepError "temporary")) + ]; + buildable = true; + }; + "CLC237" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."temporary" or (errorHandler.buildDepError "temporary")) + ]; + buildable = true; + }; + "Properties" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."tasty" or (errorHandler.buildDepError "tasty")) + (hsPkgs."tasty-hunit" or (errorHandler.buildDepError "tasty-hunit")) + (hsPkgs."file-io" or (errorHandler.buildDepError "file-io")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."temporary" or (errorHandler.buildDepError "temporary")) + ]; + buildable = true; + }; + }; + }; + } // { + src = pkgs.lib.mkDefault (pkgs.fetchurl { + url = "http://hackage.haskell.org/package/file-io-0.1.4.tar.gz"; + sha256 = "e3d9113a015c57e3d8c2294550c41544f84a265291fed96cca697f91b6e86f52"; + }); + }) // { + package-description-override = "cabal-version: 2.4\nname: file-io\nversion: 0.1.4\nsynopsis: Basic file IO operations via 'OsPath'\ndescription: Basic file IO operations like Prelude, but for 'OsPath'.\nhomepage: https://github.com/hasufell/file-io\nbug-reports: https://github.com/hasufell/file-io/issues\nlicense: BSD-3-Clause\nauthor: Julian Ospald\nmaintainer: hasufell@posteo.de\ncopyright: Julian Ospald 2022\ncategory: System\nextra-source-files:\n CHANGELOG.md\ntested-with: GHC==9.8.1,\n GHC==9.4.8,\n GHC==9.2.8,\n GHC==9.0.2,\n GHC==8.10.7,\n GHC==8.8.4\n\nsource-repository head\n type: git\n location: https://github.com/hasufell/file-io.git\n\nflag os-string\n description: Use the new os-string package\n default: False\n manual: False\n\nlibrary\n default-language: Haskell2010\n\n if os(windows)\n hs-source-dirs: windows\n build-depends: Win32 >=2.13.3.0\n\n else\n hs-source-dirs: posix\n build-depends: unix >=2.8.0.0\n\n hs-source-dirs: .\n build-depends:\n , base >=4.13.0.0 && <5\n , bytestring >=0.11.3.0\n , deepseq\n\n if flag(os-string)\n build-depends: filepath >= 1.5.0.0, os-string >= 2.0.0\n else\n build-depends: filepath >= 1.4.100.0 && < 1.5.0.0\n\n exposed-modules:\n System.File.OsPath\n System.File.OsPath.Internal\n System.File.PlatformPath\n System.File.PlatformPath.Internal\n\n other-modules: System.File.Platform\n\n ghc-options: -Wall\n\ntest-suite T15\n hs-source-dirs: tests\n main-is: T15.hs\n type: exitcode-stdio-1.0\n default-language: Haskell2010\n build-depends: base >=4.13.0.0 && <5, tasty, tasty-hunit, file-io, filepath, temporary\n ghc-options: -Wall -threaded -rtsopts \"-with-rtsopts=-N10\"\n if os(windows)\n build-depends: Win32 >=2.13.3.0\n\ntest-suite T15Win\n hs-source-dirs: tests\n main-is: T15Win.hs\n type: exitcode-stdio-1.0\n default-language: Haskell2010\n if os(windows)\n build-depends: base >=4.13.0.0 && <5, tasty, tasty-hunit, file-io, filepath, temporary, Win32 >=2.13.3.0\n else\n build-depends: base >=4.13.0.0 && <5\n ghc-options: -Wall -threaded -rtsopts \"-with-rtsopts=-N10\"\n\ntest-suite T14\n hs-source-dirs: tests\n main-is: T14.hs\n type: exitcode-stdio-1.0\n default-language: Haskell2010\n build-depends: base >=4.13.0.0 && <5, file-io, filepath, temporary\n ghc-options: -Wall\n\ntest-suite T8\n hs-source-dirs: tests\n main-is: T8.hs\n type: exitcode-stdio-1.0\n default-language: Haskell2010\n build-depends: base >=4.13.0.0 && <5, bytestring, file-io, filepath, temporary\n ghc-options: -Wall -threaded\n\ntest-suite CLC237\n hs-source-dirs: tests\n main-is: CLC237.hs\n type: exitcode-stdio-1.0\n default-language: Haskell2010\n build-depends: base >=4.13.0.0 && <5, file-io, filepath, temporary\n ghc-options: -Wall\n\ntest-suite Properties\n hs-source-dirs: tests\n main-is: Properties.hs\n type: exitcode-stdio-1.0\n default-language: Haskell2010\n build-depends: base >=4.13.0.0 && <5, bytestring, tasty, tasty-hunit, file-io, filepath, temporary\n ghc-options: -Wall -threaded -rtsopts \"-with-rtsopts=-N10\"\n\n"; + } \ No newline at end of file diff --git a/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/process.nix b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/process.nix new file mode 100644 index 0000000000..22b3c4b10e --- /dev/null +++ b/materialized/ghc964/hadrian-ghc96/hadrian/cabal-files/process.nix @@ -0,0 +1,50 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + ({ + flags = {}; + package = { + specVersion = "2.4"; + identifier = { name = "process"; version = "1.6.25.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "libraries@haskell.org"; + author = ""; + homepage = ""; + url = ""; + synopsis = "Process libraries"; + description = "This package contains libraries for dealing with system processes.\n\nThe typed-process package is a more recent take on a process API,\nwhich uses this package internally. It features better binary\nsupport, easier concurrency, and a more composable API. You can\nread more about it at\n."; + buildType = "Configure"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."filepath" or (errorHandler.buildDepError "filepath")) + (hsPkgs."deepseq" or (errorHandler.buildDepError "deepseq")) + ] ++ (if system.isWindows + then [ (hsPkgs."Win32" or (errorHandler.buildDepError "Win32")) ] + else [ (hsPkgs."unix" or (errorHandler.buildDepError "unix")) ]); + libs = pkgs.lib.optionals (system.isWindows) [ + (pkgs."kernel32" or (errorHandler.sysDepError "kernel32")) + (pkgs."ole32" or (errorHandler.sysDepError "ole32")) + (pkgs."rpcrt4" or (errorHandler.sysDepError "rpcrt4")) + ]; + buildable = true; + }; + }; + } // { + src = pkgs.lib.mkDefault (pkgs.fetchurl { + url = "http://hackage.haskell.org/package/process-1.6.25.0.tar.gz"; + sha256 = "496fe0566c3915b112e9772ac9c967dfeb8d5ca04895e54ae0160522bee76e65"; + }); + }) // { + package-description-override = "cabal-version: 2.4\nname: process\nversion: 1.6.25.0\n-- NOTE: Don't forget to update ./changelog.md\nlicense: BSD-3-Clause\nlicense-file: LICENSE\nmaintainer: libraries@haskell.org\nbug-reports: https://github.com/haskell/process/issues\nsynopsis: Process libraries\ncategory: System\nbuild-type: Configure\ndescription:\n This package contains libraries for dealing with system processes.\n .\n The typed-process package is a more recent take on a process API,\n which uses this package internally. It features better binary\n support, easier concurrency, and a more composable API. You can\n read more about it at\n .\n\nextra-doc-files:\n changelog.md\n\nextra-source-files:\n aclocal.m4\n configure\n configure.ac\n include/HsProcessConfig.h.in\n process.buildinfo\n exes/echo.bat\n exes/subdir/echo.bat\n cbits/posix/common.h\n\nextra-tmp-files:\n autom4te.cache\n config.log\n config.status\n include/HsProcessConfig.h\n\nsource-repository head\n type: git\n location: https://github.com/haskell/process.git\n\nlibrary\n default-language: Haskell2010\n other-extensions:\n BangPatterns\n CPP\n InterruptibleFFI\n RecordWildCards\n Trustworthy\n Safe\n\n exposed-modules:\n System.Cmd\n System.Process\n System.Process.CommunicationHandle\n System.Process.CommunicationHandle.Internal\n System.Process.Internals\n other-modules: System.Process.Common\n if os(windows)\n c-sources:\n cbits/win32/runProcess.c\n other-modules: System.Process.Windows\n build-depends: Win32 >=2.4 && < 2.15\n -- ole32 and rpcrt4 are needed to create GUIDs for unique named pipes\n -- for process.\n extra-libraries: kernel32, ole32, rpcrt4\n cpp-options: -DWINDOWS\n else\n build-depends: unix >= 2.5 && < 2.9\n if arch(javascript)\n js-sources:\n jsbits/process.js\n other-modules: System.Process.JavaScript\n else\n c-sources:\n cbits/posix/runProcess.c\n cbits/posix/fork_exec.c\n cbits/posix/posix_spawn.c\n cbits/posix/find_executable.c\n other-modules: System.Process.Posix\n\n include-dirs: include\n install-includes:\n runProcess.h\n processFlags.h\n\n ghc-options: -Wall\n\n build-depends: base >= 4.10 && < 4.21,\n directory >= 1.1 && < 1.4,\n filepath >= 1.2 && < 1.6,\n deepseq >= 1.1 && < 1.6\n"; + } \ No newline at end of file diff --git a/materialized/ghc964/hadrian-ghc96/hadrian/default.nix b/materialized/ghc964/hadrian-ghc96/hadrian/default.nix index 8bd2488da9..11ed2f8ef5 100644 --- a/materialized/ghc964/hadrian-ghc96/hadrian/default.nix +++ b/materialized/ghc964/hadrian-ghc96/hadrian/default.nix @@ -20,7 +20,7 @@ hashable.flags.arch-native = false; heaps.revision = import ./cabal-files/heaps.nix; Cabal-syntax.revision = import ./cabal-files/Cabal-syntax.nix; - process.revision = hackage.process."1.6.17.0".revisions.default; + process.revision = import ./cabal-files/process.nix; primitive.revision = import ./cabal-files/primitive.nix; stm.revision = hackage.stm."2.5.1.0".revisions.default; template-haskell.revision = hackage.template-haskell."2.20.0.0".revisions.default; @@ -47,7 +47,10 @@ random.revision = import ./cabal-files/random.nix; bytestring.revision = hackage.bytestring."0.11.5.3".revisions.default; Cabal.revision = import ./cabal-files/Cabal.nix; - directory.revision = hackage.directory."1.3.8.1".revisions.default; + directory.revision = import ./cabal-files/directory.nix; + directory.flags.os-string = false; + file-io.revision = import ./cabal-files/file-io.nix; + file-io.flags.os-string = false; js-flot.revision = import ./cabal-files/js-flot.nix; ghc-bignum.revision = hackage.ghc-bignum."1.3".revisions.default; binary.revision = hackage.binary."0.8.9.1".revisions.default; @@ -72,9 +75,7 @@ "time" = "1.12.2"; "stm" = "2.5.1.0"; "ghc-bignum" = "1.3"; - "directory" = "1.3.8.1"; "template-haskell" = "2.20.0.0"; - "process" = "1.6.17.0"; "binary" = "0.8.9.1"; "pretty" = "1.1.3.6"; "text" = "2.0.2"; @@ -98,7 +99,6 @@ "ghc-boot-th" "mtl" "pretty" - "process" "stm" "template-haskell" "exceptions" @@ -109,7 +109,6 @@ "containers" "array" "bytestring" - "directory" "ghc-bignum" "binary" "filepath" @@ -135,6 +134,7 @@ "unordered-containers".components.library.planned = lib.mkOverride 900 true; "text".components.library.planned = lib.mkOverride 900 true; "base".components.library.planned = lib.mkOverride 900 true; + "file-io".components.library.planned = lib.mkOverride 900 true; "js-flot".components.library.planned = lib.mkOverride 900 true; "splitmix".components.library.planned = lib.mkOverride 900 true; "filepath".components.library.planned = lib.mkOverride 900 true; diff --git a/materialized/ghc964/hadrian-ghc96/plan.json b/materialized/ghc964/hadrian-ghc96/plan.json index ba1bc64fe7..ec18f2a0d0 100644 --- a/materialized/ghc964/hadrian-ghc96/plan.json +++ b/materialized/ghc964/hadrian-ghc96/plan.json @@ -1 +1 @@ -{"cabal-version":"3.10.3.0","cabal-lib-version":"3.10.3.0","compiler-id":"ghc-9.6.4","os":"linux","arch":"x86_64","install-plan":[{"type":"configured","id":"Cabal-3.8.1.0-c668f818769193b477ca1a8b87e802e56126adbc7bed962d76bde34a01e8c306","pkg-name":"Cabal","pkg-version":"3.8.1.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"77121d8e1aff14a0fd95684b751599db78a7dd26d55862d9fcef27c88b193e9d","pkg-src-sha256":"7464cbe6c2f3d7e5d0232023a1a7330621f8b24853cb259fc89a2af85b736608","depends":["Cabal-syntax-3.8.1.0-b99db30153f1d2c83dc6d34e637d577dc69cabe5825778a1e3462bcf8317b588","array-0.5.6.0","base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","deepseq-1.4.8.1","directory-1.3.8.1","filepath-1.4.200.1","mtl-2.3.1","parsec-3.1.16.1","pretty-1.1.3.6","process-1.6.17.0","text-2.0.2","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"Cabal-syntax-3.8.1.0-b99db30153f1d2c83dc6d34e637d577dc69cabe5825778a1e3462bcf8317b588","pkg-name":"Cabal-syntax","pkg-version":"3.8.1.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"ed2d937ba6c6a20b75850349eedd41374885fc42369ef152d69e2ba70f44f593","pkg-src-sha256":"07e8ddb19fe01781485f1522b6afc22aba680b0ab28ebe6bbfb84a2dd698ce0f","depends":["array-0.5.6.0","base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","containers-0.6.7","deepseq-1.4.8.1","directory-1.3.8.1","filepath-1.4.200.1","mtl-2.3.1","parsec-3.1.16.1","pretty-1.1.3.6","text-2.0.2","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"QuickCheck-2.14.3-12660abe9f5c6a28f87584c784112e82267cee7f5b9b5a1823ce30f9270ebf1a","pkg-name":"QuickCheck","pkg-version":"2.14.3","flags":{"old-random":false,"templatehaskell":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"f03d2f404d5ba465453d0fbc1944832789a759fe7c4f9bf8616bc1378a02fde4","pkg-src-sha256":"5c0f22b36b28a1a8fa110b3819818d3f29494a3b0dedbae299f064123ca70501","depends":["base-4.18.2.0","containers-0.6.7","deepseq-1.4.8.1","random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187","template-haskell-2.20.0.0","transformers-0.6.1.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"array-0.5.6.0","pkg-name":"array","pkg-version":"0.5.6.0","depends":["base-4.18.2.0"]},{"type":"pre-existing","id":"base-4.18.2.0","pkg-name":"base","pkg-version":"4.18.2.0","depends":["ghc-bignum-1.3","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"binary-0.8.9.1","pkg-name":"binary","pkg-version":"0.8.9.1","depends":["array-0.5.6.0","base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"bytestring-0.11.5.3","pkg-name":"bytestring","pkg-version":"0.11.5.3","depends":["base-4.18.2.0","deepseq-1.4.8.1","ghc-prim-0.10.0","template-haskell-2.20.0.0"]},{"type":"configured","id":"clock-0.8.4-b6af39fafa1fb93e9520050c562fc2d9803a08bc83cda5d8b8d907beefe150aa","pkg-name":"clock","pkg-version":"0.8.4","flags":{"llvm":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"b938655b00cf204ce69abfff946021bed111d2609a9f7a9c22e28a1a202e9115","pkg-src-sha256":"6ae9898afe788a5e334cd5fad5d18a3c2e8e59fa09aaf7b957dbb38a4767df2e","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"containers-0.6.7","pkg-name":"containers","pkg-version":"0.6.7","depends":["array-0.5.6.0","base-4.18.2.0","deepseq-1.4.8.1","template-haskell-2.20.0.0"]},{"type":"pre-existing","id":"deepseq-1.4.8.1","pkg-name":"deepseq","pkg-version":"1.4.8.1","depends":["array-0.5.6.0","base-4.18.2.0","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"directory-1.3.8.1","pkg-name":"directory","pkg-version":"1.3.8.1","depends":["base-4.18.2.0","filepath-1.4.200.1","time-1.12.2","unix-2.8.4.0"]},{"type":"pre-existing","id":"exceptions-0.10.7","pkg-name":"exceptions","pkg-version":"0.10.7","depends":["base-4.18.2.0","mtl-2.3.1","stm-2.5.1.0","template-haskell-2.20.0.0","transformers-0.6.1.0"]},{"type":"configured","id":"extra-1.7.16-dc63228cbe6629bad55bc0268aff37cd1d9389acb03be20763ed611a10fe3efc","pkg-name":"extra","pkg-version":"1.7.16","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"edd191f77adf31acb1b53960b4d1ca9fca925ac28345a396c614414cb7bfa7ec","pkg-src-sha256":"250c6d43c30b2c71f2cf498a10e69e43ac035974d3819529385d99e42ce77c70","depends":["base-4.18.2.0","clock-0.8.4-b6af39fafa1fb93e9520050c562fc2d9803a08bc83cda5d8b8d907beefe150aa","directory-1.3.8.1","filepath-1.4.200.1","process-1.6.17.0","time-1.12.2","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"filepath-1.4.200.1","pkg-name":"filepath","pkg-version":"1.4.200.1","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","exceptions-0.10.7","template-haskell-2.20.0.0"]},{"type":"configured","id":"filepattern-0.1.3-c45690bc0b4b5c677f6943e7896ddd599d085687db6e459293ba6fa381af7c6e","pkg-name":"filepattern","pkg-version":"0.1.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"372c1733d83b90045eb29da9f010fed79bfef8771ce65eb126a1d83ecc54a9a2","pkg-src-sha256":"cc445d439ea2f65cac7604d3578aa2c3a62e5a91dc989f4ce5b3390db9e59636","depends":["base-4.18.2.0","directory-1.3.8.1","extra-1.7.16-dc63228cbe6629bad55bc0268aff37cd1d9389acb03be20763ed611a10fe3efc","filepath-1.4.200.1"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"ghc-bignum-1.3","pkg-name":"ghc-bignum","pkg-version":"1.3","depends":["ghc-prim-0.10.0"]},{"type":"pre-existing","id":"ghc-boot-th-9.6.4","pkg-name":"ghc-boot-th","pkg-version":"9.6.4","depends":["base-4.18.2.0"]},{"type":"pre-existing","id":"ghc-prim-0.10.0","pkg-name":"ghc-prim","pkg-version":"0.10.0","depends":[]},{"type":"configured","id":"hadrian-0.1.0.0-inplace-hadrian","pkg-name":"hadrian","pkg-version":"0.1.0.0","flags":{"selftest":true,"threaded":true},"style":"local","pkg-src":{"type":"local","path":"./hadrian/."},"dist-dir":"./hadrian/dist-newstyle/build/x86_64-linux/ghc-9.6.4/hadrian-0.1.0.0/x/hadrian","build-info":"./hadrian/dist-newstyle/build/x86_64-linux/ghc-9.6.4/hadrian-0.1.0.0/x/hadrian/build-info.json","depends":["Cabal-3.8.1.0-c668f818769193b477ca1a8b87e802e56126adbc7bed962d76bde34a01e8c306","QuickCheck-2.14.3-12660abe9f5c6a28f87584c784112e82267cee7f5b9b5a1823ce30f9270ebf1a","base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","directory-1.3.8.1","extra-1.7.16-dc63228cbe6629bad55bc0268aff37cd1d9389acb03be20763ed611a10fe3efc","filepath-1.4.200.1","mtl-2.3.1","parsec-3.1.16.1","shake-0.19.8-0ddb83d9db09621c7b8f326abc494d14323dc5751be6943ac5b5e19c9347d5c3","text-2.0.2","time-1.12.2","transformers-0.6.1.0","unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737"],"exe-depends":[],"component-name":"exe:hadrian","bin-file":"./hadrian/dist-newstyle/build/x86_64-linux/ghc-9.6.4/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian"},{"type":"configured","id":"hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","pkg-name":"hashable","pkg-version":"1.5.0.0","flags":{"arch-native":false,"random-initial-seed":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"fc68b07d957ade5a0a0beadd560a8d093ceac30b2f35c85eed3bcf7889a25975","pkg-src-sha256":"e58b3a8e18da5f6cd7e937e5fd683e500bb1f8276b3768269759119ca0cddb6a","depends":["base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","deepseq-1.4.8.1","filepath-1.4.200.1","ghc-bignum-1.3","ghc-prim-0.10.0","os-string-2.0.6-01e3c1e4563fbed004a4ac273e2beea9dfd497789ab9039e09b96161f470a497","text-2.0.2"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","pkg-name":"heaps","pkg-version":"0.4","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"66b19fcd813b0e4db3e0bac541bd46606c3b13d3d081d9f9666f4be0f5ff14b8","pkg-src-sha256":"89329df8b95ae99ef272e41e7a2d0fe2f1bb7eacfcc34bc01664414b33067cfd","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","pkg-name":"js-dgtable","pkg-version":"0.5.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"f75cb4fa53c88c65794becdd48eb0d3b2b8abd89a3d5c19e87af91f5225c15e4","pkg-src-sha256":"e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","pkg-name":"js-flot","pkg-version":"0.8.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4c1c447a9a2fba0adba6d30678302a30c32b9dfde9e7aa9e9156483e1545096d","pkg-src-sha256":"1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","pkg-name":"js-jquery","pkg-version":"3.3.1","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"59ab6c79159549ef94b584abce8e6d3b336014c2cce1337b59a8f637e2856df5","pkg-src-sha256":"e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"mtl-2.3.1","pkg-name":"mtl","pkg-version":"2.3.1","depends":["base-4.18.2.0","transformers-0.6.1.0"]},{"type":"configured","id":"os-string-2.0.6-01e3c1e4563fbed004a4ac273e2beea9dfd497789ab9039e09b96161f470a497","pkg-name":"os-string","pkg-version":"2.0.6","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030","pkg-src-sha256":"22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","exceptions-0.10.7","template-haskell-2.20.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"parsec-3.1.16.1","pkg-name":"parsec","pkg-version":"3.1.16.1","depends":["base-4.18.2.0","bytestring-0.11.5.3","mtl-2.3.1","text-2.0.2"]},{"type":"pre-existing","id":"pretty-1.1.3.6","pkg-name":"pretty","pkg-version":"1.1.3.6","depends":["base-4.18.2.0","deepseq-1.4.8.1","ghc-prim-0.10.0"]},{"type":"configured","id":"primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","pkg-name":"primitive","pkg-version":"0.9.0.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"2e08c5409e3559c7f1669ef50e9a0d9a397e68ecf51110d5e2cedf05cdd7d93c","pkg-src-sha256":"696d4bd291c94d736142d6182117dca4258d3ef28bfefdb649ac8b5ecd0999c7","depends":["base-4.18.2.0","deepseq-1.4.8.1","template-haskell-2.20.0.0","transformers-0.6.1.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"process-1.6.17.0","pkg-name":"process","pkg-version":"1.6.17.0","depends":["base-4.18.2.0","deepseq-1.4.8.1","directory-1.3.8.1","filepath-1.4.200.1","unix-2.8.4.0"]},{"type":"configured","id":"random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","pkg-name":"random","pkg-version":"1.2.1.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"32397de181e20ccaacf806ec70de9308cf044f089a2be37c936f3f8967bde867","pkg-src-sha256":"790f4dc2d2327c453ff6aac7bf15399fd123d55e927935f68f84b5df42d9a4b4","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","mtl-2.3.1","splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"shake-0.19.8-0ddb83d9db09621c7b8f326abc494d14323dc5751be6943ac5b5e19c9347d5c3","pkg-name":"shake","pkg-version":"0.19.8","flags":{"cloud":false,"embed-files":false,"portable":false,"threaded":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"03c8f06de478e07ad6fde95984c9206920106d0d8432ecb7ab825ef108d45382","pkg-src-sha256":"6384e33a26a2590bf33719e88881076b899ac4b5340c1c9271e4caa37e9d6535","depends":["base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","deepseq-1.4.8.1","directory-1.3.8.1","extra-1.7.16-dc63228cbe6629bad55bc0268aff37cd1d9389acb03be20763ed611a10fe3efc","filepath-1.4.200.1","filepattern-0.1.3-c45690bc0b4b5c677f6943e7896ddd599d085687db6e459293ba6fa381af7c6e","hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","process-1.6.17.0","random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0","unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"shake-0.19.8-e-shake-7559c7ff704c4f74648b4baa6b6f1b1db1f99fa251704d87397a432f656a4846","pkg-name":"shake","pkg-version":"0.19.8","flags":{"cloud":false,"embed-files":false,"portable":false,"threaded":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"03c8f06de478e07ad6fde95984c9206920106d0d8432ecb7ab825ef108d45382","pkg-src-sha256":"6384e33a26a2590bf33719e88881076b899ac4b5340c1c9271e4caa37e9d6535","depends":["base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","deepseq-1.4.8.1","directory-1.3.8.1","extra-1.7.16-dc63228cbe6629bad55bc0268aff37cd1d9389acb03be20763ed611a10fe3efc","filepath-1.4.200.1","filepattern-0.1.3-c45690bc0b4b5c677f6943e7896ddd599d085687db6e459293ba6fa381af7c6e","hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","process-1.6.17.0","random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0","unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05"],"exe-depends":[],"component-name":"exe:shake","bin-file":"/store/ghc-9.6.4/shake-0.19.8-e-shake-7559c7ff704c4f74648b4baa6b6f1b1db1f99fa251704d87397a432f656a4846/bin/shake"},{"type":"configured","id":"splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187","pkg-name":"splitmix","pkg-version":"0.1.0.5","flags":{"optimised-mixer":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"caa9b4a92abf1496c7f6a3c0f4e357426a54880077cb9f04e260a8bfa034b77b","pkg-src-sha256":"9df07a9611ef45f1b1258a0b412f4d02c920248f69d2e2ce8ccda328f7e13002","depends":["base-4.18.2.0","deepseq-1.4.8.1"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"stm-2.5.1.0","pkg-name":"stm","pkg-version":"2.5.1.0","depends":["array-0.5.6.0","base-4.18.2.0"]},{"type":"pre-existing","id":"system-cxx-std-lib-1.0","pkg-name":"system-cxx-std-lib","pkg-version":"1.0","depends":[]},{"type":"pre-existing","id":"template-haskell-2.20.0.0","pkg-name":"template-haskell","pkg-version":"2.20.0.0","depends":["base-4.18.2.0","ghc-boot-th-9.6.4","ghc-prim-0.10.0","pretty-1.1.3.6"]},{"type":"pre-existing","id":"text-2.0.2","pkg-name":"text","pkg-version":"2.0.2","depends":["array-0.5.6.0","base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","deepseq-1.4.8.1","ghc-prim-0.10.0","system-cxx-std-lib-1.0","template-haskell-2.20.0.0"]},{"type":"pre-existing","id":"time-1.12.2","pkg-name":"time","pkg-version":"1.12.2","depends":["base-4.18.2.0","deepseq-1.4.8.1"]},{"type":"pre-existing","id":"transformers-0.6.1.0","pkg-name":"transformers","pkg-version":"0.6.1.0","depends":["base-4.18.2.0","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"unix-2.8.4.0","pkg-name":"unix","pkg-version":"2.8.4.0","depends":["base-4.18.2.0","bytestring-0.11.5.3","filepath-1.4.200.1","time-1.12.2"]},{"type":"configured","id":"unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","pkg-name":"unordered-containers","pkg-version":"0.2.20","flags":{"debug":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"c7fe9cba405ed9905e12d89c7add3b3eb9868dfba7975e70ba0cdd64b7b11abc","pkg-src-sha256":"d9cfb287cf00592d39dc9c3cac8b99627ea08f2c01798e70130fc39f7c90f11d","depends":["base-4.18.2.0","deepseq-1.4.8.1","hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","template-haskell-2.20.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05","pkg-name":"utf8-string","pkg-version":"1.0.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"79416292186feeaf1f60e49ac5a1ffae9bf1b120e040a74bf0e81ca7f1d31d3f","pkg-src-sha256":"ee48deada7600370728c4156cb002441de770d0121ae33a68139a9ed9c19b09a","depends":["base-4.18.2.0","bytestring-0.11.5.3"],"exe-depends":[],"component-name":"lib"}],"targets":[{"pkg-name":"Cabal","pkg-version":"3.8.1.0","component-name":"lib","available":[{"id":"Cabal-3.8.1.0-c668f818769193b477ca1a8b87e802e56126adbc7bed962d76bde34a01e8c306","component-name":"lib","build-by-default":true}]},{"pkg-name":"Cabal-syntax","pkg-version":"3.8.1.0","component-name":"lib","available":[{"id":"Cabal-syntax-3.8.1.0-b99db30153f1d2c83dc6d34e637d577dc69cabe5825778a1e3462bcf8317b588","component-name":"lib","build-by-default":true}]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"lib","available":[{"id":"QuickCheck-2.14.3-12660abe9f5c6a28f87584c784112e82267cee7f5b9b5a1823ce30f9270ebf1a","component-name":"lib","build-by-default":true}]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-gcoarbitrary","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-generators","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-gshrink","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-misc","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-monadfix","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-split","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-terminal","available":["TargetNotLocal"]},{"pkg-name":"array","pkg-version":"0.5.6.0","component-name":"lib","available":[{"id":"array-0.5.6.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"base","pkg-version":"4.18.2.0","component-name":"lib","available":[{"id":"base-4.18.2.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"binary","pkg-version":"0.8.9.1","component-name":"lib","available":[{"id":"binary-0.8.9.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"bytestring","pkg-version":"0.11.5.3","component-name":"lib","available":[{"id":"bytestring-0.11.5.3","component-name":"lib","build-by-default":true}]},{"pkg-name":"clock","pkg-version":"0.8.4","component-name":"lib","available":[{"id":"clock-0.8.4-b6af39fafa1fb93e9520050c562fc2d9803a08bc83cda5d8b8d907beefe150aa","component-name":"lib","build-by-default":true}]},{"pkg-name":"clock","pkg-version":"0.8.4","component-name":"test:test","available":["TargetNotLocal"]},{"pkg-name":"clock","pkg-version":"0.8.4","component-name":"bench:benchmarks","available":["TargetNotLocal"]},{"pkg-name":"containers","pkg-version":"0.6.7","component-name":"lib","available":[{"id":"containers-0.6.7","component-name":"lib","build-by-default":true}]},{"pkg-name":"deepseq","pkg-version":"1.4.8.1","component-name":"lib","available":[{"id":"deepseq-1.4.8.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"directory","pkg-version":"1.3.8.1","component-name":"lib","available":[{"id":"directory-1.3.8.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"exceptions","pkg-version":"0.10.7","component-name":"lib","available":[{"id":"exceptions-0.10.7","component-name":"lib","build-by-default":true}]},{"pkg-name":"extra","pkg-version":"1.7.16","component-name":"lib","available":[{"id":"extra-1.7.16-dc63228cbe6629bad55bc0268aff37cd1d9389acb03be20763ed611a10fe3efc","component-name":"lib","build-by-default":true}]},{"pkg-name":"extra","pkg-version":"1.7.16","component-name":"test:extra-test","available":["TargetNotLocal"]},{"pkg-name":"filepath","pkg-version":"1.4.200.1","component-name":"lib","available":[{"id":"filepath-1.4.200.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"filepattern","pkg-version":"0.1.3","component-name":"lib","available":[{"id":"filepattern-0.1.3-c45690bc0b4b5c677f6943e7896ddd599d085687db6e459293ba6fa381af7c6e","component-name":"lib","build-by-default":true}]},{"pkg-name":"filepattern","pkg-version":"0.1.3","component-name":"test:filepattern-test","available":["TargetNotLocal"]},{"pkg-name":"ghc-bignum","pkg-version":"1.3","component-name":"lib","available":[{"id":"ghc-bignum-1.3","component-name":"lib","build-by-default":true}]},{"pkg-name":"ghc-boot-th","pkg-version":"9.6.4","component-name":"lib","available":[{"id":"ghc-boot-th-9.6.4","component-name":"lib","build-by-default":true}]},{"pkg-name":"ghc-prim","pkg-version":"0.10.0","component-name":"lib","available":[{"id":"ghc-prim-0.10.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"hadrian","pkg-version":"0.1.0.0","component-name":"exe:hadrian","available":[{"id":"hadrian-0.1.0.0-inplace-hadrian","component-name":"exe:hadrian","build-by-default":true}]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"lib","available":[{"id":"hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","component-name":"lib","build-by-default":true}]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"test:hashable-examples","available":["TargetNotLocal"]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"test:hashable-tests","available":["TargetNotLocal"]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"test:xxhash-tests","available":["TargetNotLocal"]},{"pkg-name":"heaps","pkg-version":"0.4","component-name":"lib","available":[{"id":"heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-dgtable","pkg-version":"0.5.2","component-name":"lib","available":[{"id":"js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-dgtable","pkg-version":"0.5.2","component-name":"test:js-dgtable-test","available":["TargetNotLocal"]},{"pkg-name":"js-flot","pkg-version":"0.8.3","component-name":"lib","available":[{"id":"js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-flot","pkg-version":"0.8.3","component-name":"test:js-flot-test","available":["TargetNotLocal"]},{"pkg-name":"js-jquery","pkg-version":"3.3.1","component-name":"lib","available":[{"id":"js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-jquery","pkg-version":"3.3.1","component-name":"test:js-jquery-test","available":["TargetNotLocal"]},{"pkg-name":"mtl","pkg-version":"2.3.1","component-name":"lib","available":[{"id":"mtl-2.3.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"lib","available":[{"id":"os-string-2.0.6-01e3c1e4563fbed004a4ac273e2beea9dfd497789ab9039e09b96161f470a497","component-name":"lib","build-by-default":true}]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"test:bytestring-tests","available":["TargetNotLocal"]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"test:encoding-tests","available":["TargetNotLocal"]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"bench:bench","available":["TargetNotLocal"]},{"pkg-name":"parsec","pkg-version":"3.1.16.1","component-name":"lib","available":[{"id":"parsec-3.1.16.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"pretty","pkg-version":"1.1.3.6","component-name":"lib","available":[{"id":"pretty-1.1.3.6","component-name":"lib","build-by-default":true}]},{"pkg-name":"primitive","pkg-version":"0.9.0.0","component-name":"lib","available":[{"id":"primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","component-name":"lib","build-by-default":true}]},{"pkg-name":"primitive","pkg-version":"0.9.0.0","component-name":"test:test-qc","available":["TargetNotLocal"]},{"pkg-name":"primitive","pkg-version":"0.9.0.0","component-name":"bench:bench","available":["TargetNotLocal"]},{"pkg-name":"process","pkg-version":"1.6.17.0","component-name":"lib","available":[{"id":"process-1.6.17.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"lib","available":[{"id":"random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","component-name":"lib","build-by-default":true}]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:doctests","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:legacy-test","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:spec","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:spec-inspection","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"bench:bench","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"bench:legacy-bench","available":["TargetNotLocal"]},{"pkg-name":"shake","pkg-version":"0.19.8","component-name":"lib","available":[{"id":"shake-0.19.8-0ddb83d9db09621c7b8f326abc494d14323dc5751be6943ac5b5e19c9347d5c3","component-name":"lib","build-by-default":true}]},{"pkg-name":"shake","pkg-version":"0.19.8","component-name":"exe:shake","available":[{"id":"shake-0.19.8-e-shake-7559c7ff704c4f74648b4baa6b6f1b1db1f99fa251704d87397a432f656a4846","component-name":"exe:shake","build-by-default":true}]},{"pkg-name":"shake","pkg-version":"0.19.8","component-name":"test:shake-test","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"lib","available":[{"id":"splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187","component-name":"lib","build-by-default":true}]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:examples","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:initialization","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:montecarlo-pi","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:montecarlo-pi-32","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:splitmix-dieharder","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:splitmix-tests","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:splitmix-testu01","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"bench:comparison","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"bench:range","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"bench:simple-sum","available":["TargetNotLocal"]},{"pkg-name":"stm","pkg-version":"2.5.1.0","component-name":"lib","available":[{"id":"stm-2.5.1.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"system-cxx-std-lib","pkg-version":"1.0","component-name":"lib","available":[{"id":"system-cxx-std-lib-1.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"template-haskell","pkg-version":"2.20.0.0","component-name":"lib","available":[{"id":"template-haskell-2.20.0.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"text","pkg-version":"2.0.2","component-name":"lib","available":[{"id":"text-2.0.2","component-name":"lib","build-by-default":true}]},{"pkg-name":"time","pkg-version":"1.12.2","component-name":"lib","available":[{"id":"time-1.12.2","component-name":"lib","build-by-default":true}]},{"pkg-name":"transformers","pkg-version":"0.6.1.0","component-name":"lib","available":[{"id":"transformers-0.6.1.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"unix","pkg-version":"2.8.4.0","component-name":"lib","available":[{"id":"unix-2.8.4.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"unordered-containers","pkg-version":"0.2.20","component-name":"lib","available":[{"id":"unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","component-name":"lib","build-by-default":true}]},{"pkg-name":"unordered-containers","pkg-version":"0.2.20","component-name":"test:unordered-containers-tests","available":["TargetNotLocal"]},{"pkg-name":"unordered-containers","pkg-version":"0.2.20","component-name":"bench:benchmarks","available":["TargetNotLocal"]},{"pkg-name":"utf8-string","pkg-version":"1.0.2","component-name":"lib","available":[{"id":"utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05","component-name":"lib","build-by-default":true}]},{"pkg-name":"utf8-string","pkg-version":"1.0.2","component-name":"test:unit-tests","available":["TargetNotLocal"]}]} \ No newline at end of file +{"cabal-version":"3.10.3.0","cabal-lib-version":"3.10.3.0","compiler-id":"ghc-9.6.4","os":"linux","arch":"x86_64","install-plan":[{"type":"configured","id":"Cabal-3.10.3.0-fe9a4e2f6d3b51cf239a0d0da645c840fdf30442a7a2c83062b7b54358dc4a48","pkg-name":"Cabal","pkg-version":"3.10.3.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4a36954a66769eef90353daa0dbb07d43e49c228281383c7e4134445d495f714","pkg-src-sha256":"cb7f7c66626d7555f799e786513ddd65a874fd23f1cf312990c7a48abfc0b2c6","depends":["Cabal-syntax-3.10.3.0-88e1285e7405dfb1ce1417f2f1349cb91008f5a0d0381097b42750183978e546","array-0.5.6.0","base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","deepseq-1.4.8.1","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","filepath-1.4.200.1","mtl-2.3.1","parsec-3.1.16.1","pretty-1.1.3.6","process-1.6.25.0-d827dfe321191070c76b83bae4b4bdda770a9d3edfefae17d687e5eaf31c73f8","text-2.0.2","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"Cabal-syntax-3.10.3.0-88e1285e7405dfb1ce1417f2f1349cb91008f5a0d0381097b42750183978e546","pkg-name":"Cabal-syntax","pkg-version":"3.10.3.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"c2ca36499bf9365726968b1e11a757e6d846c47cdf0c2c26a003698fd3c300fe","pkg-src-sha256":"75d6a0aa9c00990a0d6e7720ac50c6954f6c942fa1be42c8add7f1c025f7e212","depends":["array-0.5.6.0","base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","containers-0.6.7","deepseq-1.4.8.1","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","filepath-1.4.200.1","mtl-2.3.1","parsec-3.1.16.1","pretty-1.1.3.6","text-2.0.2","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"QuickCheck-2.14.3-12660abe9f5c6a28f87584c784112e82267cee7f5b9b5a1823ce30f9270ebf1a","pkg-name":"QuickCheck","pkg-version":"2.14.3","flags":{"old-random":false,"templatehaskell":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"f03d2f404d5ba465453d0fbc1944832789a759fe7c4f9bf8616bc1378a02fde4","pkg-src-sha256":"5c0f22b36b28a1a8fa110b3819818d3f29494a3b0dedbae299f064123ca70501","depends":["base-4.18.2.0","containers-0.6.7","deepseq-1.4.8.1","random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187","template-haskell-2.20.0.0","transformers-0.6.1.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"array-0.5.6.0","pkg-name":"array","pkg-version":"0.5.6.0","depends":["base-4.18.2.0"]},{"type":"pre-existing","id":"base-4.18.2.0","pkg-name":"base","pkg-version":"4.18.2.0","depends":["ghc-bignum-1.3","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"binary-0.8.9.1","pkg-name":"binary","pkg-version":"0.8.9.1","depends":["array-0.5.6.0","base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"bytestring-0.11.5.3","pkg-name":"bytestring","pkg-version":"0.11.5.3","depends":["base-4.18.2.0","deepseq-1.4.8.1","ghc-prim-0.10.0","template-haskell-2.20.0.0"]},{"type":"configured","id":"clock-0.8.4-b6af39fafa1fb93e9520050c562fc2d9803a08bc83cda5d8b8d907beefe150aa","pkg-name":"clock","pkg-version":"0.8.4","flags":{"llvm":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"b938655b00cf204ce69abfff946021bed111d2609a9f7a9c22e28a1a202e9115","pkg-src-sha256":"6ae9898afe788a5e334cd5fad5d18a3c2e8e59fa09aaf7b957dbb38a4767df2e","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"containers-0.6.7","pkg-name":"containers","pkg-version":"0.6.7","depends":["array-0.5.6.0","base-4.18.2.0","deepseq-1.4.8.1","template-haskell-2.20.0.0"]},{"type":"pre-existing","id":"deepseq-1.4.8.1","pkg-name":"deepseq","pkg-version":"1.4.8.1","depends":["array-0.5.6.0","base-4.18.2.0","ghc-prim-0.10.0"]},{"type":"configured","id":"directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","pkg-name":"directory","pkg-version":"1.3.9.0","flags":{"os-string":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"ae73d4c39d18842f57d48649f4583347823ef7b1bc0bde786ca39141f7fd8c87","pkg-src-sha256":"20a24846117fc5f8751d974b7de07210a161989410467e9adca525381b8e64cc","components":{"lib":{"depends":["base-4.18.2.0","file-io-0.1.4-51915db079f01c9a6495d8a267894a9aed6b6b8f7c11259c9d5da53628dd167f","filepath-1.4.200.1","time-1.12.2","unix-2.8.4.0"],"exe-depends":[]}}},{"type":"pre-existing","id":"exceptions-0.10.7","pkg-name":"exceptions","pkg-version":"0.10.7","depends":["base-4.18.2.0","mtl-2.3.1","stm-2.5.1.0","template-haskell-2.20.0.0","transformers-0.6.1.0"]},{"type":"configured","id":"extra-1.7.16-49c389d3b325bb7343680a6b0593e42c3360ddbc37966713ffc950eadeee2718","pkg-name":"extra","pkg-version":"1.7.16","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"edd191f77adf31acb1b53960b4d1ca9fca925ac28345a396c614414cb7bfa7ec","pkg-src-sha256":"250c6d43c30b2c71f2cf498a10e69e43ac035974d3819529385d99e42ce77c70","depends":["base-4.18.2.0","clock-0.8.4-b6af39fafa1fb93e9520050c562fc2d9803a08bc83cda5d8b8d907beefe150aa","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","filepath-1.4.200.1","process-1.6.25.0-d827dfe321191070c76b83bae4b4bdda770a9d3edfefae17d687e5eaf31c73f8","time-1.12.2","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"file-io-0.1.4-51915db079f01c9a6495d8a267894a9aed6b6b8f7c11259c9d5da53628dd167f","pkg-name":"file-io","pkg-version":"0.1.4","flags":{"os-string":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"e3e1866eab82cb28f6a5f28507643da3987008b737e66a3c7398f39f16d824dc","pkg-src-sha256":"e3d9113a015c57e3d8c2294550c41544f84a265291fed96cca697f91b6e86f52","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","filepath-1.4.200.1","unix-2.8.4.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"filepath-1.4.200.1","pkg-name":"filepath","pkg-version":"1.4.200.1","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","exceptions-0.10.7","template-haskell-2.20.0.0"]},{"type":"configured","id":"filepattern-0.1.3-3194156282913050e18f34c4b4372b115c3784a9b535128618a739dd7cb95f74","pkg-name":"filepattern","pkg-version":"0.1.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"372c1733d83b90045eb29da9f010fed79bfef8771ce65eb126a1d83ecc54a9a2","pkg-src-sha256":"cc445d439ea2f65cac7604d3578aa2c3a62e5a91dc989f4ce5b3390db9e59636","depends":["base-4.18.2.0","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","extra-1.7.16-49c389d3b325bb7343680a6b0593e42c3360ddbc37966713ffc950eadeee2718","filepath-1.4.200.1"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"ghc-bignum-1.3","pkg-name":"ghc-bignum","pkg-version":"1.3","depends":["ghc-prim-0.10.0"]},{"type":"pre-existing","id":"ghc-boot-th-9.6.4","pkg-name":"ghc-boot-th","pkg-version":"9.6.4","depends":["base-4.18.2.0"]},{"type":"pre-existing","id":"ghc-prim-0.10.0","pkg-name":"ghc-prim","pkg-version":"0.10.0","depends":[]},{"type":"configured","id":"hadrian-0.1.0.0-inplace-hadrian","pkg-name":"hadrian","pkg-version":"0.1.0.0","flags":{"selftest":true,"threaded":true},"style":"local","pkg-src":{"type":"local","path":"./hadrian/."},"dist-dir":"./hadrian/dist-newstyle/build/x86_64-linux/ghc-9.6.4/hadrian-0.1.0.0/x/hadrian","build-info":"./hadrian/dist-newstyle/build/x86_64-linux/ghc-9.6.4/hadrian-0.1.0.0/x/hadrian/build-info.json","depends":["Cabal-3.10.3.0-fe9a4e2f6d3b51cf239a0d0da645c840fdf30442a7a2c83062b7b54358dc4a48","QuickCheck-2.14.3-12660abe9f5c6a28f87584c784112e82267cee7f5b9b5a1823ce30f9270ebf1a","base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","extra-1.7.16-49c389d3b325bb7343680a6b0593e42c3360ddbc37966713ffc950eadeee2718","filepath-1.4.200.1","mtl-2.3.1","parsec-3.1.16.1","shake-0.19.8-668bfd1b5363b1b0ed085582ab645439fdd43abbcf64e8c03b6359b2fb12bbe3","text-2.0.2","time-1.12.2","transformers-0.6.1.0","unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737"],"exe-depends":[],"component-name":"exe:hadrian","bin-file":"./hadrian/dist-newstyle/build/x86_64-linux/ghc-9.6.4/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian"},{"type":"configured","id":"hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","pkg-name":"hashable","pkg-version":"1.5.0.0","flags":{"arch-native":false,"random-initial-seed":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"fc68b07d957ade5a0a0beadd560a8d093ceac30b2f35c85eed3bcf7889a25975","pkg-src-sha256":"e58b3a8e18da5f6cd7e937e5fd683e500bb1f8276b3768269759119ca0cddb6a","depends":["base-4.18.2.0","bytestring-0.11.5.3","containers-0.6.7","deepseq-1.4.8.1","filepath-1.4.200.1","ghc-bignum-1.3","ghc-prim-0.10.0","os-string-2.0.6-01e3c1e4563fbed004a4ac273e2beea9dfd497789ab9039e09b96161f470a497","text-2.0.2"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","pkg-name":"heaps","pkg-version":"0.4","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"66b19fcd813b0e4db3e0bac541bd46606c3b13d3d081d9f9666f4be0f5ff14b8","pkg-src-sha256":"89329df8b95ae99ef272e41e7a2d0fe2f1bb7eacfcc34bc01664414b33067cfd","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","pkg-name":"js-dgtable","pkg-version":"0.5.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"f75cb4fa53c88c65794becdd48eb0d3b2b8abd89a3d5c19e87af91f5225c15e4","pkg-src-sha256":"e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","pkg-name":"js-flot","pkg-version":"0.8.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4c1c447a9a2fba0adba6d30678302a30c32b9dfde9e7aa9e9156483e1545096d","pkg-src-sha256":"1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","pkg-name":"js-jquery","pkg-version":"3.3.1","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"59ab6c79159549ef94b584abce8e6d3b336014c2cce1337b59a8f637e2856df5","pkg-src-sha256":"e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b","depends":["base-4.18.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"mtl-2.3.1","pkg-name":"mtl","pkg-version":"2.3.1","depends":["base-4.18.2.0","transformers-0.6.1.0"]},{"type":"configured","id":"os-string-2.0.6-01e3c1e4563fbed004a4ac273e2beea9dfd497789ab9039e09b96161f470a497","pkg-name":"os-string","pkg-version":"2.0.6","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"7699e7ae9bf74d056a62f384ceef8dfb2aa660f3f7c8016e9703f3b995e5e030","pkg-src-sha256":"22fcc7d5fc66676b5dfc57b714d2caf93cce2d5a79d242168352f9eb0fe2f18a","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","exceptions-0.10.7","template-haskell-2.20.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"parsec-3.1.16.1","pkg-name":"parsec","pkg-version":"3.1.16.1","depends":["base-4.18.2.0","bytestring-0.11.5.3","mtl-2.3.1","text-2.0.2"]},{"type":"pre-existing","id":"pretty-1.1.3.6","pkg-name":"pretty","pkg-version":"1.1.3.6","depends":["base-4.18.2.0","deepseq-1.4.8.1","ghc-prim-0.10.0"]},{"type":"configured","id":"primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","pkg-name":"primitive","pkg-version":"0.9.0.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"2e08c5409e3559c7f1669ef50e9a0d9a397e68ecf51110d5e2cedf05cdd7d93c","pkg-src-sha256":"696d4bd291c94d736142d6182117dca4258d3ef28bfefdb649ac8b5ecd0999c7","depends":["base-4.18.2.0","deepseq-1.4.8.1","template-haskell-2.20.0.0","transformers-0.6.1.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"process-1.6.25.0-d827dfe321191070c76b83bae4b4bdda770a9d3edfefae17d687e5eaf31c73f8","pkg-name":"process","pkg-version":"1.6.25.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"9a0b2ef8096517fa0e0c7a5e9a5c2ae5744ed824c3331005f9408245810df345","pkg-src-sha256":"496fe0566c3915b112e9772ac9c967dfeb8d5ca04895e54ae0160522bee76e65","components":{"lib":{"depends":["base-4.18.2.0","deepseq-1.4.8.1","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","filepath-1.4.200.1","unix-2.8.4.0"],"exe-depends":[]}}},{"type":"configured","id":"random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","pkg-name":"random","pkg-version":"1.2.1.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"32397de181e20ccaacf806ec70de9308cf044f089a2be37c936f3f8967bde867","pkg-src-sha256":"790f4dc2d2327c453ff6aac7bf15399fd123d55e927935f68f84b5df42d9a4b4","depends":["base-4.18.2.0","bytestring-0.11.5.3","deepseq-1.4.8.1","mtl-2.3.1","splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"shake-0.19.8-668bfd1b5363b1b0ed085582ab645439fdd43abbcf64e8c03b6359b2fb12bbe3","pkg-name":"shake","pkg-version":"0.19.8","flags":{"cloud":false,"embed-files":false,"portable":false,"threaded":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"03c8f06de478e07ad6fde95984c9206920106d0d8432ecb7ab825ef108d45382","pkg-src-sha256":"6384e33a26a2590bf33719e88881076b899ac4b5340c1c9271e4caa37e9d6535","depends":["base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","deepseq-1.4.8.1","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","extra-1.7.16-49c389d3b325bb7343680a6b0593e42c3360ddbc37966713ffc950eadeee2718","filepath-1.4.200.1","filepattern-0.1.3-3194156282913050e18f34c4b4372b115c3784a9b535128618a739dd7cb95f74","hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","process-1.6.25.0-d827dfe321191070c76b83bae4b4bdda770a9d3edfefae17d687e5eaf31c73f8","random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0","unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"shake-0.19.8-e-shake-56a401e0d0ca4160baedc0625bfdea06f42ae949435de0508a7d79941f5956ae","pkg-name":"shake","pkg-version":"0.19.8","flags":{"cloud":false,"embed-files":false,"portable":false,"threaded":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"03c8f06de478e07ad6fde95984c9206920106d0d8432ecb7ab825ef108d45382","pkg-src-sha256":"6384e33a26a2590bf33719e88881076b899ac4b5340c1c9271e4caa37e9d6535","depends":["base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","deepseq-1.4.8.1","directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","extra-1.7.16-49c389d3b325bb7343680a6b0593e42c3360ddbc37966713ffc950eadeee2718","filepath-1.4.200.1","filepattern-0.1.3-3194156282913050e18f34c4b4372b115c3784a9b535128618a739dd7cb95f74","hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","process-1.6.25.0-d827dfe321191070c76b83bae4b4bdda770a9d3edfefae17d687e5eaf31c73f8","random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","time-1.12.2","transformers-0.6.1.0","unix-2.8.4.0","unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05"],"exe-depends":[],"component-name":"exe:shake","bin-file":"/store/ghc-9.6.4/shake-0.19.8-e-shake-56a401e0d0ca4160baedc0625bfdea06f42ae949435de0508a7d79941f5956ae/bin/shake"},{"type":"configured","id":"splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187","pkg-name":"splitmix","pkg-version":"0.1.0.5","flags":{"optimised-mixer":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"caa9b4a92abf1496c7f6a3c0f4e357426a54880077cb9f04e260a8bfa034b77b","pkg-src-sha256":"9df07a9611ef45f1b1258a0b412f4d02c920248f69d2e2ce8ccda328f7e13002","depends":["base-4.18.2.0","deepseq-1.4.8.1"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"stm-2.5.1.0","pkg-name":"stm","pkg-version":"2.5.1.0","depends":["array-0.5.6.0","base-4.18.2.0"]},{"type":"pre-existing","id":"system-cxx-std-lib-1.0","pkg-name":"system-cxx-std-lib","pkg-version":"1.0","depends":[]},{"type":"pre-existing","id":"template-haskell-2.20.0.0","pkg-name":"template-haskell","pkg-version":"2.20.0.0","depends":["base-4.18.2.0","ghc-boot-th-9.6.4","ghc-prim-0.10.0","pretty-1.1.3.6"]},{"type":"pre-existing","id":"text-2.0.2","pkg-name":"text","pkg-version":"2.0.2","depends":["array-0.5.6.0","base-4.18.2.0","binary-0.8.9.1","bytestring-0.11.5.3","deepseq-1.4.8.1","ghc-prim-0.10.0","system-cxx-std-lib-1.0","template-haskell-2.20.0.0"]},{"type":"pre-existing","id":"time-1.12.2","pkg-name":"time","pkg-version":"1.12.2","depends":["base-4.18.2.0","deepseq-1.4.8.1"]},{"type":"pre-existing","id":"transformers-0.6.1.0","pkg-name":"transformers","pkg-version":"0.6.1.0","depends":["base-4.18.2.0","ghc-prim-0.10.0"]},{"type":"pre-existing","id":"unix-2.8.4.0","pkg-name":"unix","pkg-version":"2.8.4.0","depends":["base-4.18.2.0","bytestring-0.11.5.3","filepath-1.4.200.1","time-1.12.2"]},{"type":"configured","id":"unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","pkg-name":"unordered-containers","pkg-version":"0.2.20","flags":{"debug":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"c7fe9cba405ed9905e12d89c7add3b3eb9868dfba7975e70ba0cdd64b7b11abc","pkg-src-sha256":"d9cfb287cf00592d39dc9c3cac8b99627ea08f2c01798e70130fc39f7c90f11d","depends":["base-4.18.2.0","deepseq-1.4.8.1","hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","template-haskell-2.20.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05","pkg-name":"utf8-string","pkg-version":"1.0.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"79416292186feeaf1f60e49ac5a1ffae9bf1b120e040a74bf0e81ca7f1d31d3f","pkg-src-sha256":"ee48deada7600370728c4156cb002441de770d0121ae33a68139a9ed9c19b09a","depends":["base-4.18.2.0","bytestring-0.11.5.3"],"exe-depends":[],"component-name":"lib"}],"targets":[{"pkg-name":"Cabal","pkg-version":"3.10.3.0","component-name":"lib","available":[{"id":"Cabal-3.10.3.0-fe9a4e2f6d3b51cf239a0d0da645c840fdf30442a7a2c83062b7b54358dc4a48","component-name":"lib","build-by-default":true}]},{"pkg-name":"Cabal-syntax","pkg-version":"3.10.3.0","component-name":"lib","available":[{"id":"Cabal-syntax-3.10.3.0-88e1285e7405dfb1ce1417f2f1349cb91008f5a0d0381097b42750183978e546","component-name":"lib","build-by-default":true}]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"lib","available":[{"id":"QuickCheck-2.14.3-12660abe9f5c6a28f87584c784112e82267cee7f5b9b5a1823ce30f9270ebf1a","component-name":"lib","build-by-default":true}]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-gcoarbitrary","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-generators","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-gshrink","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-misc","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-monadfix","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-split","available":["TargetNotLocal"]},{"pkg-name":"QuickCheck","pkg-version":"2.14.3","component-name":"test:test-quickcheck-terminal","available":["TargetNotLocal"]},{"pkg-name":"array","pkg-version":"0.5.6.0","component-name":"lib","available":[{"id":"array-0.5.6.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"base","pkg-version":"4.18.2.0","component-name":"lib","available":[{"id":"base-4.18.2.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"binary","pkg-version":"0.8.9.1","component-name":"lib","available":[{"id":"binary-0.8.9.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"bytestring","pkg-version":"0.11.5.3","component-name":"lib","available":[{"id":"bytestring-0.11.5.3","component-name":"lib","build-by-default":true}]},{"pkg-name":"clock","pkg-version":"0.8.4","component-name":"lib","available":[{"id":"clock-0.8.4-b6af39fafa1fb93e9520050c562fc2d9803a08bc83cda5d8b8d907beefe150aa","component-name":"lib","build-by-default":true}]},{"pkg-name":"clock","pkg-version":"0.8.4","component-name":"test:test","available":["TargetNotLocal"]},{"pkg-name":"clock","pkg-version":"0.8.4","component-name":"bench:benchmarks","available":["TargetNotLocal"]},{"pkg-name":"containers","pkg-version":"0.6.7","component-name":"lib","available":[{"id":"containers-0.6.7","component-name":"lib","build-by-default":true}]},{"pkg-name":"deepseq","pkg-version":"1.4.8.1","component-name":"lib","available":[{"id":"deepseq-1.4.8.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"directory","pkg-version":"1.3.9.0","component-name":"lib","available":[{"id":"directory-1.3.9.0-328618091283420235f7b56cc39ee71bcc68c5832981997a8ca03318b84d66a1","component-name":"lib","build-by-default":true}]},{"pkg-name":"directory","pkg-version":"1.3.9.0","component-name":"test:test","available":["TargetNotLocal"]},{"pkg-name":"exceptions","pkg-version":"0.10.7","component-name":"lib","available":[{"id":"exceptions-0.10.7","component-name":"lib","build-by-default":true}]},{"pkg-name":"extra","pkg-version":"1.7.16","component-name":"lib","available":[{"id":"extra-1.7.16-49c389d3b325bb7343680a6b0593e42c3360ddbc37966713ffc950eadeee2718","component-name":"lib","build-by-default":true}]},{"pkg-name":"extra","pkg-version":"1.7.16","component-name":"test:extra-test","available":["TargetNotLocal"]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"lib","available":[{"id":"file-io-0.1.4-51915db079f01c9a6495d8a267894a9aed6b6b8f7c11259c9d5da53628dd167f","component-name":"lib","build-by-default":true}]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"test:CLC237","available":["TargetNotLocal"]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"test:Properties","available":["TargetNotLocal"]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"test:T14","available":["TargetNotLocal"]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"test:T15","available":["TargetNotLocal"]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"test:T15Win","available":["TargetNotLocal"]},{"pkg-name":"file-io","pkg-version":"0.1.4","component-name":"test:T8","available":["TargetNotLocal"]},{"pkg-name":"filepath","pkg-version":"1.4.200.1","component-name":"lib","available":[{"id":"filepath-1.4.200.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"filepattern","pkg-version":"0.1.3","component-name":"lib","available":[{"id":"filepattern-0.1.3-3194156282913050e18f34c4b4372b115c3784a9b535128618a739dd7cb95f74","component-name":"lib","build-by-default":true}]},{"pkg-name":"filepattern","pkg-version":"0.1.3","component-name":"test:filepattern-test","available":["TargetNotLocal"]},{"pkg-name":"ghc-bignum","pkg-version":"1.3","component-name":"lib","available":[{"id":"ghc-bignum-1.3","component-name":"lib","build-by-default":true}]},{"pkg-name":"ghc-boot-th","pkg-version":"9.6.4","component-name":"lib","available":[{"id":"ghc-boot-th-9.6.4","component-name":"lib","build-by-default":true}]},{"pkg-name":"ghc-prim","pkg-version":"0.10.0","component-name":"lib","available":[{"id":"ghc-prim-0.10.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"hadrian","pkg-version":"0.1.0.0","component-name":"exe:hadrian","available":[{"id":"hadrian-0.1.0.0-inplace-hadrian","component-name":"exe:hadrian","build-by-default":true}]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"lib","available":[{"id":"hashable-1.5.0.0-0ac0785933877296ccb7501af740625424a60e762d9e13c3f7fb819fa7014b88","component-name":"lib","build-by-default":true}]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"test:hashable-examples","available":["TargetNotLocal"]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"test:hashable-tests","available":["TargetNotLocal"]},{"pkg-name":"hashable","pkg-version":"1.5.0.0","component-name":"test:xxhash-tests","available":["TargetNotLocal"]},{"pkg-name":"heaps","pkg-version":"0.4","component-name":"lib","available":[{"id":"heaps-0.4-582bc0f356369f4ac6a9badb439391d1ff82a6d0d7a4a55fe3db91d6d1a32875","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-dgtable","pkg-version":"0.5.2","component-name":"lib","available":[{"id":"js-dgtable-0.5.2-40721bc9982faf5e0f71e3119e01102f429fefca9219230921535f5382e177f7","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-dgtable","pkg-version":"0.5.2","component-name":"test:js-dgtable-test","available":["TargetNotLocal"]},{"pkg-name":"js-flot","pkg-version":"0.8.3","component-name":"lib","available":[{"id":"js-flot-0.8.3-fadd4ccb467ede662552cdc382e02fb02027d8181620f296bae75d1f76774b0b","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-flot","pkg-version":"0.8.3","component-name":"test:js-flot-test","available":["TargetNotLocal"]},{"pkg-name":"js-jquery","pkg-version":"3.3.1","component-name":"lib","available":[{"id":"js-jquery-3.3.1-6a8cc1e84fc203e099644c71b32217b6615b055459038eb73f1b008db4b2f236","component-name":"lib","build-by-default":true}]},{"pkg-name":"js-jquery","pkg-version":"3.3.1","component-name":"test:js-jquery-test","available":["TargetNotLocal"]},{"pkg-name":"mtl","pkg-version":"2.3.1","component-name":"lib","available":[{"id":"mtl-2.3.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"lib","available":[{"id":"os-string-2.0.6-01e3c1e4563fbed004a4ac273e2beea9dfd497789ab9039e09b96161f470a497","component-name":"lib","build-by-default":true}]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"test:bytestring-tests","available":["TargetNotLocal"]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"test:encoding-tests","available":["TargetNotLocal"]},{"pkg-name":"os-string","pkg-version":"2.0.6","component-name":"bench:bench","available":["TargetNotLocal"]},{"pkg-name":"parsec","pkg-version":"3.1.16.1","component-name":"lib","available":[{"id":"parsec-3.1.16.1","component-name":"lib","build-by-default":true}]},{"pkg-name":"pretty","pkg-version":"1.1.3.6","component-name":"lib","available":[{"id":"pretty-1.1.3.6","component-name":"lib","build-by-default":true}]},{"pkg-name":"primitive","pkg-version":"0.9.0.0","component-name":"lib","available":[{"id":"primitive-0.9.0.0-b327a6c8ea4577ea7938607770d363048048a528efdff4bc67a582b5feac66fc","component-name":"lib","build-by-default":true}]},{"pkg-name":"primitive","pkg-version":"0.9.0.0","component-name":"test:test-qc","available":["TargetNotLocal"]},{"pkg-name":"primitive","pkg-version":"0.9.0.0","component-name":"bench:bench","available":["TargetNotLocal"]},{"pkg-name":"process","pkg-version":"1.6.25.0","component-name":"lib","available":[{"id":"process-1.6.25.0-d827dfe321191070c76b83bae4b4bdda770a9d3edfefae17d687e5eaf31c73f8","component-name":"lib","build-by-default":true}]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"lib","available":[{"id":"random-1.2.1.2-ccb717c59af131f21dfc040f6185e9cbf4f0b5a3f6de1b3b376d50859a348586","component-name":"lib","build-by-default":true}]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:doctests","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:legacy-test","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:spec","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"test:spec-inspection","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"bench:bench","available":["TargetNotLocal"]},{"pkg-name":"random","pkg-version":"1.2.1.2","component-name":"bench:legacy-bench","available":["TargetNotLocal"]},{"pkg-name":"shake","pkg-version":"0.19.8","component-name":"lib","available":[{"id":"shake-0.19.8-668bfd1b5363b1b0ed085582ab645439fdd43abbcf64e8c03b6359b2fb12bbe3","component-name":"lib","build-by-default":true}]},{"pkg-name":"shake","pkg-version":"0.19.8","component-name":"exe:shake","available":[{"id":"shake-0.19.8-e-shake-56a401e0d0ca4160baedc0625bfdea06f42ae949435de0508a7d79941f5956ae","component-name":"exe:shake","build-by-default":true}]},{"pkg-name":"shake","pkg-version":"0.19.8","component-name":"test:shake-test","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"lib","available":[{"id":"splitmix-0.1.0.5-232d2b1a4ce5cacd620dd2472d411c8d63e777af17182b5d56b631942f729187","component-name":"lib","build-by-default":true}]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:examples","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:initialization","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:montecarlo-pi","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:montecarlo-pi-32","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:splitmix-dieharder","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:splitmix-tests","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"test:splitmix-testu01","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"bench:comparison","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"bench:range","available":["TargetNotLocal"]},{"pkg-name":"splitmix","pkg-version":"0.1.0.5","component-name":"bench:simple-sum","available":["TargetNotLocal"]},{"pkg-name":"stm","pkg-version":"2.5.1.0","component-name":"lib","available":[{"id":"stm-2.5.1.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"system-cxx-std-lib","pkg-version":"1.0","component-name":"lib","available":[{"id":"system-cxx-std-lib-1.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"template-haskell","pkg-version":"2.20.0.0","component-name":"lib","available":[{"id":"template-haskell-2.20.0.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"text","pkg-version":"2.0.2","component-name":"lib","available":[{"id":"text-2.0.2","component-name":"lib","build-by-default":true}]},{"pkg-name":"time","pkg-version":"1.12.2","component-name":"lib","available":[{"id":"time-1.12.2","component-name":"lib","build-by-default":true}]},{"pkg-name":"transformers","pkg-version":"0.6.1.0","component-name":"lib","available":[{"id":"transformers-0.6.1.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"unix","pkg-version":"2.8.4.0","component-name":"lib","available":[{"id":"unix-2.8.4.0","component-name":"lib","build-by-default":true}]},{"pkg-name":"unordered-containers","pkg-version":"0.2.20","component-name":"lib","available":[{"id":"unordered-containers-0.2.20-0a8211d6220ec0e6694f219bbea9da08528b897266f5898f98f4d6e1ab6fd737","component-name":"lib","build-by-default":true}]},{"pkg-name":"unordered-containers","pkg-version":"0.2.20","component-name":"test:unordered-containers-tests","available":["TargetNotLocal"]},{"pkg-name":"unordered-containers","pkg-version":"0.2.20","component-name":"bench:benchmarks","available":["TargetNotLocal"]},{"pkg-name":"utf8-string","pkg-version":"1.0.2","component-name":"lib","available":[{"id":"utf8-string-1.0.2-134849f72bdb35a6754bed838d5c0f0412c3ca2863338b599b4cd9b0af070e05","component-name":"lib","build-by-default":true}]},{"pkg-name":"utf8-string","pkg-version":"1.0.2","component-name":"test:unit-tests","available":["TargetNotLocal"]}]} \ No newline at end of file diff --git a/overlays/android.nix b/overlays/android.nix index 57720c1c51..46b460e7d9 100644 --- a/overlays/android.nix +++ b/overlays/android.nix @@ -1,4 +1,21 @@ -_final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isAndroid ({ +final: prev: { + # Use android SDK version 26 + lib = prev.lib // { + systems = prev.lib.systems // { + examples = prev.lib.systems.examples // { + aarch64-android = prev.lib.systems.examples.aarch64-android // { + androidSdkVersion = "269"; + androidNdkVersion = "24"; + }; + armv7a-android-prebuilt = prev.lib.systems.examples.armv7a-android-prebuilt // { + androidSdkVersion = "26"; + androidNdkVersion = "24"; + }; + }; + }; + }; +} // prev.lib.optionalAttrs prev.stdenv.hostPlatform.isAndroid ({ + # we really only want the static one. libiconv = (prev.libiconv.override { enableStatic = true; enableShared = false; }).overrideAttrs(_: { hardeningDisable = [ "fortify" "stackprotector" "format" ]; @@ -11,18 +28,47 @@ _final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isAndroid ({ ''; # my current thinking is that this is due to the android toolchain using r23, api30. }); - libffi = prev.libffi.overrideAttrs (_: { + libffi = prev.libffi.overrideAttrs ( old: { dontDisableStatic = true; + configureFlags = old.configureFlags ++ [ "--disable-shared" ]; hardeningDisable = [ "fortify" "stackprotector" "format" ]; + } // prev.lib.optionalAttrs (prev.stdenv.hostPlatform.isAarch32 || prev.stdenv.hostPlatform.isAarch64) { # see libiconv. We want to target a lower minsdk postConfigure = '' - echo "#undef HAVE_MEMFD_CREATE" >> aarch64-unknown-linux-android/fficonfig.h + echo "#undef HAVE_MEMFD_CREATE" >> ${prev.stdenv.hostPlatform.config}/fficonfig.h ''; }); - gmp6 = (prev.gmp6.override { withStatic = true; }).overrideAttrs(_: { + gmp6 = (prev.gmp6.override { withStatic = true; }).overrideAttrs(old: { hardeningDisable = [ "fortify" "stackprotector" "format" ]; + configureFlags = old.configureFlags ++ [ "--disable-shared" ]; }); + zlib = prev.zlib.override { shared = false; static = true; }; + # kernel tls (ktls) doesn't work with the android kernel. And will complain + # about lots of implicitly declared functions and undeclared identifiers, + # because the android (linux) kernel doesn't expose those. + openssl = prev.openssl.override { static = true; enableKTLS = false; }; + }) // prev.lib.optionalAttrs (prev.stdenv.targetPlatform.isAndroid && (!prev.stdenv.hostPlatform.useAndroidPrebuilt)) ({ - bionic = prev.bionic.override { enableStatic = true; }; -}) + # we still need the shared libraries to link against on the platform. GHC + # has been neutered to not even try loading shared libs and will use dynamic ones. + # We also link iserv against the static libs, so that we have a fully static + # android (bionic/linux) iserv we can execute on glibc/linux. + bionic = prev.bionic.override { enableStatic = true; enableShared = true; }; +}) // +# See https://github.com/NixOS/nixpkgs/pull/385722 +builtins.mapAttrs (name: ndkPkg: ndkPkg // { + clang = ndkPkg.clang.override (oldAttrs: prev.lib.optionalAttrs (oldAttrs ? extraBuildCommands) { + extraBuildCommands = builtins.replaceStrings ["-target arm-linux-androideabi"] ["-target armv7a-linux-androideabi"] oldAttrs.extraBuildCommands; + }); +}) { + inherit (prev) + androidndkPkgs + androidndkPkgs_21 + androidndkPkgs_23 + androidndkPkgs_23b + androidndkPkgs_24 + androidndkPkgs_25 + androidndkPkgs_26 + androidndkPkgs_30; +} diff --git a/overlays/armv6l-linux.nix b/overlays/armv6l-linux.nix index f093753c99..e2df3cdaf5 100644 --- a/overlays/armv6l-linux.nix +++ b/overlays/armv6l-linux.nix @@ -18,7 +18,7 @@ final: prev: inherit (pkgs) gmp; # iserv-proxy needs to come from the buildPackages, as it needs to run on the # build host. - inherit (final.haskell-nix.iserv-proxy-exes.${config.compiler.nix-name}) iserv-proxy iserv-proxy-interpreter; + inherit (final.haskell-nix.iserv-proxy-exes.${config.compiler.nix-name}) iserv-proxy iserv-proxy-interpreter iserv-proxy-interpreter-prof; } // { # we can perform testing of cross compiled test-suites by using wine. # Therefore let's enable doCrossCheck here! diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 0c52157739..46f3d48617 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -14,6 +14,7 @@ let "9.12" = "9.12.1"; }; gitInputs = { + ghc96X = "9.6.7"; ghc912X = "9.12.1"; ghc913 = "9.13"; }; @@ -80,12 +81,14 @@ in { onMusl = final.lib.optionals final.stdenv.targetPlatform.isMusl; onWindows = final.lib.optionals final.stdenv.targetPlatform.isWindows; onWindowsOrMusl = final.lib.optionals (final.stdenv.targetPlatform.isWindows || final.stdenv.targetPlatform.isMusl); + onAarch32 = final.lib.optionals final.stdenv.targetPlatform.isAarch32; onAarch64 = final.lib.optionals final.stdenv.targetPlatform.isAarch64; onAarch64Musl = final.lib.optionals (final.stdenv.targetPlatform.isAarch64 && final.stdenv.targetPlatform.isMusl); onAndroid = final.lib.optionals final.stdenv.targetPlatform.isAndroid; onNative = final.lib.optionals (final.stdenv.buildPlatform == final.stdenv.targetPlatform); onCross = final.lib.optionals (final.stdenv.targetPlatform != final.stdenv.hostPlatform); onGhcjs = final.lib.optionals final.stdenv.targetPlatform.isGhcjs; + on32bit = final.lib.optionals final.stdenv.targetPlatform.is32bit; # Try to avoid reordering the patches unless a patch is added or changed that # will be applied to most versions of the GHC anyway (reordering the patches # results in rebuilds of GHC and reduces sharing in /nix/store). @@ -100,8 +103,8 @@ in { ++ onDarwin (until "9.0.2" ./patches/ghc/ghc-8.10-darwin-gcc-version-fix.patch) # See https://github.com/input-output-hk/haskell.nix/issues/1027 + ++ onAarch32 (until "9.2" ./patches/ghc/ghc-8.10-3434-armv7a.patch) ++ onAarch64 (until "9.2" ./patches/ghc/ghc-8.10-3434.patch) - ++ onAarch64 (fromUntil "9.2.1" "9.4" ./patches/ghc/ghc-9.2-3434.patch) ++ until "9.4" ./patches/ghc/ghc-acrt-iob-func.patch ++ until "9.2" ./patches/ghc/ghc-mprotect-nonzero-len.patch @@ -134,7 +137,8 @@ in { ++ onWindows (fromUntil "9.6.3" "9.11" ./patches/ghc/ghc-9.8-hadrian-win-cross.patch) # support R_X86_64_PC64 (ELF constant 24) - IMAGE_REL_AMD64_SREL32 (PE constant 14), which seems to appear with 9.6 more frequently, and # results in "unhandled PEi386 relocation type 14". - ++ onWindows (fromUntil "9.4.1" "9.8.3" ./patches/ghc/win-reloc-x86_64-pc64.patch) + ++ onWindows (fromUntil "9.4.1" "9.6.7" ./patches/ghc/win-reloc-x86_64-pc64.patch) + ++ onWindows (fromUntil "9.8.1" "9.8.3" ./patches/ghc/win-reloc-x86_64-pc64.patch) ++ onWindows (fromUntil "9.10" "9.11" ./patches/ghc/win-reloc-x86_64-pc64.patch) # ++ onWindows (fromUntil "9.4.1" "9.10" ./patches/ghc/Win32-depends-on-mingwex.patch) # if the host system provides ucrt (e.g. wine with ucrtbase.dll), we may end up linking against symbols from ucrtbase, instead of msvcrt, @@ -166,15 +170,17 @@ in { ++ onWindows (fromUntil "9.0" "9.4" ./patches/ghc/ghc-9.0-windres-invocation.patch) ++ onWindows (from "9.12" ./patches/ghc/ghc-9.12-windows-rts-symbols.patch) ++ fromUntil "9.4.5" "9.4.9" ./patches/ghc/ghc-9.4.5-include-order-fix.patch - ++ fromUntil "9.6.2" "9.8" ./patches/ghc/ghc-9.4.5-include-order-fix.patch - ++ fromUntil "9.6.1" "9.9.20231203" ./patches/ghc/MR10116.patch + ++ fromUntil "9.6.2" "9.6.7" ./patches/ghc/ghc-9.4.5-include-order-fix.patch + ++ fromUntil "9.6.1" "9.6.7" ./patches/ghc/MR10116.patch + ++ fromUntil "9.8.1" "9.9.20231203" ./patches/ghc/MR10116.patch ++ onNative (fromUntil "9.4.1" "9.6" ./patches/ghc/hadrian-build-deriveConstants-genprimopcode-ghc94.patch) ++ onNative (fromUntil "9.6.1" "9.14" ./patches/ghc/hadrian-build-deriveConstants-genprimopcode.patch) ++ onGhcjs (fromUntil "9.6.1" "9.6.3" ./patches/ghc/ghc-9.6-Merge-libiserv-with-ghci.patch) ++ onGhcjs (fromUntil "9.6.3" "9.8" ./patches/ghc/ghc-9.6.3-Merge-libiserv-with-ghci.patch) ++ onGhcjs (fromUntil "9.6.1" "9.8" ./patches/ghc/ghc-9.6-Assorted-changes-to-avoid-head-tail.patch) ++ onGhcjs (fromUntil "9.6.1" "9.6.3" ./patches/ghc/ghc-9.6-JS-implement-TH-support.patch) - ++ onGhcjs (fromUntil "9.6.3" "9.8" ./patches/ghc/ghc-9.6.3-JS-implement-TH-support.patch) + ++ onGhcjs (fromUntil "9.6.3" "9.6.7" ./patches/ghc/ghc-9.6.3-JS-implement-TH-support.patch) + ++ onGhcjs (fromUntil "9.6.7" "9.8" ./patches/ghc/ghc-9.6.7-JS-implement-TH-support.patch) ++ fromUntil "9.8.1" "9.8.2" ./patches/ghc/ghc-9.8-cabal-c-soures-fix.patch ++ fromUntil "9.6.3" "9.6.5" ./patches/ghc/ghc-9.6.3-Cabal-9384.patch ++ fromUntil "9.8.1" "9.8.3" ./patches/ghc/ghc-9.6.3-Cabal-9384.patch @@ -186,15 +192,19 @@ in { ++ onAndroid (until "9.0" ./patches/ghc/stack-protector-symbols.patch) ++ onAndroid (until "9.0" ./patches/ghc/libraries-prim-os-android.patch) ++ onAndroid (until "9.0" ./patches/ghc/ghc-rts-linker-condbr.patch) - ++ onAndroid (until "9.0" ./patches/ghc/ghc-8.10.7-linker-weak-and-common.patch) - ++ onAndroid (until "9.0" ./patches/ghc/libc-memory-symbols.patch) + # due to mmap-next renaming we need different ones for aarch64 and aarch32 m( + ++ onAndroid (onAarch32 (until "9.0" ./patches/ghc/ghc-8.10.7-linker-weak-and-common-armv7a.patch)) + ++ onAndroid (onAarch64 (until "9.0" ./patches/ghc/ghc-8.10.7-linker-weak-and-common.patch)) + ++ onAndroid (onAarch32 (until "9.0" ./patches/ghc/libc-memory-symbols-armv7a.patch)) + ++ onAndroid (onAarch64 (until "9.0" ./patches/ghc/libc-memory-symbols.patch)) ++ onAndroid (until "9.0" ./patches/ghc/android-base-needs-iconv.patch) ++ onCross (until "9.4" ./patches/ghc/ghc-make-stage-1-lib-ghc.patch) ++ onAarch64 (until "9.0" ./patches/ghc/ghc-8.10-better-symbol-addr-debug.patch) ++ onAarch64 (until "9.0" ./patches/ghc/ghc-8.10-aarch64-handle-none-rela.patch) ++ onWindows (until "9.0" ./patches/ghc/5b08e0c06e038448a63aa9bd7f163b23d824ba4b.patch) ++ onAarch64 (fromUntil "9.0" "9.11" ./patches/ghc/ghc-9.0-better-symbol-addr-debug.patch) - ++ onAarch64 (fromUntil "9.0" "9.8.3" ./patches/ghc/ghc-9.0-aarch64-handle-none-rela.patch) + ++ onAarch64 (fromUntil "9.0" "9.6.7" ./patches/ghc/ghc-9.0-aarch64-handle-none-rela.patch) + ++ onAarch64 (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.0-aarch64-handle-none-rela.patch) ++ onAarch64 (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.0-aarch64-handle-none-rela.patch) ++ onWindows (fromUntil "9.6.3" "9.6.4" ./patches/ghc/ghc-9.6-hadrian-splitsections.patch) @@ -207,6 +217,7 @@ in { ++ onWindows (fromUntil "9.8" "9.8.2" ./patches/ghc/ghc-9.6-fix-code-symbol-jumps.patch) # this one is to allow linking extra symbols from iserv. # ++ fromUntil "9.6.1" "9.10" ./patches/ghc/iserv-syms.patch + ++ on32bit (fromUntil "9.6" "9.6.5" ./patches/ghc/ghc-9.6-genapply-cross-arch.patch) # Fix the bad fixups: https://gitlab.haskell.org/ghc/ghc/-/commit/2adc050857a9c1b992040fbfd55fbe65b2851b19 ++ onAarch64 (fromUntil "9.6" "9.6.4" ./patches/ghc/2adc050857a9c1b992040fbfd55fbe65b2851b19.patch) @@ -219,10 +230,28 @@ in { # This one will lead to segv's on darwin, when calling `strlen` during lookupStrHashTable. `strlen` ends up being called with 0x0. # This patch will allow adding additional symbols to iserv, instead of having to patch them into GHC all the time. ++ final.lib.optionals ( - final.stdenv.targetPlatform != final.stdenv.hostPlatform - && (final.stdenv.targetPlatform.isAndroid || final.stdenv.targetPlatform.isLinux) + (final.stdenv.targetPlatform.isAndroid || final.stdenv.targetPlatform.isLinux) && (final.stdenv.targetPlatform.isAarch64 || final.stdenv.targetPlatform.is32bit)) (fromUntil "9.6.1" "9.11" ./patches/ghc/iserv-syms.patch) + ++ onAndroid (until "9.0" ./patches/ghc/ghc-8.10.7-weak-symbols-2.patch) + ++ onDarwin (onAarch64 (until "9.0" ./patches/ghc/ghc-8.10.7-rts-aarch64-darwin.patch)) + ++ onAndroid (onAarch32 (until "9.2" ./patches/ghc/ghc-8.10-android.patch)) + ++ onAndroid (onAarch32 (until "9.2" ./patches/ghc/ghc-8.10.7-android-bionic-symbols.patch)) + ++ onAndroid (onAarch32 (until "9.2" ./patches/ghc/ghc-8.10.7-bionic-libc.patch)) + ++ onAndroid (onAarch32 (until "9.2" ./patches/ghc/ghc-8.10.7-cross-dont-build-stage2-tools.patch)) + ++ onAndroid (fromUntil "9.0" "9.10" ./patches/ghc/ghc-9.6-hadrian-android.patch) + ++ onAndroid (from "9.10" ./patches/ghc/ghc-9.10-hadrian-android.patch) + ++ onAndroid (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.10-relax-llvm-max-version.patch) + ++ onAndroid (from "9.12" ./patches/ghc/ghc-define-undefined-elf-st-visibility.patch) + ++ onMusl (onAarch64 (fromUntil "9.4" "9.8" ./patches/ghc/ghc-9.6-hadrian-strip-cmd.patch)) + ++ onMusl (onAarch64 (fromUntil "9.8" "9.10" ./patches/ghc/ghc-9.8-hadrian-strip-cmd.patch)) + ++ onMusl (onAarch64 (fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-hadrian-strip-cmd.patch)) + ++ on32bit (fromUntil "9.0" "9.4.8" ./patches/ghc/ghc-9.6-32bit-cmm.patch) + ++ on32bit (fromUntil "9.6" "9.6.4" ./patches/ghc/ghc-9.6-32bit-cmm.patch) + ++ onAndroid (fromUntil "9.6.3" "9.8.3" ./patches/ghc/ghc-9.6-iog.patch) + ++ onAndroid (fromUntil "9.8.3" "9.10" ./patches/ghc/ghc-9.8.3-iog.patch) + ++ onAndroid (fromUntil "9.6" "9.9" ./patches/ghc/ghc-9.6-debug-secno.patch) + ++ onAndroid (from "9.8.1" ./patches/ghc/ghc-9.8-android-convert-os.patch) # Allow loading static external plugins into cross compilers ++ onCross (fromUntil "9.6.1" "9.11" ./patches/ghc/5c80a27488acfe3610ddfcb99a1e961002e386d0.patch) @@ -234,31 +263,41 @@ in { && final.stdenv.targetPlatform.is32bit || final.stdenv.targetPlatform.isMusl) (until "9.11" ./patches/ghc/ghc-9.6-missing-symbols-deadbeef.patch) - ++ onAarch64Musl (fromUntil "9.6" "9.8.3" ./patches/ghc/ghc-9.6-linker-pool-allocator.patch) + ++ onAarch64Musl (fromUntil "9.6" "9.6.7" ./patches/ghc/ghc-9.6-linker-pool-allocator.patch) + ++ onAarch64Musl (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.6-linker-pool-allocator.patch) ++ onAarch64Musl (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.6-linker-pool-allocator.patch) - ++ onAarch64Musl (fromUntil "9.6" "9.8.3" ./patches/ghc/ghc-9.6-linker-pool-allocator-2.patch) + ++ onAarch64Musl (fromUntil "9.6" "9.6.7" ./patches/ghc/ghc-9.6-linker-pool-allocator-2.patch) + ++ onAarch64Musl (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.6-linker-pool-allocator-2.patch) ++ onAarch64Musl (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.6-linker-pool-allocator-2.patch) ++ onMusl (fromUntil "9.6" "9.8" ./patches/ghc/ghc-9.6-0001-Refactor-IServ.hs.patch) - ++ onMusl (fromUntil "9.6" "9.8.3" ./patches/ghc/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt.patch) + ++ onMusl (fromUntil "9.6" "9.6.7" ./patches/ghc/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt.patch) + ++ onMusl (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt.patch) ++ onMusl (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt.patch) - ++ onAarch64Musl (fromUntil "9.6" "9.8.3" ./patches/ghc/ghc-9.6-0003-Better-pool-alignment.-We-still-hardcode-section-ali.patch) + ++ onAarch64Musl (fromUntil "9.6" "9.6.7" ./patches/ghc/ghc-9.6-0003-Better-pool-alignment.-We-still-hardcode-section-ali.patch) + ++ onAarch64Musl (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.6-0003-Better-pool-alignment.-We-still-hardcode-section-ali.patch) ++ onAarch64Musl (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.6-0003-Better-pool-alignment.-We-still-hardcode-section-ali.patch) - ++ onAarch64Musl (fromUntil "9.6" "9.8.3" ./patches/ghc/ghc-9.6-0007-fixup-Better-pool-alignment.-We-still-hardcode-secti.patch) + ++ onAarch64Musl (fromUntil "9.6" "9.6.7" ./patches/ghc/ghc-9.6-0007-fixup-Better-pool-alignment.-We-still-hardcode-secti.patch) + ++ onAarch64Musl (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.6-0007-fixup-Better-pool-alignment.-We-still-hardcode-secti.patch) ++ onAarch64Musl (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.6-0007-fixup-Better-pool-alignment.-We-still-hardcode-secti.patch) - ++ onAarch64Musl (fromUntil "9.6" "9.8.3" ./patches/ghc/ghc-9.6-0008-pool-improvements.patch) + ++ onAarch64Musl (fromUntil "9.6" "9.6.7" ./patches/ghc/ghc-9.6-0008-pool-improvements.patch) + ++ onAarch64Musl (fromUntil "9.8" "9.8.3" ./patches/ghc/ghc-9.6-0008-pool-improvements.patch) ++ onAarch64Musl (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.6-0008-pool-improvements.patch) # these two are abit questionable. They are pretty rough, and assume static binary as well as posix. # onMusl (fromUntil "9.6" "9.11" ./patches/ghc/ghc-9.6-0004-ghcidladdr.patch) # onMusl (fromUntil "9.6" "9.11" ./patches/ghc/ghc-9.6-0005-Better-interpreter-debugging.-Needs-ghcidladdr.patch) # Fix docs/users_guide/rtd-theme/layout.html to work with sphinx 7 - ++ fromUntil "9.0" "9.8" ./patches/ghc/docs-sphinx-7.patch - ++ fromUntil "9.8" "9.9" ./patches/ghc/docs-sphinx-7-ghc98.patch + ++ fromUntil "9.0" "9.6.7" ./patches/ghc/docs-sphinx-7.patch + ++ fromUntil "9.6.7" "9.9" ./patches/ghc/docs-sphinx-7-ghc98.patch # These two patches are needed for libblst, which has now hidden symbols, which the linker doesn't know how to deal with. - ++ until "9.0" ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols.patch - ++ until "9.0" ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-2.patch + ++ ( + if final.stdenv.targetPlatform.isAndroid + then until "9.0" ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-android.patch + else until "9.0" ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols.patch + ++ until "9.0" ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-2.patch + ) ++ onWindowsOrMusl (fromUntil "9.6" "9.7" ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols.patch) ++ onWindowsOrMusl (fromUntil "9.8.2" "9.11" ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols.patch) ++ onWindowsOrMusl (fromUntil "9.6" "9.7" ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols-2.patch) @@ -284,6 +323,13 @@ in { # See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12586 ++ onWindows (fromUntil "9.6.6" "9.12" ./patches/ghc/ghc-win32-io-manager-compilation.patch) + + # See https://gitlab.haskell.org/ghc/ghc/-/issues/16130 + ++ onAndroid (fromUntil "9.6.6" "9.12" ./patches/ghc/ghc-9.6-static-linker-script-support.patch) + ++ onAndroid (from "9.12.1" ./patches/ghc/ghc-9.12-static-linker-script-support.patch) + + ++ onAndroid (from "9.6" ./patches/ghc/ghc-9.6-COMPAT_R_ARM_PREL31.patch) + ++ onAndroid (from "9.10" ./patches/ghc/ghc-9.10-ignore-libc.patch) ; in ({ ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc { @@ -962,7 +1008,7 @@ in { compiler-nix-name = versionToNixName version; in { name = compiler-nix-name; - value = final.callPackage ../compiler/ghc { + value = final.callPackage ../compiler/ghc ({ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.${compiler-nix-name}; }; bootPkgs = bootPkgsGhc94 // { @@ -995,7 +1041,21 @@ in { ghc-patches = ghc-patches version; ghc-version-date = version-date; ghc-commit-id = src.rev; - }; + } // final.lib.optionalAttrs (builtins.compareVersions version "9.7" <0) { + bootPkgs = bootPkgsGhc94 // { + ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform + then final.buildPackages.buildPackages.haskell-nix.compiler.ghc966 + else final.buildPackages.buildPackages.haskell.compiler.ghc966 + or final.buildPackages.buildPackages.haskell.compiler.ghc965 + or final.buildPackages.buildPackages.haskell.compiler.ghc964 + or final.buildPackages.buildPackages.haskell.compiler.ghc963 + or final.buildPackages.buildPackages.haskell.compiler.ghc962 + or final.buildPackages.buildPackages.haskell.compiler.ghc945 + or final.buildPackages.buildPackages.haskell.compiler.ghc944; + }; + buildLlvmPackages = final.buildPackages.llvmPackages_12; + llvmPackages = final.llvmPackages_12; + }); }) gitInputs)) // final.lib.optionalAttrs (final.stdenv.targetPlatform.isGhcjs or false) ( if final.stdenv.hostPlatform.isGhcjs diff --git a/overlays/haskell.nix b/overlays/haskell.nix index 5f272b331b..625c5f8713 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -1056,10 +1056,20 @@ final: prev: { allow-newer: *:base, *:bytestring ''; })).hsPkgs.iserv-proxy.components.exes; - in { + in rec { # We need the proxy for the build system and the interpreter for the target inherit (exes final.pkgsBuildBuild) iserv-proxy; - inherit (exes final) iserv-proxy-interpreter; + iserv-proxy-interpreter = (exes final).iserv-proxy-interpreter.override + (final.lib.optionalAttrs final.stdenv.hostPlatform.isAndroid { + setupBuildFlags = ["--ghc-option=-optl-static" ] ++ final.lib.optional final.stdenv.hostPlatform.isAarch32 "--ghc-option=-optl-no-pie"; + enableDebugRTS = true; + } // final.lib.optionalAttrs final.stdenv.hostPlatform.isWindows { + setupBuildFlags = ["--ghc-option=-optl-Wl,--disable-dynamicbase,--disable-high-entropy-va,--image-base=0x400000" ]; + enableDebugRTS = true; + }); + iserv-proxy-interpreter-prof = iserv-proxy-interpreter.override { + enableProfiling = true; + }; }) final.haskell-nix.compiler; # Add this to your tests to make all the dependencies of haskell.nix diff --git a/overlays/linux-cross.nix b/overlays/linux-cross.nix index 04b98153b8..d674140fe1 100644 --- a/overlays/linux-cross.nix +++ b/overlays/linux-cross.nix @@ -6,6 +6,7 @@ , qemuSuffix ? (haskellLib.qemuByHostPlatform hostPlatform) , iserv-proxy , iserv-proxy-interpreter +, iserv-proxy-interpreter-prof , gmp , buildPlatform , hostPlatform @@ -13,17 +14,34 @@ , ... }: let + # For 32bit android, we need to pass -no-pie, as we otherwise + # get -pie injected into the linker flags. We don't want that. + # If we target 32bit android, we need remote-iserv to be runnable + # in a 32bit linux (via qemu-arm user mode emulation). If we have + # -pie enabled, it will produce a static-pie executable, which + # seems a lot like what we want but will crash on launch. It appears + # the the __stack_chk_guard lookups go through some lookup table, and + # while the relocations for the lookup table are correct, the __stack_chk_guard + # address isn't properly relocated. This could also be because libc isn't + # supposed to be staticlly linked really. However because we are lacking + # the loader for arm on linux, we can't used dynamically linked executables + # until one in /system/bin/linker is provided. + # + # We also need to run armv7a-android in unshare --user --pid --fork, to + # ensure that we get a low pid < 65535 for android (If we run outside) + # of nix build envs. # we want this to hold only for arm (32 and 64bit) for now. - isLinuxCross = haskellLib.isCrossHost && hostPlatform.isLinux && (hostPlatform.isAarch32 || hostPlatform.isAarch64); + isLinuxCross = haskellLib.isCrossHost && hostPlatform.isLinux && (hostPlatform.isAarch32 || hostPlatform.isAarch64 || hostPlatform.isi686); qemuIservWrapperScript = enableProfiling: let interpreter = if enableProfiling - then iserv-proxy-interpreter.override { inherit enableProfiling; } + then iserv-proxy-interpreter-prof else iserv-proxy-interpreter; in writeShellScriptBin ("iserv-wrapper" + lib.optionalString enableProfiling "-prof") '' + #!${stdenv.shell} set -euo pipefail ISERV_ARGS=''${ISERV_ARGS:-} PROXY_ARGS=''${PROXY_ARGS:-} @@ -31,11 +49,7 @@ let unset configureFlags PORT=$((5000 + $RANDOM % 5000)) (>&2 echo "---> Starting ${interpreter.exeName} on port $PORT") - ${qemu}/bin/qemu-${qemuSuffix} ${interpreter.override - (lib.optionalAttrs hostPlatform.isAndroid { - setupBuildFlags = ["--ghc-option=-optl-static" ] ++ lib.optional hostPlatform.isAarch32 "--ghc-option=-optl-no-pie"; - enableDebugRTS = true; - })}/bin/${interpreter.exeName} tmp $PORT $ISERV_ARGS & + ${qemu}/bin/qemu-${qemuSuffix} ${interpreter}/bin/${interpreter.exeName} tmp $PORT $ISERV_ARGS & (>&2 echo "---| ${interpreter.exeName} should have started on $PORT") RISERV_PID="$!" ${iserv-proxy}/bin/iserv-proxy $@ 127.0.0.1 "$PORT" $PROXY_ARGS @@ -43,7 +57,7 @@ let kill $RISERV_PID ''; qemuIservWrapper = symlinkJoin { name = "iserv-wrapper"; paths = [ (qemuIservWrapperScript false) (qemuIservWrapperScript true) ]; }; - configureFlags = lib.optional hostPlatform.isAarch32 "--disable-split-sections"; + configureFlags = lib.optional (hostPlatform.isAarch32 || hostPlatform.isAndroid) "--disable-split-sections"; setupBuildFlags = map (opt: "--ghc-option=" + opt) ((lib.optionals isLinuxCross [ "-fexternal-interpreter" "-pgmi" "${qemuIservWrapper}/bin/iserv-wrapper" @@ -53,10 +67,14 @@ let ++ lib.optionals hostPlatform.isAarch32 (map (opt: "--gcc-option=" + opt) [ "-fno-pic" "-fno-plt" ]) # Also for GHC #15275 ++ lib.optionals hostPlatform.isAarch64 ["--gcc-option=-fPIC"]; + + # Wrapper for qemu testing qemuTestWrapper = writeShellScriptBin "test-wrapper" '' set -euo pipefail ${qemu}/bin/qemu-${qemuSuffix} $@* - ''; + ''; + + # Choose the appropriate test wrapper testWrapper = lib.optional isLinuxCross "${qemuTestWrapper}/bin/test-wrapper"; enableShared = lib.mkDefault (!isLinuxCross); diff --git a/overlays/mingw_w64.nix b/overlays/mingw_w64.nix index 7ac92d0c19..7cfc744723 100644 --- a/overlays/mingw_w64.nix +++ b/overlays/mingw_w64.nix @@ -6,6 +6,7 @@ , mingw_w64_pthreads , iserv-proxy , iserv-proxy-interpreter +, iserv-proxy-interpreter-prof , gmp , hostPlatform , symlinkJoin @@ -18,7 +19,7 @@ let let interpreter = if enableProfiling - then iserv-proxy-interpreter.override { inherit enableProfiling; } + then iserv-proxy-interpreter-prof else iserv-proxy-interpreter; no-load-call = lib.optionalString (interpreter.exeName != "remote-iserv.exe") "--no-load-call"; in @@ -37,7 +38,7 @@ let PORT=$((5000 + $RANDOM % 5000)) (>&2 echo "---> Starting ${interpreter.exeName} on port $PORT") REMOTE_ISERV=$(mktemp -d) - ln -s ${interpreter.override { enableDebugRTS = true; setupBuildFlags = ["--ghc-option=-optl-Wl,--disable-dynamicbase,--disable-high-entropy-va,--image-base=0x400000" ];}}/bin/* $REMOTE_ISERV + ln -s ${interpreter}/bin/* $REMOTE_ISERV # See coment in comp-builder.nix for where this comes from and why it's here # TODO use `LINK_DLL_FOLDERS` here once it is in all the nixpkgs we want to support. for p in $pkgsHostTargetAsString; do diff --git a/overlays/patches/ghc/2adc050857a9c1b992040fbfd55fbe65b2851b19.patch b/overlays/patches/ghc/2adc050857a9c1b992040fbfd55fbe65b2851b19.patch index c43e4aeffc..427e976b22 100644 --- a/overlays/patches/ghc/2adc050857a9c1b992040fbfd55fbe65b2851b19.patch +++ b/overlays/patches/ghc/2adc050857a9c1b992040fbfd55fbe65b2851b19.patch @@ -26,7 +26,7 @@ index 1d489178673..a251370bfaf 100644 +++ b/compiler/GHC/CmmToAsm.hs @@ -655,13 +655,14 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count text "cfg not in lockstep") () - + ---- sequence blocks - let sequenced :: [NatCmmDecl statics instr] - sequenced = @@ -43,20 +43,20 @@ index 1d489178673..a251370bfaf 100644 + shorted + + -- massert (checkLayout shorted sequenced) - + let branchOpt :: [NatCmmDecl statics instr] branchOpt = @@ -684,7 +685,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count addUnwind acc proc = acc `mapUnion` computeUnwinding config ncgImpl proc - + - return ( usAlloc + return ( us_seq , fileIds' , branchOpt , lastMinuteImports ++ imports @@ -704,10 +705,10 @@ maybeDumpCfg logger (Just cfg) msg proc_name - + -- | Make sure all blocks we want the layout algorithm to place have been placed. checkLayout :: [NatCmmDecl statics instr] -> [NatCmmDecl statics instr] - -> [NatCmmDecl statics instr] @@ -94,7 +94,7 @@ index b77aa73e52b..2a1fa03b1bc 100644 , generateJumpTableForInstr + , makeFarBranches ) - + where @@ -43,9 +44,11 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch @@ -105,7 +105,7 @@ index b77aa73e52b..2a1fa03b1bc 100644 import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) +import GHC.Types.Unique.Supply - + -- The rest: import GHC.Data.OrdList @@ -61,6 +64,9 @@ import GHC.Data.FastString @@ -115,13 +115,13 @@ index b77aa73e52b..2a1fa03b1bc 100644 +import GHC.Utils.Monad (mapAccumLM) + +import GHC.Cmm.Dataflow.Collections - + -- Note [General layout of an NCG] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -161,15 +167,17 @@ basicBlockCodeGen block = do let (top,other_blocks,statics) = foldrOL mkBlocks ([],[],[]) instrs - + - mkBlocks (NEWBLOCK id) (instrs,blocks,statics) - = ([], BasicBlock id instrs : blocks, statics) - mkBlocks (LDATA sec dat) (instrs,blocks,statics) @@ -129,7 +129,7 @@ index b77aa73e52b..2a1fa03b1bc 100644 - mkBlocks instr (instrs,blocks,statics) - = (instr:instrs, blocks, statics) return (BasicBlock id top : other_blocks, statics) - + - +mkBlocks :: Instr + -> ([Instr], [GenBasicBlock Instr], [GenCmmDecl RawCmmStatics h g]) @@ -144,7 +144,7 @@ index b77aa73e52b..2a1fa03b1bc 100644 -- | Utilities ann :: SDoc -> Instr -> Instr @@ -1217,6 +1225,7 @@ assignReg_FltCode = assignReg_IntCode - + -- ----------------------------------------------------------------------------- -- Jumps + @@ -154,7 +154,7 @@ index b77aa73e52b..2a1fa03b1bc 100644 @@ -1302,6 +1311,22 @@ genCondJump bid expr = do _ -> pprPanic "AArch64.genCondJump:case mop: " (text $ show expr) _ -> pprPanic "AArch64.genCondJump: " (text $ show expr) - + +-- A conditional jump with at least +/-128M jump range +genCondFarJump :: MonadUnique m => Cond -> Target -> m InstrBlock +genCondFarJump cond far_target = do @@ -171,7 +171,7 @@ index b77aa73e52b..2a1fa03b1bc 100644 + , NEWBLOCK jmp_lbl_id + , B far_target + , NEWBLOCK skip_lbl_id] - + genCondBranch :: BlockId -- the source of the jump @@ -1816,3 +1841,163 @@ genCCall target dest_regs arg_regs bid = do @@ -344,12 +344,12 @@ index 687daccfda1..7efbb9c70bf 100644 +++ b/compiler/GHC/CmmToAsm/AArch64/Cond.hs @@ -1,6 +1,6 @@ module GHC.CmmToAsm.AArch64.Cond where - + -import GHC.Prelude +import GHC.Prelude hiding (EQ) - + -- https://developer.arm.com/documentation/den0024/a/the-a64-instruction-set/data-processing-instructions/conditional-instructions - + @@ -60,7 +60,13 @@ data Cond | UOGE -- b.pl | UOGT -- b.hi @@ -374,8 +374,8 @@ index d8dd1a4dc0c..1fb8193612f 100644 | TLabel CLabel | TReg Reg + deriving (Eq, Ord) - - + + -- Extension diff --git a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs index fd56d37cd39..c672c342376 100644 @@ -384,12 +384,12 @@ index fd56d37cd39..c672c342376 100644 @@ -1,7 +1,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-} - + -module GHC.CmmToAsm.AArch64.Ppr (pprNatCmmDecl, pprInstr) where +module GHC.CmmToAsm.AArch64.Ppr (pprNatCmmDecl, pprInstr, pprBasicBlock) where - + import GHC.Prelude hiding (EQ) - + @@ -353,7 +353,10 @@ pprInstr platform instr = case instr of -> line (text "\t.loc" <+> int file <+> int line' <+> int col) DELTA d -> dualDoc (asmComment $ text "\tdelta = " <> int d) empty @@ -400,17 +400,17 @@ index fd56d37cd39..c672c342376 100644 + -- print it for debugging purposes. + line (text "BLOCK " <> pprAsmLabel platform (blockLbl blockid)) LDATA _ _ -> panic "pprInstr: LDATA" - + -- Pseudo Instructions ------------------------------------------------------- @@ -567,7 +570,7 @@ pprCond c = case c of UGE -> text "hs" -- Carry set/unsigned higher or same ; Greater than or equal, or unordered UGT -> text "hi" -- Unsigned higher ; Greater than, or unordered - + - NEVER -> text "nv" -- Never + -- NEVER -> text "nv" -- Never VS -> text "vs" -- Overflow ; Unordered (at least one NaN operand) VC -> text "vc" -- No overflow ; Not unordered - + diff --git a/compiler/GHC/CmmToAsm/BlockLayout.hs b/compiler/GHC/CmmToAsm/BlockLayout.hs index fa0929348ce..e2096c90209 100644 --- a/compiler/GHC/CmmToAsm/BlockLayout.hs @@ -420,7 +420,7 @@ index fa0929348ce..e2096c90209 100644 import Control.Monad (foldM, unless) import GHC.Data.UnionFind +import GHC.Types.Unique.Supply (UniqSM) - + {- Note [CFG based code layout] @@ -794,29 +795,32 @@ sequenceTop @@ -476,7 +476,7 @@ index fa0929348ce..e2096c90209 100644 + far_blocks <- (ncgMakeFarBranches ncgImpl) platform info seq_blocks + pure $ CmmProc info lbl live $ ListGraph far_blocks + - + -- The old algorithm: -- It is very simple (and stupid): We make a graph out of diff --git a/compiler/GHC/CmmToAsm/Monad.hs b/compiler/GHC/CmmToAsm/Monad.hs @@ -508,7 +508,7 @@ index 3fedcc1fc40..8682d1db9d8 100644 +++ b/compiler/GHC/CmmToAsm/PPC/Instr.hs @@ -688,12 +688,13 @@ takeRegRegMoveInstr _ = Nothing -- big, we have to work around this limitation. - + makeFarBranches - :: LabelMap RawCmmStatics + :: Platform @@ -538,6 +538,6 @@ index a82674afe8f..a13fa2e4656 100644 , extractUnwindPoints = X86.extractUnwindPoints , invertCondBranches = X86.invertCondBranches } --- +-- GitLab diff --git a/overlays/patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-android.patch b/overlays/patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-android.patch new file mode 100644 index 0000000000..69bba7d9c7 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-android.patch @@ -0,0 +1,233 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 3428a010da..6eb43be959 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -267,9 +267,12 @@ int ghciInsertSymbolTable( + HashTable *table, + const SymbolName* key, + SymbolAddr* data, +- HsBool weak, ++ int flags, + ObjectCode *owner) + { ++ HsBool weak = flags & 1; ++ HsBool hidden = flags & 2; ++ + RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); + if (!pinfo) /* new entry */ + { +@@ -277,6 +280,7 @@ int ghciInsertSymbolTable( + pinfo->value = data; + pinfo->owner = owner; + pinfo->weak = weak; ++ pinfo->hidden = hidden; + insertStrHashTable(table, key, pinfo); + return 1; + } +@@ -340,11 +344,22 @@ int ghciInsertSymbolTable( + call this function again to trigger the duplicate error. */ + return 1; + } ++ else if(pinfo->hidden && !hidden) ++ { ++ /* The existing symbol is hidden, let's replace it */ ++ pinfo->value = data; ++ pinfo->owner = owner; ++ pinfo->weak = weak; + ++ pinfo->hidden = hidden; ++ return 1; ++ } + pathchar* archiveName = NULL; + debugBelch( + "GHC runtime linker: fatal error: I found a duplicate definition for symbol\n" + " %s\n" ++ " new symbol is hidden: %d\n" ++ " old symbol is hidden: %d\n" + "whilst processing object file\n" + " %" PATH_FMT "\n" + "The symbol was previously defined in\n" +@@ -355,6 +370,8 @@ int ghciInsertSymbolTable( + " * An incorrect `package.conf' entry, causing some object to be\n" + " loaded twice.\n", + (char*)key, ++ hidden ? 1 : 0, ++ pinfo->hidden ? 1 : 0, + obj_name, + pinfo->owner == NULL ? WSTR("(GHCi built-in symbols)") : + pinfo->owner->archiveMemberName ? archiveName = mkPath(pinfo->owner->archiveMemberName) +@@ -451,7 +468,7 @@ initLinker_ (int retain_cafs) + for (sym = rtsSyms; sym->lbl != NULL; sym++) { + if (! ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"), + symhash, sym->lbl, sym->addr, +- sym->weak, NULL)) { ++ sym->weak | (HS_BOOL_FALSE << 1), NULL)) { + barf("ghciInsertSymbolTable failed"); + } + IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr)); +@@ -463,7 +480,7 @@ initLinker_ (int retain_cafs) + use an arbitrary (hopefully unique) address here. + */ + if (! ghciInsertSymbolTable(WSTR("(GHCi special symbols)"), +- symhash, "__dso_handle", (void *)0x12345687, HS_BOOL_FALSE, NULL)) { ++ symhash, "__dso_handle", (void *)0x12345687, HS_BOOL_FALSE | (HS_BOOL_FALSE << 1), NULL)) { + barf("ghciInsertSymbolTable failed"); + } + +@@ -471,7 +488,7 @@ initLinker_ (int retain_cafs) + if (! ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"), symhash, + MAYBE_LEADING_UNDERSCORE_STR("newCAF"), + retain_cafs ? newRetainedCAF : newGCdCAF, +- HS_BOOL_FALSE, NULL)) { ++ HS_BOOL_FALSE | (HS_BOOL_FALSE << 1), NULL)) { + barf("ghciInsertSymbolTable failed"); + } + +@@ -844,8 +861,8 @@ HsBool removeLibrarySearchPath(HsPtr dll_path_index) + */ + HsInt insertSymbol(pathchar* obj_name, SymbolName* key, SymbolAddr* data) + { +- return ghciInsertSymbolTable(obj_name, symhash, key, data, HS_BOOL_FALSE, +- NULL); ++ return ghciInsertSymbolTable(obj_name, symhash, key, data, ++ HS_BOOL_FALSE | (HS_BOOL_FALSE << 1), NULL); + } + + /* ----------------------------------------------------------------------------- +@@ -1696,7 +1713,8 @@ int ocTryLoad (ObjectCode* oc) { + if ( symbol.name + && !ghciInsertSymbolTable(oc->fileName, symhash, symbol.name, + symbol.addr, +- isSymbolWeak(oc, symbol.name), oc)) { ++ isSymbolWeak(oc, symbol.name) | (HS_BOOL_FALSE << 1), ++ oc)) { + return 0; + } + } +diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h +index a846bf5ca7..acba66828b 100644 +--- a/rts/LinkerInternals.h ++++ b/rts/LinkerInternals.h +@@ -310,6 +310,7 @@ typedef struct _RtsSymbolInfo { + SymbolAddr* value; + ObjectCode *owner; + HsBool weak; ++ HsBool hidden; + } RtsSymbolInfo; + + void exitLinker( void ); +@@ -337,7 +338,7 @@ int ghciInsertSymbolTable( + HashTable *table, + const SymbolName* key, + SymbolAddr* data, +- HsBool weak, ++ int flags, + ObjectCode *owner); + + /* Lock-free version of lookupSymbol. When 'dependent' is not NULL, adds it as a +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index c3f9110509..5bf7f00f31 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -1013,7 +1013,9 @@ ocGetNames_ELF ( ObjectCode* oc ) + setWeakSymbol(oc, nm); + } + if (!ghciInsertSymbolTable(oc->fileName, symhash, +- nm, symbol->addr, isWeak, oc)) { ++ nm, symbol->addr, ++ isWeak | ((ELF_ST_VISIBILITY(symbol->elf_sym->st_other) == STV_HIDDEN) << 1), ++ oc)) { + goto fail; + } + oc->symbols[curSymbol++].name = nm; +diff --git a/rts/linker/ElfTypes.h b/rts/linker/ElfTypes.h +index e5333d71a7..0a8e44a076 100644 +--- a/rts/linker/ElfTypes.h ++++ b/rts/linker/ElfTypes.h +@@ -32,6 +32,9 @@ + #define Elf_Sym Elf64_Sym + #define Elf_Rel Elf64_Rel + #define Elf_Rela Elf64_Rela ++#if !defined(ELF_ST_VISIBILITY) ++#define ELF_ST_VISIBILITY ELF64_ST_VISIBILITY ++#endif + #if !defined(ELF_ST_TYPE) + #define ELF_ST_TYPE ELF64_ST_TYPE + #endif +@@ -56,6 +59,9 @@ + #define Elf_Sym Elf32_Sym + #define Elf_Rel Elf32_Rel + #define Elf_Rela Elf32_Rela ++#if !defined(ELF_ST_VISIBILITY) ++#define ELF_ST_VISIBILITY ELF32_ST_VISIBILITY ++#endif /* ELF_ST_VISIBILITY */ + #if !defined(ELF_ST_TYPE) + #define ELF_ST_TYPE ELF32_ST_TYPE + #endif /* ELF_ST_TYPE */ +diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c +index 00b0dce04c..d63369972d 100644 +--- a/rts/linker/MachO.c ++++ b/rts/linker/MachO.c +@@ -1336,7 +1336,7 @@ ocGetNames_MachO(ObjectCode* oc) + , symhash + , nm + , addr +- , HS_BOOL_FALSE ++ , HS_BOOL_FALSE | (HS_BOOL_FALSE << 1) + , oc); + + oc->symbols[curSymbol].name = nm; +@@ -1376,7 +1376,7 @@ ocGetNames_MachO(ObjectCode* oc) + + IF_DEBUG(linker, debugBelch("ocGetNames_MachO: inserting common symbol: %s\n", nm)); + ghciInsertSymbolTable(oc->fileName, symhash, nm, +- (void*)commonCounter, HS_BOOL_FALSE, oc); ++ (void*)commonCounter, HS_BOOL_FALSE | (HS_BOOL_FALSE << 1), oc); + oc->symbols[curSymbol].name = nm; + oc->symbols[curSymbol].addr = oc->info->macho_symbols[i].addr; + curSymbol++; +diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c +index c73d858d52..74b7fd1009 100644 +--- a/rts/linker/PEi386.c ++++ b/rts/linker/PEi386.c +@@ -292,7 +292,7 @@ const void* __rts_iob_func = (void*)&__acrt_iob_func; + void initLinker_PEi386() + { + if (!ghciInsertSymbolTable(WSTR("(GHCi/Ld special symbols)"), +- symhash, "__image_base__", __image_base, HS_BOOL_TRUE, NULL)) { ++ symhash, "__image_base__", __image_base, HS_BOOL_TRUE | (HS_BOOL_FALSE << 1), NULL)) { + barf("ghciInsertSymbolTable failed"); + } + +@@ -1533,7 +1533,7 @@ ocGetNames_PEi386 ( ObjectCode* oc ) + sname = strdup (sname); + addr = strdup (addr); + if (!ghciInsertSymbolTable(oc->fileName, symhash, sname, +- addr, false, oc)) { ++ addr, HS_BOOL_FALSE | (HS_BOOL_FALSE << 1), oc)) { + releaseOcInfo (oc); + stgFree (oc->image); + oc->image = NULL; +@@ -1751,7 +1751,9 @@ ocGetNames_PEi386 ( ObjectCode* oc ) + stgFree(tmp); + sname = strdup (sname); + if (!ghciInsertSymbolTable(oc->fileName, symhash, sname, +- addr, false, oc)) ++ addr, ++ HS_BOOL_FALSE | ((secNumber == IMAGE_SYM_UNDEFINED) << 1), ++ oc)) + return false; + + break; +@@ -1768,9 +1770,9 @@ ocGetNames_PEi386 ( ObjectCode* oc ) + if (isWeak) { + setWeakSymbol(oc, sname); + } +- + if (! ghciInsertSymbolTable(oc->fileName, symhash, sname, addr, +- isWeak, oc)) ++ isWeak | ((secNumber == IMAGE_SYM_UNDEFINED) << 1), ++ oc)) + return false; + } else { + /* We're skipping the symbol, but if we ever load this diff --git a/overlays/patches/ghc/ghc-8.10-3434-armv7a.patch b/overlays/patches/ghc/ghc-8.10-3434-armv7a.patch new file mode 100644 index 0000000000..6f1eb66ad1 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10-3434-armv7a.patch @@ -0,0 +1,68 @@ +diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal +index c633124..2bd51c0 100644 +--- a/libraries/ghc-prim/ghc-prim.cabal ++++ b/libraries/ghc-prim/ghc-prim.cabal +@@ -70,7 +70,7 @@ Library + if os(linux) + -- we need libm, but for musl and other's we might need libc, as libm + -- is just an empty shell. +- extra-libraries: c, m ++ extra-libraries: c, m + + c-sources: + cbits/atomic.c +diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c +index 9ca696c..b4a85e5 100644 +--- a/rts/RtsSymbols.c ++++ b/rts/RtsSymbols.c +@@ -1000,6 +1000,18 @@ + #define RTS_LIBGCC_SYMBOLS + #endif + ++ ++#if !defined(DYNAMIC) && defined(linux_HOST_OS) ++// we need these for static musl builds. However when ++// linking shared objects (DLLs) this will fail, hence ++// we do not include them when building with -DDYNAMIC ++#define RTS_LINKER_SYMBOLS \ ++ SymI_NeedsProto(__fini_array_start) \ ++ SymI_NeedsProto(__fini_array_end) ++#else ++#define RTS_LINKER_SYMBOLS ++#endif ++ + /* entirely bogus claims about types of these symbols */ + #define SymI_NeedsProto(vvv) extern void vvv(void); + #define SymI_NeedsDataProto(vvv) extern StgWord vvv[]; +@@ -1028,6 +1040,7 @@ RTS_DARWIN_ONLY_SYMBOLS + RTS_OPENBSD_ONLY_SYMBOLS + RTS_LIBGCC_SYMBOLS + RTS_LIBFFI_SYMBOLS ++RTS_LINKER_SYMBOLS + #undef SymI_NeedsProto + #undef SymI_NeedsDataProto + #undef SymI_HasProto +@@ -1068,6 +1081,8 @@ RTS_LIBFFI_SYMBOLS + #define SymI_HasProto_deprecated(vvv) \ + { #vvv, (void*)0xBAADF00D, true }, + ++void *RTS_DYNAMIC = NULL; ++ + RtsSymbolVal rtsSyms[] = { + RTS_SYMBOLS + RTS_RET_SYMBOLS +@@ -1078,6 +1093,7 @@ RtsSymbolVal rtsSyms[] = { + RTS_OPENBSD_ONLY_SYMBOLS + RTS_LIBGCC_SYMBOLS + RTS_LIBFFI_SYMBOLS ++ RTS_LINKER_SYMBOLS + SymI_HasDataProto(nonmoving_write_barrier_enabled) + #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH) + // dyld stub code contains references to this, +@@ -1085,5 +1101,6 @@ RtsSymbolVal rtsSyms[] = { + // lazy pointers as nonlazy. + { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false }, + #endif ++ { "_DYNAMIC", (void*)(&RTS_DYNAMIC), false }, + { 0, 0, false } /* sentinel */ + }; diff --git a/overlays/patches/ghc/ghc-8.10-android.patch b/overlays/patches/ghc/ghc-8.10-android.patch new file mode 100644 index 0000000000..fd499548d1 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10-android.patch @@ -0,0 +1,259 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index cfae6fc..b766ce0 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -350,6 +350,37 @@ int ghciInsertSymbolTable( + || strncmp(key, "calloc", 6) == 0 + || strncmp(key, "realloc", 7) == 0 + || strncmp(key, "reallocarray", 12) == 0 ++ ++ || strncmp(key, "open", 4) == 0 ++ || strncmp(key, "close", 5) == 0 ++ || strncmp(key, "stderr", 6) == 0 ++ || strncmp(key, "clock_gettime", 13) == 0 ++ || strncmp(key, "clock_getres", 12) == 0 ++ || strncmp(key, "__stack_chk_guard", 17) == 0 ++ || strncmp(key, "__strchr_chk", 12) == 0 ++ || strncmp(key, "__strcpy_chk", 12) == 0 ++ || strncmp(key, "__strcpy_chk_generic", 20) == 0 ++ || strncmp(key, "__strcat_chk_generic", 20) == 0 ++ || strncmp(key, "__strlcpy_chk", 13) == 0 ++ || strncmp(key, "__strlen_chk", 12) == 0 ++ || strncmp(key, "__strncpy_chk", 13) == 0 ++ || strncmp(key, "__vsnprintf_chk", 15) == 0 ++ || strncmp(key, "__write_chk", 11) == 0 ++ || strncmp(key, "__read_chk", 10) == 0 ++ || strncmp(key, "__memset_chk", 12) == 0 ++ || strncmp(key, "__memset_chk_fail", 17) == 0 ++ || strncmp(key, "__libc_globals", 14) == 0 ++ || strncmp(key, "memmove", 7) == 0 ++ || strncmp(key, "gettimeofday", 12) == 0 ++ || strncmp(key, "strcmp", 6) == 0 ++ || strncmp(key, "fopen", 5) == 0 ++ || strncmp(key, "fread", 5) == 0 ++ || strncmp(key, "fwrite", 6) == 0 ++ || strncmp(key, "fclose", 5) == 0 ++ || strncmp(key, "open", 4) == 0 ++ || strncmp(key, "close", 5) == 0 ++ || strncmp(key, "strerror", 8) == 0 ++ || strncmp(key, "__rel_iplt_start", 16) == 0 + ) { + /* symbols we link aginst the libc we link ghc or iserv against */ + return 1; +diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c +index 1da73dd..29ef159 100644 +--- a/rts/RtsSymbols.c ++++ b/rts/RtsSymbols.c +@@ -1009,7 +1009,31 @@ + SymI_NeedsProto(__ashldi3) \ + SymI_NeedsProto(__ashrdi3) \ + SymI_NeedsProto(__lshrdi3) \ +- SymI_NeedsProto(__fixunsdfdi) ++ SymI_NeedsProto(__fixunsdfdi) \ ++ SymI_NeedsProto(__aeabi_memset) \ ++ SymI_NeedsProto(__aeabi_memset4) \ ++ SymI_NeedsProto(__aeabi_memset8) \ ++ SymI_NeedsProto(__aeabi_memcpy) \ ++ SymI_NeedsProto(__aeabi_memcpy4) \ ++ SymI_NeedsProto(__aeabi_memcpy8) \ ++ SymI_NeedsProto(__aeabi_memmove) \ ++ SymI_NeedsProto(__aeabi_memmove4) \ ++ SymI_NeedsProto(__aeabi_memclr) \ ++ SymI_NeedsProto(__aeabi_memclr4) \ ++ SymI_NeedsProto(__aeabi_memclr8) \ ++ SymI_NeedsProto(__aeabi_idiv) \ ++ SymI_NeedsProto(__aeabi_uidiv) \ ++ SymI_NeedsProto(__aeabi_idivmod) \ ++ SymI_NeedsProto(__aeabi_ldivmod) \ ++ SymI_NeedsProto(__aeabi_uidivmod) \ ++ SymI_NeedsProto(__aeabi_uldivmod) \ ++ SymI_NeedsProto(__aeabi_l2f) \ ++ SymI_NeedsProto(__aeabi_l2d) \ ++ SymI_NeedsProto(__aeabi_ul2d) \ ++ SymI_NeedsProto(__aeabi_d2lz) \ ++ SymI_NeedsProto(__aeabi_d2ulz) ++ ++ + #elif defined(__GNUC__) && SIZEOF_VOID_P == 8 + #define RTS_LIBGCC_SYMBOLS \ + SymI_NeedsProto(__udivti3) \ +@@ -1045,10 +1069,45 @@ + SymI_HasProto(free) \ + SymI_HasProto(malloc) \ + SymI_HasProto(calloc) \ +- SymI_HasProto(realloc) ++ SymI_HasProto(realloc) \ ++ SymI_HasProto(stderr) \ ++ SymI_HasProto(fopen) \ ++ SymI_HasProto(fwrite) \ ++ SymI_HasProto(fread) \ ++ SymI_HasProto(fclose) \ ++ SymI_NeedsProto(__assert) \ ++ SymI_NeedsProto(__assert2) \ ++ SymI_NeedsProto(__stack_chk_guard) \ ++ SymI_NeedsProto(__memset_chk) \ ++ SymI_NeedsProto(__memcpy_chk) \ ++ SymI_HasProto(__strlen_chk) \ ++ SymI_NeedsProto(__write_chk) \ ++ SymI_NeedsProto(__read_chk) \ ++ SymI_NeedsProto(__strlcpy_chk) \ ++ SymI_NeedsProto(__strcpy_chk) \ ++ SymI_NeedsProto(__strncpy_chk) \ ++ SymI_NeedsProto(__vsnprintf_chk) \ ++ SymI_HasProto(__strchr_chk) \ ++ SymI_NeedsProto(open) \ ++ SymI_NeedsProto(close) \ ++ SymI_HasProto(strerror) ++#if defined(linux_android_HOST_OS) && SIZEOF_VOID_P <= 4 ++#define RTS_BIONIC_LIBC_SYMBOLS \ ++ // SymI_NeedsProto(reallocarray) \ ++ // SymI_NeedsProto(__svfscanf) \ ++ // SymI_NeedsProto(__vfwscanf) \ ++ // SymI_NeedsProto(__memset_chk_fail) \ ++ // SymI_NeedsProto(__strcpy_chk_generic) \ ++ // SymI_NeedsProto(__strcat_chk_generic) \ ++ // SymI_NeedsProto(__libc_globals) \ ++ // SymI_NeedsProto(__rel_iplt_start) ++#else ++#define RTS_BIONIC_LIBC_SYMBOLS ++#endif + #else + #define RTS_STACK_PROTECTOR_SYMBOLS + #define RTS_LIBC_SYMBOLS ++#define RTS_BIONIC_LIBC_SYMBOLS + #endif + + /* entirely bogus claims about types of these symbols */ +@@ -1082,6 +1141,7 @@ RTS_LIBFFI_SYMBOLS + RTS_LINKER_SYMBOLS + RTS_STACK_PROTECTOR_SYMBOLS + RTS_LIBC_SYMBOLS ++RTS_BIONIC_LIBC_SYMBOLS + #undef SymI_NeedsProto + #undef SymI_NeedsDataProto + #undef SymI_HasProto +@@ -1137,6 +1197,7 @@ RtsSymbolVal rtsSyms[] = { + RTS_LINKER_SYMBOLS + RTS_STACK_PROTECTOR_SYMBOLS + RTS_LIBC_SYMBOLS ++ RTS_BIONIC_LIBC_SYMBOLS + SymI_HasDataProto(nonmoving_write_barrier_enabled) + #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH) + // dyld stub code contains references to this, +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index c3f9110..da7007c 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -931,6 +931,14 @@ ocGetNames_ELF ( ObjectCode* oc ) + debugBelch("COMMON symbol, size %ld name %s allocated at %p\n", + symbol->elf_sym->st_size, nm, symbol->addr)); + ++ } else if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK ++ && shndx == SHN_UNDEF ++ && (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_OBJECT ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_NOTYPE)) { ++ symbol->addr = NULL; ++ isLocal = false; ++ isWeak = true; + /* Pointless to do addProddableBlock() for this area, + since the linker should never poke around in it. */ + } else if ((ELF_ST_BIND(symbol->elf_sym->st_info) == STB_GLOBAL +@@ -978,14 +986,7 @@ ocGetNames_ELF ( ObjectCode* oc ) + isWeak = ELF_ST_BIND(symbol->elf_sym->st_info) + == STB_WEAK; + } +- } else if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK +- && shndx == SHN_UNDEF +- && (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC +- || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_OBJECT +- || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_NOTYPE)) { +- symbol->addr = NULL; +- isLocal = false; +- isWeak = true; ++ + } else { + /* skip this symbol */ + IF_DEBUG(linker, +@@ -1244,6 +1245,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, + + const StgBool overflow = !isInt(26, (StgInt32) result); + // Handle overflow and Thumb interworking ++ is_target_thm = S & 0x1; + const StgBool needs_veneer = + (is_target_thm && ELF_R_TYPE(info) == COMPAT_R_ARM_JUMP24) + || overflow; +diff --git a/rts/linker/elf_plt_arm.c b/rts/linker/elf_plt_arm.c +index bd21243..e3bd3cb 100644 +--- a/rts/linker/elf_plt_arm.c ++++ b/rts/linker/elf_plt_arm.c +@@ -117,13 +117,13 @@ makeStubArmArm(Stub * s) { + uint32_t movt_r12 = 0xe340c000; + uint32_t bx_r12 = 0xe12fff1c; + +- *((uint32_t*)s->addr+0) = movw_r12 ++ ((uint32_t*)s->addr)[0] = movw_r12 + | (((uint32_t )s->target & 0xf000) << 4) + | ((uint32_t )s->target & 0x0fff); +- *((uint32_t*)s->addr+1) = movt_r12 ++ ((uint32_t*)s->addr)[1] = movt_r12 + | ((((uint32_t )s->target >> 16) & 0xf000) << 4) + | (((uint32_t )s->target >> 16) & 0x0fff); +- *((uint32_t*)s->addr+2) = bx_r12; ++ ((uint32_t*)s->addr)[2] = bx_r12; + + return EXIT_SUCCESS; + } +@@ -157,17 +157,20 @@ makeStubArmThm(Stub * s) { + uint32_t movt_r12 = 0xf2c00c00; + uint32_t bx_r12 = 0x47600000; + +- *((uint32_t*)s->addr+0) = movw_r12 ++ uint32_t movw_r12_inst = movw_r12 + | (((uint32_t )s->target & 0xf000) << 4) +- | (((uint32_t )s->target & 0x0800) << 16) ++ | (((uint32_t )s->target & 0x0800) << 15) + | (((uint32_t )s->target & 0x0700) << 4) + | ((uint32_t )s->target & 0x00ff); +- *((uint32_t*)s->addr+1) = movt_r12 ++ uint32_t movt_r12_inst = movt_r12 + | ((((uint32_t )s->target >> 16) & 0xf000) << 4) +- | ((((uint32_t )s->target >> 16) & 0x0800) << 16) ++ | ((((uint32_t )s->target >> 16) & 0x0800) << 15) + | ((((uint32_t )s->target >> 16) & 0x0700) << 4) + | (((uint32_t )s->target >> 16) & 0x00ff); +- *((uint32_t*)s->addr+2) = bx_r12; ++ // encode in little endian (half word reversal) ++ ((uint32_t*)s->addr)[0] = (movw_r12_inst << 16) | (movw_r12_inst >> 16); ++ ((uint32_t*)s->addr)[1] = (movt_r12_inst << 16) | (movt_r12_inst >> 16); ++ ((uint32_t*)s->addr)[2] = (bx_r12 << 16) | (bx_r12 >> 16); + + return EXIT_SUCCESS; + } +diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs +index 8c194f1..24514e1 100644 +--- a/utils/genapply/Main.hs ++++ b/utils/genapply/Main.hs +@@ -12,6 +12,11 @@ + -- for details + module Main(main) where + ++#undef linux_BUILD_OS ++#undef x86_64_BUILD_ARCH ++#undef linux_HOST_OS ++#undef x86_64_HOST_ARCH ++ + -- Note [Genapply target as host for RTS macros] + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + -- We improperly include *HOST* macros for our target... +diff --git a/utils/genapply/ghc.mk b/utils/genapply/ghc.mk +index 8da1f7a..c206b24 100644 +--- a/utils/genapply/ghc.mk ++++ b/utils/genapply/ghc.mk +@@ -27,4 +27,5 @@ $(eval $(call build-prog,utils/genapply,dist,0)) + + # Purposely do the wrong stage for HOST := TARGET hack. + # See Note [Genapply target as host for RTS macros]. +-utils/genapply_dist_CC_OPTS += -I,$(BUILD_1_INCLUDE_DIR) ++$(utils/genapply_dist_depfile_haskell) : $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM) ++utils/genapply_dist_HC_OPTS += -I$(BUILD_1_INCLUDE_DIR) diff --git a/overlays/patches/ghc/ghc-8.10.7-android-bionic-symbols.patch b/overlays/patches/ghc/ghc-8.10.7-android-bionic-symbols.patch new file mode 100644 index 0000000000..eea586d951 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10.7-android-bionic-symbols.patch @@ -0,0 +1,31 @@ +diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c +index 29ef159..3cb0fc0 100644 +--- a/rts/RtsSymbols.c ++++ b/rts/RtsSymbols.c +@@ -1093,14 +1093,18 @@ + SymI_HasProto(strerror) + #if defined(linux_android_HOST_OS) && SIZEOF_VOID_P <= 4 + #define RTS_BIONIC_LIBC_SYMBOLS \ +- // SymI_NeedsProto(reallocarray) \ +- // SymI_NeedsProto(__svfscanf) \ +- // SymI_NeedsProto(__vfwscanf) \ +- // SymI_NeedsProto(__memset_chk_fail) \ +- // SymI_NeedsProto(__strcpy_chk_generic) \ +- // SymI_NeedsProto(__strcat_chk_generic) \ +- // SymI_NeedsProto(__libc_globals) \ +- // SymI_NeedsProto(__rel_iplt_start) ++ SymI_NeedsProto(reallocarray) \ ++ SymI_NeedsProto(dlopen) \ ++ SymI_NeedsProto(dlerror) \ ++ SymI_NeedsProto(dlclose) \ ++ SymI_NeedsProto(dlsym) \ ++ SymI_NeedsProto(__svfscanf) \ ++ SymI_NeedsProto(__vfwscanf) \ ++ SymI_NeedsProto(__memset_chk_fail) \ ++ SymI_NeedsProto(__strcpy_chk_generic) \ ++ SymI_NeedsProto(__strcat_chk_generic) \ ++ SymI_NeedsProto(__libc_globals) \ ++ SymI_NeedsProto(__rel_iplt_start) + #else + #define RTS_BIONIC_LIBC_SYMBOLS + #endif diff --git a/overlays/patches/ghc/ghc-8.10.7-bionic-libc.patch b/overlays/patches/ghc/ghc-8.10.7-bionic-libc.patch new file mode 100644 index 0000000000..1a71fa24d9 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10.7-bionic-libc.patch @@ -0,0 +1,35 @@ +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index da7007c..9f99f58 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -1968,15 +1968,22 @@ int ocRunInit_ELF( ObjectCode *oc ) + } + + if (kind == SECTIONKIND_INIT_ARRAY) { +- char *init_startC = oc->sections[i].start; +- init_start = (init_t*)init_startC; +- init_end = (init_t*)(init_startC + shdr[i].sh_size); +- for (init = init_start; init < init_end; init++) { +- ASSERT(0x0 != *init); +- (*init)(argc, argv, envv); +- } +- } ++ char *bname = basename(OC_INFORMATIVE_FILENAME(oc)); + ++ // do not run .array initialization for jemalloc from libc. This simply cannot work. ++ // It's most likely already run by the hosting process (ghc, or iserv) as they've been ++ // linked against that libc. ++ if(strncmp(bname, "libc.a(jemalloc.o)", 18) != 0) ++ { ++ char *init_startC = oc->sections[i].start; ++ init_start = (init_t*)init_startC; ++ init_end = (init_t*)(init_startC + shdr[i].sh_size); ++ for (init = init_start; init < init_end; init++) { ++ ASSERT(0x0 != *init); ++ (*init)(argc, argv, envv); ++ } ++ } ++ } + // XXX could be more strict and assert that it's + // SECTIONKIND_RWDATA; but allowing RODATA seems harmless enough. + if ((kind == SECTIONKIND_RWDATA || kind == SECTIONKIND_CODE_OR_RODATA) diff --git a/overlays/patches/ghc/ghc-8.10.7-cross-dont-build-stage2-tools.patch b/overlays/patches/ghc/ghc-8.10.7-cross-dont-build-stage2-tools.patch new file mode 100644 index 0000000000..9d6031dc42 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10.7-cross-dont-build-stage2-tools.patch @@ -0,0 +1,74 @@ +diff --git a/utils/compare_sizes/ghc.mk b/utils/compare_sizes/ghc.mk +index d659a5e..b5e4228 100644 +--- a/utils/compare_sizes/ghc.mk ++++ b/utils/compare_sizes/ghc.mk +@@ -5,5 +5,6 @@ utils/compare_sizes_MODULES = Main + utils/compare_sizes_dist-install_PROGNAME = compareSizes + utils/compare_sizes_dist-install_INSTALL_INPLACE = NO + ++ifneq "$(Stage1Only)" "YES" + $(eval $(call build-prog,utils/compare_sizes,dist-install,1)) +- ++endif +\ No newline at end of file +diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk +index 290b233..c9a119f 100644 +--- a/utils/ghc-cabal/ghc.mk ++++ b/utils/ghc-cabal/ghc.mk +@@ -104,4 +104,6 @@ utils/ghc-cabal_dist-install_INSTALL_INPLACE = NO + utils/ghc-cabal_dist-install_WANT_BINDIST_WRAPPER = YES + utils/ghc-cabal_dist-install_MODULES = Main + ++ifneq "$(Stage1Only)" "YES" + $(eval $(call build-prog,utils/ghc-cabal,dist-install,1)) ++endif +\ No newline at end of file +diff --git a/utils/hpc/ghc.mk b/utils/hpc/ghc.mk +index 9b2bce2..448ad16 100644 +--- a/utils/hpc/ghc.mk ++++ b/utils/hpc/ghc.mk +@@ -18,4 +18,6 @@ utils/hpc_dist-install_PROGNAME = hpc + utils/hpc_dist-install_SHELL_WRAPPER = YES + utils/hpc_dist-install_INSTALL_SHELL_WRAPPER_NAME = hpc + ++ifneq "$(Stage1Only)" "YES" + $(eval $(call build-prog,utils/hpc,dist-install,1)) ++endif +\ No newline at end of file +diff --git a/utils/hsc2hs/ghc.mk b/utils/hsc2hs/ghc.mk +index 386d472..5cc6037 100644 +--- a/utils/hsc2hs/ghc.mk ++++ b/utils/hsc2hs/ghc.mk +@@ -18,8 +18,12 @@ utils/hsc2hs_dist_INSTALL = NO + utils/hsc2hs_dist-install_INSTALL = YES + endif + ++ifeq "$(Stage1Only)" "YES" ++$(eval $(call build-prog,utils/hsc2hs,dist,0)) ++else + $(eval $(call build-prog,utils/hsc2hs,dist,0)) + $(eval $(call build-prog,utils/hsc2hs,dist-install,1)) ++endif + + # After build-prog above + utils/hsc2hs_dist-install_MODULES = $(utils/hsc2hs_dist_MODULES) +diff --git a/utils/iserv/ghc.mk b/utils/iserv/ghc.mk +index 74f90e6..e747ca7 100644 +--- a/utils/iserv/ghc.mk ++++ b/utils/iserv/ghc.mk +@@ -96,6 +96,7 @@ NEED_iserv_dyn = NO + endif + endif + ++ifneq "$(Stage1Only)" "YES" + ifeq "$(NEED_iserv)" "YES" + $(eval $(call build-prog,utils/iserv,stage2,1)) + endif +@@ -107,6 +108,7 @@ endif + ifeq "$(NEED_iserv_dyn)" "YES" + $(eval $(call build-prog,utils/iserv,stage2_dyn,1)) + endif ++endif + + all_ghc_stage2 : $(iserv-stage2_INPLACE) + all_ghc_stage2 : $(iserv-stage2_p_INPLACE) diff --git a/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common-armv7a.patch b/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common-armv7a.patch new file mode 100644 index 0000000000..b416c6e2c4 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common-armv7a.patch @@ -0,0 +1,189 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 10b0764..7d473f8 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -273,7 +273,7 @@ int ghciInsertSymbolTable( + RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); + if (!pinfo) /* new entry */ + { +- pinfo = stgMallocBytes(sizeof (*pinfo), "ghciInsertToSymbolTable"); ++ pinfo = stgCallocBytes(1, sizeof (*pinfo), "ghciInsertToSymbolTable"); + pinfo->value = data; + pinfo->owner = owner; + pinfo->weak = weak; +@@ -1329,7 +1329,7 @@ mkOc( pathchar *path, char *image, int imageSize, + ObjectCode* oc; + + IF_DEBUG(linker, debugBelch("mkOc: start\n")); +- oc = stgMallocBytes(sizeof(ObjectCode), "mkOc(oc)"); ++ oc = stgCallocBytes(1, sizeof(ObjectCode), "mkOc(oc)"); + + oc->info = NULL; + +@@ -1496,12 +1496,12 @@ preloadObjectFile (pathchar *path) + // reading the file, and then we misalign image on purpose so + // that the actual sections end up aligned again. + misalignment = machoGetMisalignment(f); +- image = stgMallocBytes(fileSize + misalignment, "loadObj(image)"); ++ image = stgCallocBytes(1, fileSize + misalignment, "loadObj(image)"); + image += misalignment; + + # else /* !defined(darwin_HOST_OS) */ + +- image = stgMallocBytes(fileSize, "loadObj(image)"); ++ image = stgCallocBytes(1, fileSize, "loadObj(image)"); + + #endif + +diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h +index f326a84..a846bf5 100644 +--- a/rts/LinkerInternals.h ++++ b/rts/LinkerInternals.h +@@ -209,6 +209,10 @@ typedef struct _ObjectCode { + int n_segments; + Segment *segments; + ++ // COMMON section ++ void * common_mem; ++ unsigned long common_size; ++ + // + // Garbage collection fields + // +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index fdfe87a..c3f9110 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -325,6 +325,15 @@ ocDeinit_ELF(ObjectCode * oc) + stgFree(oc->info); + oc->info = NULL; + } ++ if(NULL != oc->common_mem) { ++#if RTS_LINKER_USE_MMAP ++ munmap(oc->common_mem, oc->common_size); ++#else ++ stgFree(oc->common_mem); ++#endif ++ } ++ oc->common_mem = NULL; ++ oc->common_size = 0; + } + + /* +@@ -861,14 +870,17 @@ ocGetNames_ELF ( ObjectCode* oc ) + for (size_t j = 0; j < symTab->n_symbols; j++) { + ElfSymbol *symbol = &symTab->symbols[j]; + if (SHN_COMMON == symTab->symbols[j].elf_sym->st_shndx) { +- common_size += symbol->elf_sym->st_size; ++ // st_value holds the alignment. Adding alignment always ++ // should give us some wiggle room to get alignment right. ++ common_size += symbol->elf_sym->st_size + symbol->elf_sym->st_value; + } + } + } +- void * common_mem = NULL; ++ oc->common_mem = NULL; ++ oc->common_size = common_size; + if(common_size > 0) { +- common_mem = mmapAnonForLinker(common_size); +- if (common_mem == NULL) { ++ oc->common_mem = mmapAnonForLinker(common_size); ++ if (oc->common_mem == NULL) { + barf("ocGetNames_ELF: Failed to allocate memory for SHN_COMMONs"); + } + } +@@ -909,9 +921,10 @@ ocGetNames_ELF ( ObjectCode* oc ) + if (shndx == SHN_COMMON) { + isLocal = false; + ASSERT(common_used < common_size); +- ASSERT(common_mem); +- symbol->addr = (void*)((uintptr_t)common_mem + common_used); +- common_used += symbol->elf_sym->st_size; ++ ASSERT(oc->common_mem); ++ int alignment = symbol->elf_sym->st_value-1; ++ symbol->addr = (void*)(((uintptr_t)oc->common_mem + common_used + alignment) & ~alignment); ++ common_used = (uintptr_t)symbol->addr - (uintptr_t)oc->common_mem + symbol->elf_sym->st_size; + ASSERT(common_used <= common_size); + + IF_DEBUG(linker, +@@ -925,7 +938,9 @@ ocGetNames_ELF ( ObjectCode* oc ) + || ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK + ) + /* and not an undefined symbol */ +- && shndx != SHN_UNDEF ++ && (shndx != SHN_UNDEF ++ /* unless it's weak */ ++ || (shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK)) + /* and not in a "special section" */ + && (shndx < SHN_LORESERVE + #if defined(SHN_XINDEX) +@@ -963,33 +978,20 @@ ocGetNames_ELF ( ObjectCode* oc ) + isWeak = ELF_ST_BIND(symbol->elf_sym->st_info) + == STB_WEAK; + } +- } +- +- /* And the decision is ... */ +- +- if (symbol->addr != NULL) { +- ASSERT(nm != NULL); +- /* Acquire! */ +- if (!isLocal) { +- +- if (isWeak == HS_BOOL_TRUE) { +- setWeakSymbol(oc, nm); +- } +- if (!ghciInsertSymbolTable(oc->fileName, symhash, +- nm, symbol->addr, isWeak, oc) +- ) { +- goto fail; +- } +- oc->symbols[curSymbol++].name = nm; +- oc->symbols[curSymbol].addr = symbol->addr; +- } +- } else { +- /* Skip. */ ++ } else if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK ++ && shndx == SHN_UNDEF ++ && (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_OBJECT ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_NOTYPE)) { ++ symbol->addr = NULL; ++ isLocal = false; ++ isWeak = true; ++ } else { ++ /* skip this symbol */ + IF_DEBUG(linker, + debugBelch("skipping `%s'\n", + nm) + ); +- + /* + debugBelch( + "skipping bind = %d, type = %d, secno = %d `%s'\n", +@@ -999,7 +1001,24 @@ ocGetNames_ELF ( ObjectCode* oc ) + nm + ); + */ +- } ++ continue; ++ } ++ ++ /* And the decision is ... */ ++ ASSERT(nm != NULL); ++ /* Acquire! */ ++ if (!isLocal) { ++ ++ if (isWeak == HS_BOOL_TRUE) { ++ setWeakSymbol(oc, nm); ++ } ++ if (!ghciInsertSymbolTable(oc->fileName, symhash, ++ nm, symbol->addr, isWeak, oc)) { ++ goto fail; ++ } ++ oc->symbols[curSymbol++].name = nm; ++ oc->symbols[curSymbol].addr = symbol->addr; ++ } + } + } + } \ No newline at end of file diff --git a/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common.patch b/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common.patch index b416c6e2c4..b982fe3662 100644 --- a/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common.patch +++ b/overlays/patches/ghc/ghc-8.10.7-linker-weak-and-common.patch @@ -85,9 +85,9 @@ index fdfe87a..c3f9110 100644 + oc->common_mem = NULL; + oc->common_size = common_size; if(common_size > 0) { -- common_mem = mmapAnonForLinker(common_size); +- common_mem = mmapAnonForLinker(common_size, true, "anon:common_mem"); - if (common_mem == NULL) { -+ oc->common_mem = mmapAnonForLinker(common_size); ++ oc->common_mem = mmapAnonForLinker(common_size, true, "anon:common_mem"); + if (oc->common_mem == NULL) { barf("ocGetNames_ELF: Failed to allocate memory for SHN_COMMONs"); } diff --git a/overlays/patches/ghc/ghc-8.10.7-rts-aarch64-darwin.patch b/overlays/patches/ghc/ghc-8.10.7-rts-aarch64-darwin.patch new file mode 100644 index 0000000000..04d527a098 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10.7-rts-aarch64-darwin.patch @@ -0,0 +1,18 @@ +diff --git a/rts/ghc.mk b/rts/ghc.mk +index 6d6ff4bb90..02d3c64ce9 100644 +--- a/rts/ghc.mk ++++ b/rts/ghc.mk +@@ -415,6 +415,13 @@ rts_CC_OPTS += -fno-strict-aliasing + + rts_CC_OPTS += -fno-common + ++ ++ifeq "$(TargetArch_CPP)" "aarch64" ++ifeq "$(TargetOS_CPP)" "darwin" ++rts_CC_OPTS += -mcpu=apple-a7 -march=armv8-a+norcpc ++endif ++endif ++ + ifeq "$(BeConservative)" "YES" + rts_CC_OPTS += -DBE_CONSERVATIVE + endif \ No newline at end of file diff --git a/overlays/patches/ghc/ghc-8.10.7-weak-symbols-2.patch b/overlays/patches/ghc/ghc-8.10.7-weak-symbols-2.patch new file mode 100644 index 0000000000..32d493dfa9 --- /dev/null +++ b/overlays/patches/ghc/ghc-8.10.7-weak-symbols-2.patch @@ -0,0 +1,37 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 727fe74..12a22d7 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -1810,6 +1810,8 @@ static HsInt resolveObjs_ (void) + IF_DEBUG(linker, debugBelch("resolveObjs: start\n")); + + for (ObjectCode *oc = objects; oc; oc = oc->next) { ++ if(oc->status == OBJECT_RESOLVED) ++ continue; + int r = ocTryLoad(oc); + if (!r) + { +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index c3f9110..1b497af 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -963,10 +963,15 @@ ocGetNames_ELF ( ObjectCode* oc ) + stab[j].st_size, stab[j].st_value, nm); + } + */ +- symbol->addr = (SymbolAddr*)( +- (intptr_t) oc->sections[secno].start + +- (intptr_t) symbol->elf_sym->st_value); +- ASSERT(symbol->addr != 0x0); ++ if(shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK) { ++ symbol->addr = NULL; ++ } else { ++ symbol->addr = (SymbolAddr*)( ++ (intptr_t) oc->sections[secno].start + ++ (intptr_t) symbol->elf_sym->st_value); ++ ASSERT(symbol->addr != 0x0); ++ } ++ + if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_LOCAL) { + isLocal = true; + isWeak = false; diff --git a/overlays/patches/ghc/ghc-9.0-better-symbol-addr-debug.patch b/overlays/patches/ghc/ghc-9.0-better-symbol-addr-debug.patch index 6ccc52a728..5d71d3c362 100644 --- a/overlays/patches/ghc/ghc-9.0-better-symbol-addr-debug.patch +++ b/overlays/patches/ghc/ghc-9.0-better-symbol-addr-debug.patch @@ -4,11 +4,11 @@ index d8c4f8b724..5e349f2839 100644 +++ b/rts/linker/elf_reloc_aarch64.c @@ -325,7 +325,8 @@ relocateObjectCodeAarch64(ObjectCode * oc) { ELF64_R_SYM((Elf64_Xword)rel->r_info)); - + CHECK(0x0 != symbol); - CHECK(0x0 != symbol->addr); + if(0x0 == symbol->addr) -+ barf("0x0 address for %s + %d of type %d in %s for relocation %d in section %d of kind: %d\n", symbol->name, rel->r_addend, ELF64_R_TYPE((Elf64_Xword)rel->r_info), OC_INFORMATIVE_FILENAME(oc), i, relaTab->targetSectionIndex, oc->sections[relaTab->targetSectionIndex].kind); - ++ barf("0x0 address for %s + %lld of type %llu in %s for relocation %d in section %d of kind: %d\n", symbol->name, rel->r_addend, ELF64_R_TYPE((Elf64_Xword)rel->r_info), OC_INFORMATIVE_FILENAME(oc), i, relaTab->targetSectionIndex, oc->sections[relaTab->targetSectionIndex].kind); + /* take explicit addend */ int64_t addend = rel->r_addend; diff --git a/overlays/patches/ghc/ghc-9.10-hadrian-android.patch b/overlays/patches/ghc/ghc-9.10-hadrian-android.patch new file mode 100644 index 0000000000..4200269d94 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.10-hadrian-android.patch @@ -0,0 +1,10 @@ +diff --git a/hadrian/src/Hadrian/Haskell/Cabal.hs b/hadrian/src/Hadrian/Haskell/Cabal.hs +index 17249efd79..ff6cc57949 100644 +--- a/hadrian/src/Hadrian/Haskell/Cabal.hs ++++ b/hadrian/src/Hadrian/Haskell/Cabal.hs +@@ -84,5 +84,6 @@ cabalOsString "mingw32" = "windows" + cabalOsString "darwin" = "osx" + cabalOsString "solaris2" = "solaris" + cabalOsString "gnu" = "hurd" ++cabalOsString "linux_android" = "android" + cabalOsString other = other diff --git a/overlays/patches/ghc/ghc-9.10-hadrian-strip-cmd.patch b/overlays/patches/ghc/ghc-9.10-hadrian-strip-cmd.patch new file mode 100644 index 0000000000..523f05328b --- /dev/null +++ b/overlays/patches/ghc/ghc-9.10-hadrian-strip-cmd.patch @@ -0,0 +1,55 @@ +diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in +index e8e6076f9a..e748ca514d 100644 +--- a/hadrian/cfg/system.config.in ++++ b/hadrian/cfg/system.config.in +@@ -13,6 +13,7 @@ cc = @CC@ + happy = @HappyCmd@ + make = @MakeCmd@ + objdump = @ObjdumpCmd@ ++strip = @StripCmd@ + sphinx-build = @SPHINXBUILD@ + system-ghc = @WithGhc@ + system-ghc-pkg = @GhcPkgCmd@ +diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs +index b20b023173..881c122885 100644 +--- a/hadrian/src/Oracles/Setting.hs ++++ b/hadrian/src/Oracles/Setting.hs +@@ -69,6 +69,7 @@ data Setting = CursesIncludeDir + | ProjectPatchLevel + | ProjectPatchLevel1 + | ProjectPatchLevel2 ++ | Strip + | SystemGhc + | TargetPlatformFull + | BourneShell +@@ -125,6 +126,7 @@ setting key = lookupSystemConfig $ case key of + ProjectPatchLevel -> "project-patch-level" + ProjectPatchLevel1 -> "project-patch-level1" + ProjectPatchLevel2 -> "project-patch-level2" ++ Strip -> "strip" + SystemGhc -> "system-ghc" + TargetPlatformFull -> "target-platform-full" + BourneShell -> "bourne-shell" +diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs +index 3e83bb5634..241f8a51ef 100644 +--- a/hadrian/src/Settings/Builders/Cabal.hs ++++ b/hadrian/src/Settings/Builders/Cabal.hs +@@ -84,15 +84,11 @@ cabalSetupArgs = builder (Cabal Setup) ? do + commonCabalArgs :: Stage -> Args + commonCabalArgs stage = do + pkg <- getPackage ++ strip <- getSetting Strip + package_id <- expr $ pkgUnitId stage pkg + let prefix = "${pkgroot}" ++ (if windowsHost then "" else "/..") +- mconcat [ -- Don't strip libraries when cross compiling. +- -- TODO: We need to set @--with-strip=(stripCmdPath :: Action FilePath)@, +- -- and if it's @:@ disable stripping as well. As it is now, I believe +- -- we might have issues with stripping on Windows, as I can't see a +- -- consumer of 'stripCmdPath'. +- -- TODO: See https://github.com/snowleopard/hadrian/issues/549. +- flag CrossCompiling ? pure [ "--disable-executable-stripping" ++ mconcat [ notStage0 ? strip /= "" ? pure [ "--with-strip=" ++ strip ] ++ , flag CrossCompiling ? pure [ "--disable-executable-stripping" + , "--disable-library-stripping" ] + -- We don't want to strip the debug RTS + , S.package rts ? pure [ "--disable-executable-stripping" diff --git a/overlays/patches/ghc/ghc-9.10-ignore-libc.patch b/overlays/patches/ghc/ghc-9.10-ignore-libc.patch new file mode 100644 index 0000000000..234bdbf092 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.10-ignore-libc.patch @@ -0,0 +1,17 @@ +diff --git a/rts/linker/LoadArchive.c b/rts/linker/LoadArchive.c +index 3c35a029a4..55d78160f5 100644 +--- a/rts/linker/LoadArchive.c ++++ b/rts/linker/LoadArchive.c +@@ -261,6 +261,12 @@ HsInt loadArchive_ (pathchar *path) + DEBUG_LOG("start\n"); + DEBUG_LOG("Loading archive `%" PATH_FMT "'\n", path); + ++ if (endsWithPath(path, "/libc.a")) { ++ IF_DEBUG(linker, ++ debugBelch("ignoring libc.a file %" PATH_FMT "\n", path)); ++ return 1; /* success */ ++ } ++ + /* Check that we haven't already loaded this archive. + Ignore requests to load multiple times */ + if (isAlreadyLoaded(path)) { diff --git a/overlays/patches/ghc/ghc-9.10-relax-llvm-max-version.patch b/overlays/patches/ghc/ghc-9.10-relax-llvm-max-version.patch new file mode 100644 index 0000000000..e8df35f802 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.10-relax-llvm-max-version.patch @@ -0,0 +1,13 @@ +diff --git a/configure.ac b/configure.ac +index 1bf37789c7..3f91701dbe 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -492,7 +492,7 @@ AC_SUBST(InstallNameToolCmd) + # versions of LLVM simultaneously, but that stopped working around + # 3.5/3.6 release of LLVM. + LlvmMinVersion=13 # inclusive +-LlvmMaxVersion=16 # not inclusive ++LlvmMaxVersion=18 # not inclusive + AC_SUBST([LlvmMinVersion]) + AC_SUBST([LlvmMaxVersion]) + diff --git a/overlays/patches/ghc/ghc-9.12-static-linker-script-support.patch b/overlays/patches/ghc/ghc-9.12-static-linker-script-support.patch new file mode 100644 index 0000000000..01b728ad5f --- /dev/null +++ b/overlays/patches/ghc/ghc-9.12-static-linker-script-support.patch @@ -0,0 +1,242 @@ +diff --git a/compiler/GHC/Linker/Static.hs b/compiler/GHC/Linker/Static.hs +index bf9ecd08ac..2a7e09f2c0 100644 +--- a/compiler/GHC/Linker/Static.hs ++++ b/compiler/GHC/Linker/Static.hs +@@ -33,6 +33,8 @@ import GHC.Linker.Static.Utils + import GHC.Driver.Config.Linker + import GHC.Driver.Session + ++import qualified GHC.Data.ShortText as ST ++ + import System.FilePath + import System.Directory + import Control.Monad +@@ -291,11 +293,9 @@ linkStaticLib logger dflags unit_env o_files dep_units = do + | otherwise + = filter ((/= rtsUnitId) . unitId) pkg_cfgs_init + +- archives <- concatMapM (collectArchives namever ways_) pkg_cfgs +- +- ar <- foldl mappend +- <$> (Archive <$> mapM loadObj modules) +- <*> mapM loadAr archives ++ arFromArchives <- mconcat <$> mapM (loadArchives namever ways_) pkg_cfgs ++ arFromObjects <- Archive <$> mapM loadObj modules ++ let ar = arFromObjects `mappend` arFromArchives + + if toolSettings_ldIsGnuLd (toolSettings dflags) + then writeGNUAr output_fn $ afilter (not . isGNUSymdef) ar +@@ -303,3 +303,18 @@ linkStaticLib logger dflags unit_env o_files dep_units = do + + -- run ranlib over the archive. write*Ar does *not* create the symbol index. + runRanlib logger dflags [GHC.SysTools.FileOption "" output_fn] ++ ++loadArchives :: GhcNameVersion -> Ways -> UnitInfo -> IO Archive ++loadArchives namever ways pc = loadArchivesFromLibs libs ++ where ++ libs = unitHsLibs namever ways pc ++ map ST.unpack (unitExtDepLibsSys pc) ++ loadArchivesFromLibs :: [LibName] -> IO Archive ++ loadArchivesFromLibs libs = do ++ arPaths <- collectArchivesFromLibs namever ways pc libs ++ fmap mconcat $ forM arPaths $ \arPath -> do ++ arOrScript <- loadArchiveOrScript arPath ++ case arOrScript of ++ Ar ar -> return ar ++ ImplicitLinkerScript linkerScript -> ++ case linkerScript of ++ INPUT libNames -> loadArchivesFromLibs libNames +\ No newline at end of file +diff --git a/compiler/GHC/Linker/Unit.hs b/compiler/GHC/Linker/Unit.hs +index 652a515b48..2cc05ba9cc 100644 +--- a/compiler/GHC/Linker/Unit.hs ++++ b/compiler/GHC/Linker/Unit.hs +@@ -3,7 +3,7 @@ + module GHC.Linker.Unit + ( UnitLinkOpts (..) + , collectLinkOpts +- , collectArchives ++ , collectArchivesFromLibs + , getUnitLinkOpts + , getLibs + ) +@@ -47,13 +47,12 @@ collectLinkOpts namever ways ps = UnitLinkOpts + , otherFlags = concatMap (map ST.unpack . unitLinkerOptions) ps + } + +-collectArchives :: GhcNameVersion -> Ways -> UnitInfo -> IO [FilePath] +-collectArchives namever ways pc = ++collectArchivesFromLibs :: GhcNameVersion -> Ways -> UnitInfo -> [String] -> IO [FilePath] ++collectArchivesFromLibs namever ways pc libs = + filterM doesFileExist [ searchPath ("lib" ++ lib ++ ".a") + | searchPath <- searchPaths + , lib <- libs ] + where searchPaths = ordNub . filter notNull . libraryDirsForWay ways $ pc +- libs = unitHsLibs namever ways pc ++ map ST.unpack (unitExtDepLibsSys pc) + + -- | Either the 'unitLibraryDirs' or 'unitLibraryDynDirs' as appropriate for the way. + libraryDirsForWay :: Ways -> UnitInfo -> [String] +diff --git a/compiler/GHC/SysTools/Ar.hs b/compiler/GHC/SysTools/Ar.hs +index adba60b53c..351103fd4c 100644 +--- a/compiler/GHC/SysTools/Ar.hs ++++ b/compiler/GHC/SysTools/Ar.hs +@@ -20,11 +20,15 @@ of libtool across different platforms. + module GHC.SysTools.Ar + (ArchiveEntry(..) + ,Archive(..) ++ ,ArchiveOrScript(..) ++ ,LinkerScript(..) ++ ,LibName + ,afilter + + ,parseAr + + ,loadAr ++ ,loadArchiveOrScript + ,loadObj + ,writeBSDAr + ,writeGNUAr +@@ -45,6 +49,7 @@ import Control.Applicative + import qualified Data.ByteString as B + import qualified Data.ByteString.Char8 as C + import qualified Data.ByteString.Lazy as L ++import qualified Text.ParserCombinators.ReadP as R + #if !defined(mingw32_HOST_OS) + import qualified System.Posix.Files as POSIX + #endif +@@ -230,6 +235,68 @@ putGNUArch (Archive as) = do + processEntries = + uncurry (:) . mapAccumL processEntry (ArchiveEntry "//" 0 0 0 0 0 mempty) + ++-- | Some systems have archives that are not really archives but contain so ++-- called linker scripts. These scripts contain textual commands to the ++-- linker. This data type represents this choice between an actual archive or ++-- implicit linker script. ++-- ++-- See: https://sourceware.org/binutils/docs/ld/Implicit-Linker-Scripts.html#Implicit-Linker-Scripts ++data ArchiveOrScript = Ar Archive | ImplicitLinkerScript LinkerScript ++ deriving (Eq, Show) ++ ++-- | An AST for a linker script. ++-- ++-- At the moment this AST only supports linker scripts of the form: ++-- ++-- @INPUT(-lc++_static -lc++abi)@ ++-- ++-- Since this is exactly what is used in @nixpkgs@ for @libc++.a@. ++-- ++-- For more information on linker scripts see: ++-- https://sourceware.org/binutils/docs/ld/Scripts.html ++data LinkerScript = INPUT [LibName] ++ deriving (Eq, Show) ++ ++-- | Name of a library to link with. ++-- ++-- This is everything after the @-l@ prefix. ++type LibName = String ++ ++linkerScriptReadP :: R.ReadP LinkerScript ++linkerScriptReadP = skipSpaceChars *> inputReadP <* R.skipSpaces ++ where ++ inputReadP :: R.ReadP LinkerScript ++ inputReadP = fmap INPUT $ R.between (symbol "INPUT(") (symbol ")") $ ++ R.sepBy libReadP sep <* skipSpaceChars ++ where ++ libReadP :: R.ReadP LibName ++ libReadP = R.string "-l" *> R.many1 (R.satisfy isLibNameChar) ++ where ++ isLibNameChar c = c /= ')' && c /= ',' && c /= ' ' ++ ++ sep :: R.ReadP () ++ sep = R.char ' ' *> skipSpaceChars ++ ++ symbol :: String -> R.ReadP () ++ symbol str = R.string str *> skipSpaceChars ++ ++ skipSpaceChars :: R.ReadP () ++ skipSpaceChars = do ++ s <- R.look ++ skip s ++ where ++ skip (' ':s) = do _ <- R.get; skip s ++ skip _ = do return () ++ ++parseArOrScript :: B.ByteString -> Either (ByteOffset, String) ArchiveOrScript ++parseArOrScript bs = ++ case runGetOrFail getArch $ L.fromChunks $ pure bs of ++ Left (_, pos, msg) -> ++ case R.readP_to_S linkerScriptReadP $ C.unpack bs of ++ [(linkerScript, "")] -> Right $ ImplicitLinkerScript linkerScript ++ _ -> Left (pos, msg) ++ Right (_, _, ar) -> Right $ Ar ar ++ + parseAr :: B.ByteString -> Archive + parseAr = runGet getArch . L.fromChunks . pure + +@@ -240,6 +307,18 @@ writeGNUAr fp = L.writeFile fp . runPut . putGNUArch + loadAr :: FilePath -> IO Archive + loadAr fp = parseAr <$> B.readFile fp + ++loadArchiveOrScript :: FilePath -> IO ArchiveOrScript ++loadArchiveOrScript fp = do ++ bs <- B.readFile fp ++ case parseArOrScript bs of ++ Left (pos, msg) -> ++ error $ ++ "Error while decoding archive: " <> fp <> ++ " is neither an archive because decoding failed at position " <> ++ show pos <> " with error " <> msg <> ++ ", nor is it an implicit linker script!" ++ Right arOrScript -> return arOrScript ++ + loadObj :: FilePath -> IO ArchiveEntry + loadObj fp = do + payload <- B.readFile fp +diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs +index 5cb73b1..99e7d01 100644 +--- a/compiler/GHC/Linker/Loader.hs ++++ b/compiler/GHC/Linker/Loader.hs +@@ -61,6 +61,7 @@ import GHC.ByteCode.Asm + import GHC.ByteCode.Types + + import GHC.SysTools ++import GHC.SysTools.Ar (loadArchiveOrScript, ArchiveOrScript(..), LinkerScript(..)) + + import GHC.Types.Basic + import GHC.Types.Name +@@ -1151,7 +1152,7 @@ loadPackage interp hsc_env pkg + #endif + objs = [ obj | Objects objs <- classifieds + , obj <- objs ] +- archs = [ arch | Archive arch <- classifieds ] ++ archPaths = [ arch | Archive arch <- classifieds ] + + -- Add directories to library search paths + let dll_paths = map takeDirectory known_dlls +@@ -1175,7 +1176,8 @@ loadPackage interp hsc_env pkg + -- Ordering isn't important here, because we do one final link + -- step to resolve everything. + mapM_ (loadObj interp) objs +- mapM_ (loadArchive interp) archs ++ resolvedArchives <- resolveArchives interp hsc_env dirs_env gcc_paths archPaths ++ mapM_ (loadArchive interp) resolvedArchives + + maybePutStr logger "linking ... " + ok <- resolveObjs interp +@@ -1194,6 +1196,16 @@ loadPackage interp hsc_env pkg + <> pprUnitInfoForUser pkg <> text "'" + in throwGhcExceptionIO (InstallationError (showSDoc dflags errmsg)) + ++resolveArchives :: Interp -> HscEnv -> [FilePath] -> [FilePath] -> [FilePath] -> IO [FilePath] ++resolveArchives interp hsc_env dirs_env gcc_paths paths = fmap concat $ forM paths $ \path -> do ++ arOrScript <- loadArchiveOrScript path ++ case arOrScript of ++ Ar _ -> return [path] ++ ImplicitLinkerScript (INPUT libs) -> do ++ classifiedLibs <- mapM (locateLib interp hsc_env False dirs_env gcc_paths) libs ++ let resolvedPaths = [arch | Archive arch <- classifiedLibs] ++ resolveArchives interp hsc_env dirs_env gcc_paths resolvedPaths ++ + {- + Note [Crash early load_dyn and locateLib] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + diff --git a/overlays/patches/ghc/ghc-9.6-32bit-cmm.patch b/overlays/patches/ghc/ghc-9.6-32bit-cmm.patch new file mode 100644 index 0000000000..4267c8ec1d --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-32bit-cmm.patch @@ -0,0 +1,24 @@ +diff --git a/compiler/GHC/StgToCmm/CgUtils.hs b/compiler/GHC/StgToCmm/CgUtils.hs +index 4718cbf..07001c6 100644 +--- a/compiler/GHC/StgToCmm/CgUtils.hs ++++ b/compiler/GHC/StgToCmm/CgUtils.hs +@@ -173,15 +173,15 @@ fixStgRegStmt platform stmt = fixAssign $ mapExpDeep fixExpr stmt + BaseReg -> baseAddr + _other -> CmmLoad baseAddr (globalRegType platform reg) NaturallyAligned + +- CmmRegOff (CmmGlobal reg) offset -> ++ CmmRegOff greg@(CmmGlobal reg) offset -> + -- RegOf leaves are just a shorthand form. If the reg maps + -- to a real reg, we keep the shorthand, otherwise, we just + -- expand it and defer to the above code. + case reg `elem` activeStgRegs platform of + True -> expr +- False -> CmmMachOp (MO_Add (wordWidth platform)) [ +- fixExpr (CmmReg (CmmGlobal reg)), ++ False -> CmmMachOp (MO_Add (cmmRegWidth platform greg)) [ ++ fixExpr (CmmReg greg), + CmmLit (CmmInt (fromIntegral offset) +- (wordWidth platform))] ++ (cmmRegWidth platform greg))] + + other_expr -> other_expr \ No newline at end of file diff --git a/overlays/patches/ghc/ghc-9.6-COMPAT_R_ARM_PREL31.patch b/overlays/patches/ghc/ghc-9.6-COMPAT_R_ARM_PREL31.patch new file mode 100644 index 0000000000..9368c827df --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-COMPAT_R_ARM_PREL31.patch @@ -0,0 +1,13 @@ +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index 007daedb2f..0555abac72 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -1295,6 +1295,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, + break; + + case COMPAT_R_ARM_REL32: /* ((S + A) | T) – P */ ++ case COMPAT_R_ARM_PREL31: + *(Elf32_Word *)P += S; + *(Elf32_Word *)P |= T; + *(Elf32_Word *)P -= P; + diff --git a/overlays/patches/ghc/ghc-9.6-debug-secno.patch b/overlays/patches/ghc/ghc-9.6-debug-secno.patch new file mode 100644 index 0000000000..6564734a76 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-debug-secno.patch @@ -0,0 +1,22 @@ +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index 9f623a6..f4ee928 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -1056,7 +1056,15 @@ ocGetNames_ELF ( ObjectCode* oc ) + ) + ) { + /* Section 0 is the undefined section, hence > and not >=. */ +- CHECK(secno > 0 && secno < shnum); ++ // This is only a problem if the symbol is _not_ WEAK. If it's ++ // weak this is perfectly ok. See below how we set the symbol's ++ // address to NULL in that case. ++ // if (!(secno > 0 && secno < shnum)) { ++ // debugBelch("while processing %s\n", OC_INFORMATIVE_FILENAME(oc)); ++ // debugBelch("while processing symbol %s (%d)\n", nm, j); ++ // barf("secno %d out of range (0, %d)\n", secno, shnum); ++ // } ++ // CHECK(secno > 0 && secno < shnum); + /* + if (shdr[secno].sh_type == SHT_NOBITS) { + debugBelch(" BSS symbol, size %d off %d name %s\n", + diff --git a/overlays/patches/ghc/ghc-9.6-genapply-cross-arch.patch b/overlays/patches/ghc/ghc-9.6-genapply-cross-arch.patch new file mode 100644 index 0000000000..8aa2b81077 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-genapply-cross-arch.patch @@ -0,0 +1,35 @@ +diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs +index 74351ee..8a6513c 100644 +--- a/utils/genapply/Main.hs ++++ b/utils/genapply/Main.hs +@@ -12,6 +12,17 @@ + -- for details + module Main(main) where + ++-- GHC will helpfully pass ++-- -Dlinux_BUILD_OS -Dx86_64_BUILD_ARCH -Dlinux_HOST_OS -Dx86_64_HOST_ARCH -D__GLASGOW_HASKELL_TH__ -D__SSE__ -D__SSE2__ '-D__IO_MANAGER_MIO__=1' ++-- to cc -E when running the CPP phase. :-/ So we have to undefine them. ++#if defined(linux_BUILD_OS) || defined(x86_64_BUILD_ARCH) || defined(linux_HOST_OS) || defined(x86_64_HOST_ARCH) ++#warning "Undefining macros that GHC passes to CPP" ++#undef linux_BUILD_OS ++#undef x86_64_BUILD_ARCH ++#undef linux_HOST_OS ++#undef x86_64_HOST_ARCH ++#endif ++ + -- Note [Genapply target as host for RTS macros] + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + -- We improperly include *HOST* macros for our target... +@@ -957,6 +968,12 @@ main = do + text "// DO NOT EDIT!", + text "// Automatically generated by utils/genapply/Main.hs", + text "", ++ text "// DEBUG: SIZEOF_VOID_P " <> int SIZEOF_VOID_P, ++ text "// DEBUG: HOST_ARCH " <> text HOST_ARCH, ++ text "// DEBUG: HOST_OS " <> text HOST_OS, ++ text "// DEBUG: BUILD_ARCH " <> text BUILD_ARCH, ++ text "// DEBUG: BUILD_OS " <> text BUILD_OS, ++ text "", + text "#include \"Cmm.h\"", + text "#include \"AutoApply.h\"", + text "#if !defined(UnregisterisedCompiler)", diff --git a/overlays/patches/ghc/ghc-9.6-hadrian-android.patch b/overlays/patches/ghc/ghc-9.6-hadrian-android.patch new file mode 100644 index 0000000000..6e32aaadd2 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-hadrian-android.patch @@ -0,0 +1,11 @@ +diff --git a/hadrian/src/Hadrian/Haskell/Cabal.hs b/hadrian/src/Hadrian/Haskell/Cabal.hs +index f5864b6..69123e1 100644 +--- a/hadrian/src/Hadrian/Haskell/Cabal.hs ++++ b/hadrian/src/Hadrian/Haskell/Cabal.hs +@@ -71,4 +71,5 @@ cabalOsString :: String -> String + cabalOsString "mingw32" = "windows" + cabalOsString "darwin" = "osx" + cabalOsString "solaris2" = "solaris" ++cabalOsString "linux_android" = "android" + cabalOsString other = other + diff --git a/overlays/patches/ghc/ghc-9.6-hadrian-strip-cmd.patch b/overlays/patches/ghc/ghc-9.6-hadrian-strip-cmd.patch new file mode 100644 index 0000000000..f5652b35e9 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-hadrian-strip-cmd.patch @@ -0,0 +1,56 @@ +diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in +index 6a891b4..a2289f8 100644 +--- a/hadrian/cfg/system.config.in ++++ b/hadrian/cfg/system.config.in +@@ -18,6 +18,7 @@ merge-objects = @MergeObjsCmd@ + system-merge-objects = @LD_STAGE0@ + objdump = @ObjdumpCmd@ + ranlib = @REAL_RANLIB_CMD@ ++strip = @StripCmd@ + sphinx-build = @SPHINXBUILD@ + system-ar = @AR_STAGE0@ + system-cc = @CC_STAGE0@ +diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs +index 462d289..535cc5f 100644 +--- a/hadrian/src/Oracles/Setting.hs ++++ b/hadrian/src/Oracles/Setting.hs +@@ -69,6 +69,7 @@ data Setting = BuildArch + | ProjectPatchLevel + | ProjectPatchLevel1 + | ProjectPatchLevel2 ++ | Strip + | SystemGhc + | TargetArch + | TargetOs +@@ -171,6 +172,7 @@ setting key = lookupSystemConfig $ case key of + ProjectPatchLevel -> "project-patch-level" + ProjectPatchLevel1 -> "project-patch-level1" + ProjectPatchLevel2 -> "project-patch-level2" ++ Strip -> "strip" + SystemGhc -> "system-ghc" + TargetArch -> "target-arch" + TargetArmVersion -> "target-arm-version" +diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs +index 2e42185..032ca72 100644 +--- a/hadrian/src/Settings/Builders/Cabal.hs ++++ b/hadrian/src/Settings/Builders/Cabal.hs +@@ -85,15 +85,11 @@ commonCabalArgs :: Stage -> Args + commonCabalArgs stage = do + verbosity <- expr getVerbosity + pkg <- getPackage ++ strip <- getSetting Strip + package_id <- expr $ pkgIdentifier pkg + let prefix = "${pkgroot}" ++ (if windowsHost then "" else "/..") +- mconcat [ -- Don't strip libraries when cross compiling. +- -- TODO: We need to set @--with-strip=(stripCmdPath :: Action FilePath)@, +- -- and if it's @:@ disable stripping as well. As it is now, I believe +- -- we might have issues with stripping on Windows, as I can't see a +- -- consumer of 'stripCmdPath'. +- -- TODO: See https://github.com/snowleopard/hadrian/issues/549. +- flag CrossCompiling ? pure [ "--disable-executable-stripping" ++ mconcat [ notStage0 ? strip /= "" ? pure [ "--with-strip=" ++ strip ] ++ , flag CrossCompiling ? pure [ "--disable-executable-stripping" + , "--disable-library-stripping" ] + -- We don't want to strip the debug RTS + , S.package rts ? pure [ "--disable-executable-stripping" + diff --git a/overlays/patches/ghc/ghc-9.6-iog.patch b/overlays/patches/ghc/ghc-9.6-iog.patch new file mode 100644 index 0000000000..849b867311 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-iog.patch @@ -0,0 +1,370 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 59e2ff9397..78e43cd471 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -267,7 +267,7 @@ int ghciInsertSymbolTable( + RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); + if (!pinfo) /* new entry */ + { +- pinfo = stgMallocBytes(sizeof (*pinfo), "ghciInsertToSymbolTable"); ++ pinfo = stgCallocBytes(1, sizeof (*pinfo), "ghciInsertToSymbolTable"); + pinfo->value = data; + pinfo->owner = owner; + pinfo->strength = strength; +@@ -605,11 +605,11 @@ internal_dlopen(const char *dll_name) + /* dlopen failed; return a ptr to the error msg. */ + errmsg = dlerror(); + if (errmsg == NULL) errmsg = "addDLL: unknown error"; +- errmsg_copy = stgMallocBytes(strlen(errmsg)+1, "addDLL"); ++ errmsg_copy = stgCallocBytes(1,strlen(errmsg)+1, "addDLL"); + strcpy(errmsg_copy, errmsg); + errmsg = errmsg_copy; + } else { +- o_so = stgMallocBytes(sizeof(OpenedSO), "addDLL"); ++ o_so = stgCallocBytes(1,sizeof(OpenedSO), "addDLL"); + o_so->handle = hdl; + o_so->next = openedSOs; + openedSOs = o_so; +@@ -1314,7 +1314,7 @@ mkOc( ObjectType type, pathchar *path, char *image, int imageSize, + + + IF_DEBUG(linker, debugBelch("mkOc: %" PATH_FMT "\n", path)); +- oc = stgMallocBytes(sizeof(ObjectCode), "mkOc(oc)"); ++ oc = stgCallocBytes(1, sizeof(ObjectCode), "mkOc(oc)"); + + oc->info = NULL; + oc->type = type; +@@ -1334,7 +1334,7 @@ mkOc( ObjectType type, pathchar *path, char *image, int imageSize, + oc->fileName = pathdup(path); + + if (archiveMemberName) { +- oc->archiveMemberName = stgMallocBytes( (pathlen(archiveMemberName)+1) * pathsize, ++ oc->archiveMemberName = stgCallocBytes(1, (pathlen(archiveMemberName)+1) * pathsize, + "loadObj" ); + pathcopy(oc->archiveMemberName, archiveMemberName); + } else { +@@ -1489,12 +1489,12 @@ preloadObjectFile (pathchar *path) + // reading the file, and then we misalign image on purpose so + // that the actual sections end up aligned again. + misalignment = machoGetMisalignment(f); +- image = stgMallocBytes(fileSize + misalignment, "loadObj(image)"); ++ image = stgCallocBytes(1, fileSize + misalignment, "loadObj(image)"); + image += misalignment; + + # else /* !defined(darwin_HOST_OS) */ + +- image = stgMallocBytes(fileSize, "loadObj(image)"); ++ image = stgCallocBytes(1, fileSize, "loadObj(image)"); + + #endif /* !defined(darwin_HOST_OS) */ + +@@ -1787,6 +1787,8 @@ static HsInt resolveObjs_ (void) + IF_DEBUG(linker, debugBelch("resolveObjs: start\n")); + + for (ObjectCode *oc = objects; oc; oc = oc->next) { ++ if(oc->status == OBJECT_RESOLVED) ++ continue; + int r = ocTryLoad(oc); + if (!r) { + errorBelch("Could not load Object Code %" PATH_FMT ".\n", OC_INFORMATIVE_FILENAME(oc)); +@@ -1907,7 +1909,7 @@ void + addProddableBlock ( ObjectCode* oc, void* start, int size ) + { + ProddableBlock* pb +- = stgMallocBytes(sizeof(ProddableBlock), "addProddableBlock"); ++ = stgCallocBytes(1,sizeof(ProddableBlock), "addProddableBlock"); + + IF_DEBUG(linker, debugBelch("addProddableBlock: %p %p %d\n", oc, start, size)); + ASSERT(size > 0); +diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h +index 271611a249..784bb19c10 100644 +--- a/rts/LinkerInternals.h ++++ b/rts/LinkerInternals.h +@@ -299,6 +299,10 @@ struct _ObjectCode { + int n_segments; + Segment *segments; + ++ // COMMON section ++ void * common_mem; ++ unsigned long common_size; ++ + // + // Garbage collection fields + // +diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c +index 4cac10ba15..fe0d8ca40e 100644 +--- a/rts/RtsUtils.c ++++ b/rts/RtsUtils.c +@@ -104,6 +104,11 @@ stgCallocBytes (size_t count, size_t size, char *msg) + rtsConfig.mallocFailHook((W_) count*size, msg); + stg_exit(EXIT_INTERNAL_ERROR); + } ++ // If we run under qemu with jemalloc, calloc is not guaranteed ++ // to zero memory. ++ // - https://giters.com/jemalloc/jemalloc/issues/1844 ++ // - https://lists.nongnu.org/archive/html/qemu-devel/2020-05/msg03119.html ++ memset(space, 0, count*size); + return space; + } + +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index bab2ca3041..9f623a62da 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -303,6 +303,15 @@ ocInit_ELF(ObjectCode * oc) + } + } + } ++ if(NULL != oc->common_mem) { ++#if RTS_LINKER_USE_MMAP ++ munmap(oc->common_mem, oc->common_size); ++#else ++ stgFree(oc->common_mem); ++#endif ++ } ++ oc->common_mem = NULL; ++ oc->common_size = 0; + } + + void +@@ -961,14 +970,17 @@ ocGetNames_ELF ( ObjectCode* oc ) + for (size_t j = 0; j < symTab->n_symbols; j++) { + ElfSymbol *symbol = &symTab->symbols[j]; + if (SHN_COMMON == symTab->symbols[j].elf_sym->st_shndx) { +- common_size += symbol->elf_sym->st_size; ++ // st_value holds the alignment. Adding alignment always ++ // should give us some wiggle room to get alignment right. ++ common_size += symbol->elf_sym->st_size + symbol->elf_sym->st_value; + } + } + } +- void * common_mem = NULL; ++ oc->common_mem = NULL; ++ oc->common_size = common_size; + if(common_size > 0) { +- common_mem = mmapAnonForLinker(common_size); +- if (common_mem == NULL) { ++ oc->common_mem = mmapAnonForLinker(common_size); ++ if (oc->common_mem == NULL) { + barf("ocGetNames_ELF: Failed to allocate memory for SHN_COMMONs"); + } + } +@@ -1009,9 +1021,10 @@ ocGetNames_ELF ( ObjectCode* oc ) + if (shndx == SHN_COMMON) { + isLocal = false; + CHECK(common_used < common_size); +- CHECK(common_mem); +- symbol->addr = (void*)((uintptr_t)common_mem + common_used); +- common_used += symbol->elf_sym->st_size; ++ CHECK(oc->common_mem); ++ int alignment = symbol->elf_sym->st_value-1; ++ symbol->addr = (void*)(((uintptr_t)oc->common_mem + common_used + alignment) & ~alignment); ++ common_used = (uintptr_t)symbol->addr - (uintptr_t)oc->common_mem + symbol->elf_sym->st_size; + CHECK(common_used <= common_size); + + IF_DEBUG(linker_verbose, +@@ -1025,7 +1038,9 @@ ocGetNames_ELF ( ObjectCode* oc ) + || ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK + ) + /* and not an undefined symbol */ +- && shndx != SHN_UNDEF ++ && (shndx != SHN_UNDEF ++ /* unless it's weak */ ++ || (shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK)) + /* and not in a "special section" */ + && (shndx < SHN_LORESERVE + #if defined(SHN_XINDEX) +@@ -1052,6 +1067,14 @@ ocGetNames_ELF ( ObjectCode* oc ) + (intptr_t) oc->sections[secno].start + + (intptr_t) symbol->elf_sym->st_value); + CHECK(symbol->addr != 0x0); ++ if(shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK) { ++ symbol->addr = NULL; ++ } else { ++ symbol->addr = (SymbolAddr*)( ++ (intptr_t) oc->sections[secno].start + ++ (intptr_t) symbol->elf_sym->st_value); ++ CHECK(symbol->addr != 0x0); ++ } + if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_LOCAL) { + isLocal = true; + isWeak = false; +@@ -1063,42 +1086,20 @@ ocGetNames_ELF ( ObjectCode* oc ) + isWeak = ELF_ST_BIND(symbol->elf_sym->st_info) + == STB_WEAK; + } +- } +- +- SymType sym_type; +- if (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC) { +- sym_type = SYM_TYPE_CODE; ++ } else if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK ++ && shndx == SHN_UNDEF ++ && (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_OBJECT ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_NOTYPE)) { ++ symbol->addr = NULL; ++ isLocal = false; ++ isWeak = true; + } else { +- sym_type = SYM_TYPE_DATA; +- } +- +- /* And the decision is ... */ +- +- if (symbol->addr != NULL) { +- CHECK(nm != NULL); +- /* Acquire! */ +- if (!isLocal) { +- +- if (isWeak == HS_BOOL_TRUE) { +- setWeakSymbol(oc, nm); +- } +- if (!ghciInsertSymbolTable(oc->fileName, symhash, +- nm, symbol->addr, isWeak, sym_type, oc) +- ) { +- goto fail; +- } +- oc->symbols[curSymbol].name = nm; +- oc->symbols[curSymbol].addr = symbol->addr; +- oc->symbols[curSymbol].type = sym_type; +- curSymbol++; +- } +- } else { +- /* Skip. */ ++ /* Skip. */ + IF_DEBUG(linker_verbose, + debugBelch("skipping `%s'\n", + nm) + ); +- + /* + debugBelch( + "skipping bind = %d, type = %d, secno = %d `%s'\n", +@@ -1108,7 +1109,34 @@ ocGetNames_ELF ( ObjectCode* oc ) + nm + ); + */ ++ continue; + } ++ ++ SymType sym_type; ++ if (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC) { ++ sym_type = SYM_TYPE_CODE; ++ } else { ++ sym_type = SYM_TYPE_DATA; ++ } ++ ++ /* And the decision is ... */ ++ CHECK(nm != NULL); ++ /* Acquire! */ ++ if (!isLocal) { ++ ++ if (isWeak == HS_BOOL_TRUE) { ++ setWeakSymbol(oc, nm); ++ } ++ if (!ghciInsertSymbolTable(oc->fileName, symhash, ++ nm, symbol->addr, isWeak, sym_type, oc) ++ ) { ++ goto fail; ++ } ++ oc->symbols[curSymbol].name = nm; ++ oc->symbols[curSymbol].addr = symbol->addr; ++ oc->symbols[curSymbol].type = sym_type; ++ curSymbol++; ++ } + } + } + } +diff --git a/rts/linker/elf_plt.c b/rts/linker/elf_plt.c +index 9cd42efff2..70817d8b0b 100644 +--- a/rts/linker/elf_plt.c ++++ b/rts/linker/elf_plt.c +@@ -1,4 +1,5 @@ + #include "Rts.h" ++#include "RtsUtils.h" + #include "elf_plt.h" + + #include +@@ -51,7 +52,7 @@ makeStub(Section * section, + void* * addr, + uint8_t flags) { + +- Stub * s = calloc(1, sizeof(Stub)); ++ Stub * s = stgCallocBytes(1, sizeof(Stub), "makeStub"); + ASSERT(s != NULL); + s->target = *addr; + s->flags = flags; +diff --git a/rts/linker/elf_plt_aarch64.c b/rts/linker/elf_plt_aarch64.c +index 11354a63db..6b27a2c73d 100644 +--- a/rts/linker/elf_plt_aarch64.c ++++ b/rts/linker/elf_plt_aarch64.c +@@ -25,6 +25,7 @@ const size_t stubSizeAarch64 = 5 * 4; + */ + bool needStubForRelAarch64(Elf_Rel * rel) { + switch(ELF64_R_TYPE(rel->r_info)) { ++ case COMPAT_R_AARCH64_CONDBR19: + case COMPAT_R_AARCH64_CALL26: + case COMPAT_R_AARCH64_JUMP26: + return true; +@@ -34,6 +35,7 @@ bool needStubForRelAarch64(Elf_Rel * rel) { + } + bool needStubForRelaAarch64(Elf_Rela * rela) { + switch(ELF64_R_TYPE(rela->r_info)) { ++ case COMPAT_R_AARCH64_CONDBR19: + case COMPAT_R_AARCH64_CALL26: + case COMPAT_R_AARCH64_JUMP26: + return true; +diff --git a/rts/linker/elf_reloc_aarch64.c b/rts/linker/elf_reloc_aarch64.c +index 4743e81ea2..f37e3699f1 100644 +--- a/rts/linker/elf_reloc_aarch64.c ++++ b/rts/linker/elf_reloc_aarch64.c +@@ -105,8 +105,24 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) { + break; + } + /* - control flow relocations */ ++ case COMPAT_R_AARCH64_CONDBR19: { /* relocate b.* ... */ ++ // 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ++ // 0 1 0 1 0 1 0 0 [ imm19 ... ++ // ++ // 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ++ // ... imm19 ] 0 [ cond ] ++ CHECK(isInt64(19+2, addend)); /* X in range */ ++ *(inst_t *)P = (*(inst_t *)P & 0xff00001f) ++ | ((uint32_t)(addend << (5-2)) & 0x00ffffe0); ++ break; ++ } + case COMPAT_R_AARCH64_JUMP26: /* relocate b ... */ + case COMPAT_R_AARCH64_CALL26: { /* relocate bl ... */ ++ // 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ++ // 0|1 0 0 1 0 1 [ imm26 ... ++ ++ // 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ++ // ... imm26 ] + CHECK(isInt64(26+2, addend)); /* X in range */ + *(inst_t *)P = (*(inst_t *)P & 0xfc000000) /* keep upper 6 (32-6) + * bits */ +@@ -222,6 +238,23 @@ computeAddend(Section * section, Elf_Rel * rel, + case COMPAT_R_AARCH64_ADD_ABS_LO12_NC: + /* type: static, class: aarch64, op: S + A */ + return (S + A) & 0xfff; ++ case COMPAT_R_AARCH64_CONDBR19: { ++ int64_t V = S + A - P; ++ if(!isInt64(19+2, V)) { ++ /* need a stub */ ++ /* check if we already have that stub */ ++ if(findStub(section, (void**)&S, 0)) { ++ /* did not find it. Crete a new stub. */ ++ if(makeStub(section, (void**)&S, 0)) { ++ abort(/* could not find or make stub */); ++ } ++ } ++ ++ V = S + A -P; ++ assert(isInt64(19+2, V)); ++ } ++ return V; ++ } + case COMPAT_R_AARCH64_JUMP26: + case COMPAT_R_AARCH64_CALL26: { + // S+A-P diff --git a/overlays/patches/ghc/ghc-9.6-static-linker-script-support.patch b/overlays/patches/ghc/ghc-9.6-static-linker-script-support.patch new file mode 100644 index 0000000000..58e7981dba --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-static-linker-script-support.patch @@ -0,0 +1,242 @@ +diff --git a/compiler/GHC/Linker/Static.hs b/compiler/GHC/Linker/Static.hs +index aa51a2b7d6..04ae43cdae 100644 +--- a/compiler/GHC/Linker/Static.hs ++++ b/compiler/GHC/Linker/Static.hs +@@ -32,6 +32,8 @@ import GHC.Linker.Static.Utils + import GHC.Driver.Config.Linker + import GHC.Driver.Session + ++import qualified GHC.Data.ShortText as ST ++ + import System.FilePath + import System.Directory + import Control.Monad +@@ -294,11 +296,9 @@ linkStaticLib logger dflags unit_env o_files dep_units = do + | otherwise + = filter ((/= rtsUnitId) . unitId) pkg_cfgs_init + +- archives <- concatMapM (collectArchives namever ways_) pkg_cfgs +- +- ar <- foldl mappend +- <$> (Archive <$> mapM loadObj modules) +- <*> mapM loadAr archives ++ arFromArchives <- mconcat <$> mapM (loadArchives namever ways_) pkg_cfgs ++ arFromObjects <- Archive <$> mapM loadObj modules ++ let ar = arFromObjects `mappend` arFromArchives + + if toolSettings_ldIsGnuLd (toolSettings dflags) + then writeGNUAr output_fn $ afilter (not . isGNUSymdef) ar +@@ -306,3 +306,18 @@ linkStaticLib logger dflags unit_env o_files dep_units = do + + -- run ranlib over the archive. write*Ar does *not* create the symbol index. + runRanlib logger dflags [GHC.SysTools.FileOption "" output_fn] ++ ++loadArchives :: GhcNameVersion -> Ways -> UnitInfo -> IO Archive ++loadArchives namever ways pc = loadArchivesFromLibs libs ++ where ++ libs = unitHsLibs namever ways pc ++ map ST.unpack (unitExtDepLibsSys pc) ++ loadArchivesFromLibs :: [LibName] -> IO Archive ++ loadArchivesFromLibs libs = do ++ arPaths <- collectArchivesFromLibs namever ways pc libs ++ fmap mconcat $ forM arPaths $ \arPath -> do ++ arOrScript <- loadArchiveOrScript arPath ++ case arOrScript of ++ Ar ar -> return ar ++ ImplicitLinkerScript linkerScript -> ++ case linkerScript of ++ INPUT libNames -> loadArchivesFromLibs libNames +\ No newline at end of file +diff --git a/compiler/GHC/Linker/Unit.hs b/compiler/GHC/Linker/Unit.hs +index 6965edd707..7266bd0082 100644 +--- a/compiler/GHC/Linker/Unit.hs ++++ b/compiler/GHC/Linker/Unit.hs +@@ -2,7 +2,7 @@ + -- | Linking Haskell units + module GHC.Linker.Unit + ( collectLinkOpts +- , collectArchives ++ , collectArchivesFromLibs + , getUnitLinkOpts + , getLibs + ) +@@ -39,13 +39,12 @@ collectLinkOpts namever ways ps = + concatMap (map ST.unpack . unitLinkerOptions) ps + ) + +-collectArchives :: GhcNameVersion -> Ways -> UnitInfo -> IO [FilePath] +-collectArchives namever ways pc = ++collectArchivesFromLibs :: GhcNameVersion -> Ways -> UnitInfo -> [String] -> IO [FilePath] ++collectArchivesFromLibs namever ways pc libs = + filterM doesFileExist [ searchPath ("lib" ++ lib ++ ".a") + | searchPath <- searchPaths + , lib <- libs ] + where searchPaths = ordNub . filter notNull . libraryDirsForWay ways $ pc +- libs = unitHsLibs namever ways pc ++ map ST.unpack (unitExtDepLibsSys pc) + + -- | Either the 'unitLibraryDirs' or 'unitLibraryDynDirs' as appropriate for the way. + libraryDirsForWay :: Ways -> UnitInfo -> [String] +diff --git a/compiler/GHC/SysTools/Ar.hs b/compiler/GHC/SysTools/Ar.hs +index adba60b53c..351103fd4c 100644 +--- a/compiler/GHC/SysTools/Ar.hs ++++ b/compiler/GHC/SysTools/Ar.hs +@@ -20,11 +20,15 @@ of libtool across different platforms. + module GHC.SysTools.Ar + (ArchiveEntry(..) + ,Archive(..) ++ ,ArchiveOrScript(..) ++ ,LinkerScript(..) ++ ,LibName + ,afilter + + ,parseAr + + ,loadAr ++ ,loadArchiveOrScript + ,loadObj + ,writeBSDAr + ,writeGNUAr +@@ -45,6 +49,7 @@ import Control.Applicative + import qualified Data.ByteString as B + import qualified Data.ByteString.Char8 as C + import qualified Data.ByteString.Lazy as L ++import qualified Text.ParserCombinators.ReadP as R + #if !defined(mingw32_HOST_OS) + import qualified System.Posix.Files as POSIX + #endif +@@ -230,6 +235,68 @@ putGNUArch (Archive as) = do + processEntries = + uncurry (:) . mapAccumL processEntry (ArchiveEntry "//" 0 0 0 0 0 mempty) + ++-- | Some systems have archives that are not really archives but contain so ++-- called linker scripts. These scripts contain textual commands to the ++-- linker. This data type represents this choice between an actual archive or ++-- implicit linker script. ++-- ++-- See: https://sourceware.org/binutils/docs/ld/Implicit-Linker-Scripts.html#Implicit-Linker-Scripts ++data ArchiveOrScript = Ar Archive | ImplicitLinkerScript LinkerScript ++ deriving (Eq, Show) ++ ++-- | An AST for a linker script. ++-- ++-- At the moment this AST only supports linker scripts of the form: ++-- ++-- @INPUT(-lc++_static -lc++abi)@ ++-- ++-- Since this is exactly what is used in @nixpkgs@ for @libc++.a@. ++-- ++-- For more information on linker scripts see: ++-- https://sourceware.org/binutils/docs/ld/Scripts.html ++data LinkerScript = INPUT [LibName] ++ deriving (Eq, Show) ++ ++-- | Name of a library to link with. ++-- ++-- This is everything after the @-l@ prefix. ++type LibName = String ++ ++linkerScriptReadP :: R.ReadP LinkerScript ++linkerScriptReadP = skipSpaceChars *> inputReadP <* R.skipSpaces ++ where ++ inputReadP :: R.ReadP LinkerScript ++ inputReadP = fmap INPUT $ R.between (symbol "INPUT(") (symbol ")") $ ++ R.sepBy libReadP sep <* skipSpaceChars ++ where ++ libReadP :: R.ReadP LibName ++ libReadP = R.string "-l" *> R.many1 (R.satisfy isLibNameChar) ++ where ++ isLibNameChar c = c /= ')' && c /= ',' && c /= ' ' ++ ++ sep :: R.ReadP () ++ sep = R.char ' ' *> skipSpaceChars ++ ++ symbol :: String -> R.ReadP () ++ symbol str = R.string str *> skipSpaceChars ++ ++ skipSpaceChars :: R.ReadP () ++ skipSpaceChars = do ++ s <- R.look ++ skip s ++ where ++ skip (' ':s) = do _ <- R.get; skip s ++ skip _ = do return () ++ ++parseArOrScript :: B.ByteString -> Either (ByteOffset, String) ArchiveOrScript ++parseArOrScript bs = ++ case runGetOrFail getArch $ L.fromChunks $ pure bs of ++ Left (_, pos, msg) -> ++ case R.readP_to_S linkerScriptReadP $ C.unpack bs of ++ [(linkerScript, "")] -> Right $ ImplicitLinkerScript linkerScript ++ _ -> Left (pos, msg) ++ Right (_, _, ar) -> Right $ Ar ar ++ + parseAr :: B.ByteString -> Archive + parseAr = runGet getArch . L.fromChunks . pure + +@@ -240,6 +307,18 @@ writeGNUAr fp = L.writeFile fp . runPut . putGNUArch + loadAr :: FilePath -> IO Archive + loadAr fp = parseAr <$> B.readFile fp + ++loadArchiveOrScript :: FilePath -> IO ArchiveOrScript ++loadArchiveOrScript fp = do ++ bs <- B.readFile fp ++ case parseArOrScript bs of ++ Left (pos, msg) -> ++ error $ ++ "Error while decoding archive: " <> fp <> ++ " is neither an archive because decoding failed at position " <> ++ show pos <> " with error " <> msg <> ++ ", nor is it an implicit linker script!" ++ Right arOrScript -> return arOrScript ++ + loadObj :: FilePath -> IO ArchiveEntry + loadObj fp = do + payload <- B.readFile fp +diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs +index 5cb73b1..99e7d01 100644 +--- a/compiler/GHC/Linker/Loader.hs ++++ b/compiler/GHC/Linker/Loader.hs +@@ -61,6 +61,7 @@ import GHC.ByteCode.Asm + import GHC.ByteCode.Types + + import GHC.SysTools ++import GHC.SysTools.Ar (loadArchiveOrScript, ArchiveOrScript(..), LinkerScript(..)) + + import GHC.Types.Basic + import GHC.Types.Name +@@ -1151,7 +1152,7 @@ loadPackage interp hsc_env pkg + #endif + objs = [ obj | Objects objs <- classifieds + , obj <- objs ] +- archs = [ arch | Archive arch <- classifieds ] ++ archPaths = [ arch | Archive arch <- classifieds ] + + -- Add directories to library search paths + let dll_paths = map takeDirectory known_dlls +@@ -1175,7 +1176,8 @@ loadPackage interp hsc_env pkg + -- Ordering isn't important here, because we do one final link + -- step to resolve everything. + mapM_ (loadObj interp) objs +- mapM_ (loadArchive interp) archs ++ resolvedArchives <- resolveArchives interp hsc_env dirs_env gcc_paths archPaths ++ mapM_ (loadArchive interp) resolvedArchives + + maybePutStr logger "linking ... " + ok <- resolveObjs interp +@@ -1194,6 +1196,16 @@ loadPackage interp hsc_env pkg + <> pprUnitInfoForUser pkg <> text "'" + in throwGhcExceptionIO (InstallationError (showSDoc dflags errmsg)) + ++resolveArchives :: Interp -> HscEnv -> [FilePath] -> [FilePath] -> [FilePath] -> IO [FilePath] ++resolveArchives interp hsc_env dirs_env gcc_paths paths = fmap concat $ forM paths $ \path -> do ++ arOrScript <- loadArchiveOrScript path ++ case arOrScript of ++ Ar _ -> return [path] ++ ImplicitLinkerScript (INPUT libs) -> do ++ classifiedLibs <- mapM (locateLib interp hsc_env False dirs_env gcc_paths) libs ++ let resolvedPaths = [arch | Archive arch <- classifiedLibs] ++ resolveArchives interp hsc_env dirs_env gcc_paths resolvedPaths ++ + {- + Note [Crash early load_dyn and locateLib] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + diff --git a/overlays/patches/ghc/ghc-9.6.3-fix-outline-atomics-signature.patch b/overlays/patches/ghc/ghc-9.6.3-fix-outline-atomics-signature.patch new file mode 100644 index 0000000000..65b683b194 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6.3-fix-outline-atomics-signature.patch @@ -0,0 +1,820 @@ +diff --git a/rts/ARMOutlineAtomicsSymbols.h b/rts/ARMOutlineAtomicsSymbols.h +index c8a78b5..31c095e 100644 +--- a/rts/ARMOutlineAtomicsSymbols.h ++++ b/rts/ARMOutlineAtomicsSymbols.h +@@ -10,583 +10,583 @@ + #include + #include + +-uint8_t ghc___aarch64_cas1_relax(uint8_t old, uint8_t new, uint8_t* p); +-uint8_t ghc___aarch64_cas1_relax(uint8_t old, uint8_t new, uint8_t* p) { ++uint8_t ghc___aarch64_cas1_relax(uint8_t old, uint8_t new, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_cas1_relax(uint8_t old, uint8_t new, atomic_uint_least8_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_relaxed, memory_order_relaxed); return old; + } + +-uint8_t ghc___aarch64_cas1_acq(uint8_t old, uint8_t new, uint8_t* p); +-uint8_t ghc___aarch64_cas1_acq(uint8_t old, uint8_t new, uint8_t* p) { ++uint8_t ghc___aarch64_cas1_acq(uint8_t old, uint8_t new, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_cas1_acq(uint8_t old, uint8_t new, atomic_uint_least8_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acquire, memory_order_acquire); return old; + } + +-uint8_t ghc___aarch64_cas1_acq_rel(uint8_t old, uint8_t new, uint8_t* p); +-uint8_t ghc___aarch64_cas1_acq_rel(uint8_t old, uint8_t new, uint8_t* p) { ++uint8_t ghc___aarch64_cas1_acq_rel(uint8_t old, uint8_t new, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_cas1_acq_rel(uint8_t old, uint8_t new, atomic_uint_least8_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acq_rel, memory_order_acquire); return old; + } + +-uint8_t ghc___aarch64_cas1_sync(uint8_t old, uint8_t new, uint8_t* p); +-uint8_t ghc___aarch64_cas1_sync(uint8_t old, uint8_t new, uint8_t* p) { ++uint8_t ghc___aarch64_cas1_sync(uint8_t old, uint8_t new, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_cas1_sync(uint8_t old, uint8_t new, atomic_uint_least8_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_seq_cst, memory_order_seq_cst); return old; + } + +-uint16_t ghc___aarch64_cas2_relax(uint16_t old, uint16_t new, uint16_t* p); +-uint16_t ghc___aarch64_cas2_relax(uint16_t old, uint16_t new, uint16_t* p) { ++uint16_t ghc___aarch64_cas2_relax(uint16_t old, uint16_t new, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_cas2_relax(uint16_t old, uint16_t new, atomic_uint_least16_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_relaxed, memory_order_relaxed); return old; + } + +-uint16_t ghc___aarch64_cas2_acq(uint16_t old, uint16_t new, uint16_t* p); +-uint16_t ghc___aarch64_cas2_acq(uint16_t old, uint16_t new, uint16_t* p) { ++uint16_t ghc___aarch64_cas2_acq(uint16_t old, uint16_t new, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_cas2_acq(uint16_t old, uint16_t new, atomic_uint_least16_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acquire, memory_order_acquire); return old; + } + +-uint16_t ghc___aarch64_cas2_acq_rel(uint16_t old, uint16_t new, uint16_t* p); +-uint16_t ghc___aarch64_cas2_acq_rel(uint16_t old, uint16_t new, uint16_t* p) { ++uint16_t ghc___aarch64_cas2_acq_rel(uint16_t old, uint16_t new, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_cas2_acq_rel(uint16_t old, uint16_t new, atomic_uint_least16_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acq_rel, memory_order_acquire); return old; + } + +-uint16_t ghc___aarch64_cas2_sync(uint16_t old, uint16_t new, uint16_t* p); +-uint16_t ghc___aarch64_cas2_sync(uint16_t old, uint16_t new, uint16_t* p) { ++uint16_t ghc___aarch64_cas2_sync(uint16_t old, uint16_t new, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_cas2_sync(uint16_t old, uint16_t new, atomic_uint_least16_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_seq_cst, memory_order_seq_cst); return old; + } + +-uint32_t ghc___aarch64_cas4_relax(uint32_t old, uint32_t new, uint32_t* p); +-uint32_t ghc___aarch64_cas4_relax(uint32_t old, uint32_t new, uint32_t* p) { ++uint32_t ghc___aarch64_cas4_relax(uint32_t old, uint32_t new, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_cas4_relax(uint32_t old, uint32_t new, atomic_uint_least32_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_relaxed, memory_order_relaxed); return old; + } + +-uint32_t ghc___aarch64_cas4_acq(uint32_t old, uint32_t new, uint32_t* p); +-uint32_t ghc___aarch64_cas4_acq(uint32_t old, uint32_t new, uint32_t* p) { ++uint32_t ghc___aarch64_cas4_acq(uint32_t old, uint32_t new, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_cas4_acq(uint32_t old, uint32_t new, atomic_uint_least32_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acquire, memory_order_acquire); return old; + } + +-uint32_t ghc___aarch64_cas4_acq_rel(uint32_t old, uint32_t new, uint32_t* p); +-uint32_t ghc___aarch64_cas4_acq_rel(uint32_t old, uint32_t new, uint32_t* p) { ++uint32_t ghc___aarch64_cas4_acq_rel(uint32_t old, uint32_t new, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_cas4_acq_rel(uint32_t old, uint32_t new, atomic_uint_least32_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acq_rel, memory_order_acquire); return old; + } + +-uint32_t ghc___aarch64_cas4_sync(uint32_t old, uint32_t new, uint32_t* p); +-uint32_t ghc___aarch64_cas4_sync(uint32_t old, uint32_t new, uint32_t* p) { ++uint32_t ghc___aarch64_cas4_sync(uint32_t old, uint32_t new, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_cas4_sync(uint32_t old, uint32_t new, atomic_uint_least32_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_seq_cst, memory_order_seq_cst); return old; + } + +-uint64_t ghc___aarch64_cas8_relax(uint64_t old, uint64_t new, uint64_t* p); +-uint64_t ghc___aarch64_cas8_relax(uint64_t old, uint64_t new, uint64_t* p) { ++uint64_t ghc___aarch64_cas8_relax(uint64_t old, uint64_t new, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_cas8_relax(uint64_t old, uint64_t new, atomic_uint_least64_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_relaxed, memory_order_relaxed); return old; + } + +-uint64_t ghc___aarch64_cas8_acq(uint64_t old, uint64_t new, uint64_t* p); +-uint64_t ghc___aarch64_cas8_acq(uint64_t old, uint64_t new, uint64_t* p) { ++uint64_t ghc___aarch64_cas8_acq(uint64_t old, uint64_t new, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_cas8_acq(uint64_t old, uint64_t new, atomic_uint_least64_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acquire, memory_order_acquire); return old; + } + +-uint64_t ghc___aarch64_cas8_acq_rel(uint64_t old, uint64_t new, uint64_t* p); +-uint64_t ghc___aarch64_cas8_acq_rel(uint64_t old, uint64_t new, uint64_t* p) { ++uint64_t ghc___aarch64_cas8_acq_rel(uint64_t old, uint64_t new, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_cas8_acq_rel(uint64_t old, uint64_t new, atomic_uint_least64_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_acq_rel, memory_order_acquire); return old; + } + +-uint64_t ghc___aarch64_cas8_sync(uint64_t old, uint64_t new, uint64_t* p); +-uint64_t ghc___aarch64_cas8_sync(uint64_t old, uint64_t new, uint64_t* p) { ++uint64_t ghc___aarch64_cas8_sync(uint64_t old, uint64_t new, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_cas8_sync(uint64_t old, uint64_t new, atomic_uint_least64_t* p) { + atomic_compare_exchange_strong_explicit(p, &old, new, memory_order_seq_cst, memory_order_seq_cst); return old; + } + +-uint8_t ghc___aarch64_swp1_relax(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_swp1_relax(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_swp1_relax(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_swp1_relax(uint8_t v, atomic_uint_least8_t* p) { + return atomic_exchange_explicit(p, v, memory_order_relaxed); + } + +-uint8_t ghc___aarch64_swp1_acq(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_swp1_acq(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_swp1_acq(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_swp1_acq(uint8_t v, atomic_uint_least8_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acquire); + } + +-uint8_t ghc___aarch64_swp1_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_swp1_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_swp1_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_swp1_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_exchange_explicit(p, v, memory_order_release); + } + +-uint8_t ghc___aarch64_swp1_acq_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_swp1_acq_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_swp1_acq_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_swp1_acq_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acq_rel); + } + +-uint8_t ghc___aarch64_swp1_sync(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_swp1_sync(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_swp1_sync(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_swp1_sync(uint8_t v, atomic_uint_least8_t* p) { + return atomic_exchange_explicit(p, v, memory_order_seq_cst); + } + +-uint16_t ghc___aarch64_swp2_relax(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_swp2_relax(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_swp2_relax(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_swp2_relax(uint16_t v, atomic_uint_least16_t* p) { + return atomic_exchange_explicit(p, v, memory_order_relaxed); + } + +-uint16_t ghc___aarch64_swp2_acq(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_swp2_acq(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_swp2_acq(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_swp2_acq(uint16_t v, atomic_uint_least16_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acquire); + } + +-uint16_t ghc___aarch64_swp2_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_swp2_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_swp2_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_swp2_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_exchange_explicit(p, v, memory_order_release); + } + +-uint16_t ghc___aarch64_swp2_acq_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_swp2_acq_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_swp2_acq_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_swp2_acq_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acq_rel); + } + +-uint16_t ghc___aarch64_swp2_sync(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_swp2_sync(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_swp2_sync(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_swp2_sync(uint16_t v, atomic_uint_least16_t* p) { + return atomic_exchange_explicit(p, v, memory_order_seq_cst); + } + +-uint32_t ghc___aarch64_swp4_relax(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_swp4_relax(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_swp4_relax(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_swp4_relax(uint32_t v, atomic_uint_least32_t* p) { + return atomic_exchange_explicit(p, v, memory_order_relaxed); + } + +-uint32_t ghc___aarch64_swp4_acq(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_swp4_acq(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_swp4_acq(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_swp4_acq(uint32_t v, atomic_uint_least32_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acquire); + } + +-uint32_t ghc___aarch64_swp4_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_swp4_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_swp4_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_swp4_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_exchange_explicit(p, v, memory_order_release); + } + +-uint32_t ghc___aarch64_swp4_acq_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_swp4_acq_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_swp4_acq_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_swp4_acq_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acq_rel); + } + +-uint32_t ghc___aarch64_swp4_sync(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_swp4_sync(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_swp4_sync(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_swp4_sync(uint32_t v, atomic_uint_least32_t* p) { + return atomic_exchange_explicit(p, v, memory_order_seq_cst); + } + +-uint64_t ghc___aarch64_swp8_relax(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_swp8_relax(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_swp8_relax(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_swp8_relax(uint64_t v, atomic_uint_least64_t* p) { + return atomic_exchange_explicit(p, v, memory_order_relaxed); + } + +-uint64_t ghc___aarch64_swp8_acq(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_swp8_acq(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_swp8_acq(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_swp8_acq(uint64_t v, atomic_uint_least64_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acquire); + } + +-uint64_t ghc___aarch64_swp8_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_swp8_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_swp8_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_swp8_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_exchange_explicit(p, v, memory_order_release); + } + +-uint64_t ghc___aarch64_swp8_acq_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_swp8_acq_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_swp8_acq_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_swp8_acq_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_exchange_explicit(p, v, memory_order_acq_rel); + } + +-uint64_t ghc___aarch64_swp8_sync(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_swp8_sync(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_swp8_sync(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_swp8_sync(uint64_t v, atomic_uint_least64_t* p) { + return atomic_exchange_explicit(p, v, memory_order_seq_cst); + } + +-uint8_t ghc___aarch64_ldadd1_relax(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldadd1_relax(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldadd1_relax(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldadd1_relax(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_relaxed); + } + +-uint8_t ghc___aarch64_ldadd1_acq(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldadd1_acq(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldadd1_acq(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldadd1_acq(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acquire); + } + +-uint8_t ghc___aarch64_ldadd1_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldadd1_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldadd1_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldadd1_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_release); + } + +-uint8_t ghc___aarch64_ldadd1_acq_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldadd1_acq_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldadd1_acq_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldadd1_acq_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acq_rel); + } + +-uint8_t ghc___aarch64_ldadd1_sync(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldadd1_sync(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldadd1_sync(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldadd1_sync(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_seq_cst); + } + +-uint16_t ghc___aarch64_ldadd2_relax(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldadd2_relax(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldadd2_relax(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldadd2_relax(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_relaxed); + } + +-uint16_t ghc___aarch64_ldadd2_acq(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldadd2_acq(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldadd2_acq(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldadd2_acq(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acquire); + } + +-uint16_t ghc___aarch64_ldadd2_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldadd2_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldadd2_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldadd2_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_release); + } + +-uint16_t ghc___aarch64_ldadd2_acq_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldadd2_acq_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldadd2_acq_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldadd2_acq_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acq_rel); + } + +-uint16_t ghc___aarch64_ldadd2_sync(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldadd2_sync(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldadd2_sync(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldadd2_sync(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_seq_cst); + } + +-uint32_t ghc___aarch64_ldadd4_relax(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldadd4_relax(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldadd4_relax(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldadd4_relax(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_relaxed); + } + +-uint32_t ghc___aarch64_ldadd4_acq(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldadd4_acq(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldadd4_acq(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldadd4_acq(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acquire); + } + +-uint32_t ghc___aarch64_ldadd4_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldadd4_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldadd4_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldadd4_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_release); + } + +-uint32_t ghc___aarch64_ldadd4_acq_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldadd4_acq_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldadd4_acq_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldadd4_acq_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acq_rel); + } + +-uint32_t ghc___aarch64_ldadd4_sync(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldadd4_sync(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldadd4_sync(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldadd4_sync(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_seq_cst); + } + +-uint64_t ghc___aarch64_ldadd8_relax(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldadd8_relax(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldadd8_relax(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldadd8_relax(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_relaxed); + } + +-uint64_t ghc___aarch64_ldadd8_acq(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldadd8_acq(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldadd8_acq(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldadd8_acq(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acquire); + } + +-uint64_t ghc___aarch64_ldadd8_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldadd8_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldadd8_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldadd8_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_release); + } + +-uint64_t ghc___aarch64_ldadd8_acq_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldadd8_acq_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldadd8_acq_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldadd8_acq_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_acq_rel); + } + +-uint64_t ghc___aarch64_ldadd8_sync(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldadd8_sync(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldadd8_sync(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldadd8_sync(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_add_explicit(p, v, memory_order_seq_cst); + } + +-uint8_t ghc___aarch64_ldclr1_relax(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldclr1_relax(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldclr1_relax(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldclr1_relax(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_relaxed); + } + +-uint8_t ghc___aarch64_ldclr1_acq(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldclr1_acq(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldclr1_acq(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldclr1_acq(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acquire); + } + +-uint8_t ghc___aarch64_ldclr1_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldclr1_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldclr1_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldclr1_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_release); + } + +-uint8_t ghc___aarch64_ldclr1_acq_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldclr1_acq_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldclr1_acq_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldclr1_acq_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acq_rel); + } + +-uint8_t ghc___aarch64_ldclr1_sync(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldclr1_sync(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldclr1_sync(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldclr1_sync(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_seq_cst); + } + +-uint16_t ghc___aarch64_ldclr2_relax(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldclr2_relax(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldclr2_relax(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldclr2_relax(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_relaxed); + } + +-uint16_t ghc___aarch64_ldclr2_acq(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldclr2_acq(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldclr2_acq(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldclr2_acq(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acquire); + } + +-uint16_t ghc___aarch64_ldclr2_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldclr2_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldclr2_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldclr2_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_release); + } + +-uint16_t ghc___aarch64_ldclr2_acq_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldclr2_acq_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldclr2_acq_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldclr2_acq_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acq_rel); + } + +-uint16_t ghc___aarch64_ldclr2_sync(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldclr2_sync(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldclr2_sync(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldclr2_sync(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_seq_cst); + } + +-uint32_t ghc___aarch64_ldclr4_relax(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldclr4_relax(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldclr4_relax(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldclr4_relax(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_relaxed); + } + +-uint32_t ghc___aarch64_ldclr4_acq(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldclr4_acq(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldclr4_acq(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldclr4_acq(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acquire); + } + +-uint32_t ghc___aarch64_ldclr4_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldclr4_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldclr4_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldclr4_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_release); + } + +-uint32_t ghc___aarch64_ldclr4_acq_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldclr4_acq_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldclr4_acq_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldclr4_acq_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acq_rel); + } + +-uint32_t ghc___aarch64_ldclr4_sync(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldclr4_sync(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldclr4_sync(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldclr4_sync(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_seq_cst); + } + +-uint64_t ghc___aarch64_ldclr8_relax(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldclr8_relax(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldclr8_relax(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldclr8_relax(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_relaxed); + } + +-uint64_t ghc___aarch64_ldclr8_acq(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldclr8_acq(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldclr8_acq(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldclr8_acq(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acquire); + } + +-uint64_t ghc___aarch64_ldclr8_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldclr8_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldclr8_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldclr8_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_release); + } + +-uint64_t ghc___aarch64_ldclr8_acq_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldclr8_acq_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldclr8_acq_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldclr8_acq_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_acq_rel); + } + +-uint64_t ghc___aarch64_ldclr8_sync(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldclr8_sync(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldclr8_sync(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldclr8_sync(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_and_explicit(p, v, memory_order_seq_cst); + } + +-uint8_t ghc___aarch64_ldeor1_relax(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldeor1_relax(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldeor1_relax(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldeor1_relax(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_relaxed); + } + +-uint8_t ghc___aarch64_ldeor1_acq(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldeor1_acq(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldeor1_acq(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldeor1_acq(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acquire); + } + +-uint8_t ghc___aarch64_ldeor1_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldeor1_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldeor1_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldeor1_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_release); + } + +-uint8_t ghc___aarch64_ldeor1_acq_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldeor1_acq_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldeor1_acq_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldeor1_acq_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acq_rel); + } + +-uint8_t ghc___aarch64_ldeor1_sync(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldeor1_sync(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldeor1_sync(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldeor1_sync(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_seq_cst); + } + +-uint16_t ghc___aarch64_ldeor2_relax(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldeor2_relax(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldeor2_relax(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldeor2_relax(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_relaxed); + } + +-uint16_t ghc___aarch64_ldeor2_acq(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldeor2_acq(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldeor2_acq(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldeor2_acq(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acquire); + } + +-uint16_t ghc___aarch64_ldeor2_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldeor2_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldeor2_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldeor2_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_release); + } + +-uint16_t ghc___aarch64_ldeor2_acq_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldeor2_acq_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldeor2_acq_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldeor2_acq_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acq_rel); + } + +-uint16_t ghc___aarch64_ldeor2_sync(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldeor2_sync(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldeor2_sync(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldeor2_sync(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_seq_cst); + } + +-uint32_t ghc___aarch64_ldeor4_relax(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldeor4_relax(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldeor4_relax(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldeor4_relax(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_relaxed); + } + +-uint32_t ghc___aarch64_ldeor4_acq(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldeor4_acq(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldeor4_acq(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldeor4_acq(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acquire); + } + +-uint32_t ghc___aarch64_ldeor4_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldeor4_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldeor4_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldeor4_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_release); + } + +-uint32_t ghc___aarch64_ldeor4_acq_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldeor4_acq_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldeor4_acq_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldeor4_acq_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acq_rel); + } + +-uint32_t ghc___aarch64_ldeor4_sync(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldeor4_sync(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldeor4_sync(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldeor4_sync(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_seq_cst); + } + +-uint64_t ghc___aarch64_ldeor8_relax(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldeor8_relax(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldeor8_relax(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldeor8_relax(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_relaxed); + } + +-uint64_t ghc___aarch64_ldeor8_acq(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldeor8_acq(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldeor8_acq(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldeor8_acq(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acquire); + } + +-uint64_t ghc___aarch64_ldeor8_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldeor8_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldeor8_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldeor8_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_release); + } + +-uint64_t ghc___aarch64_ldeor8_acq_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldeor8_acq_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldeor8_acq_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldeor8_acq_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_acq_rel); + } + +-uint64_t ghc___aarch64_ldeor8_sync(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldeor8_sync(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldeor8_sync(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldeor8_sync(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_xor_explicit(p, v, memory_order_seq_cst); + } + +-uint8_t ghc___aarch64_ldset1_relax(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldset1_relax(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldset1_relax(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldset1_relax(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_relaxed); + } + +-uint8_t ghc___aarch64_ldset1_acq(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldset1_acq(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldset1_acq(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldset1_acq(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acquire); + } + +-uint8_t ghc___aarch64_ldset1_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldset1_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldset1_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldset1_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_release); + } + +-uint8_t ghc___aarch64_ldset1_acq_rel(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldset1_acq_rel(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldset1_acq_rel(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldset1_acq_rel(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acq_rel); + } + +-uint8_t ghc___aarch64_ldset1_sync(uint8_t v, uint8_t* p); +-uint8_t ghc___aarch64_ldset1_sync(uint8_t v, uint8_t* p) { ++uint8_t ghc___aarch64_ldset1_sync(uint8_t v, atomic_uint_least8_t* p); ++uint8_t ghc___aarch64_ldset1_sync(uint8_t v, atomic_uint_least8_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_seq_cst); + } + +-uint16_t ghc___aarch64_ldset2_relax(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldset2_relax(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldset2_relax(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldset2_relax(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_relaxed); + } + +-uint16_t ghc___aarch64_ldset2_acq(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldset2_acq(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldset2_acq(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldset2_acq(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acquire); + } + +-uint16_t ghc___aarch64_ldset2_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldset2_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldset2_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldset2_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_release); + } + +-uint16_t ghc___aarch64_ldset2_acq_rel(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldset2_acq_rel(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldset2_acq_rel(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldset2_acq_rel(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acq_rel); + } + +-uint16_t ghc___aarch64_ldset2_sync(uint16_t v, uint16_t* p); +-uint16_t ghc___aarch64_ldset2_sync(uint16_t v, uint16_t* p) { ++uint16_t ghc___aarch64_ldset2_sync(uint16_t v, atomic_uint_least16_t* p); ++uint16_t ghc___aarch64_ldset2_sync(uint16_t v, atomic_uint_least16_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_seq_cst); + } + +-uint32_t ghc___aarch64_ldset4_relax(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldset4_relax(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldset4_relax(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldset4_relax(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_relaxed); + } + +-uint32_t ghc___aarch64_ldset4_acq(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldset4_acq(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldset4_acq(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldset4_acq(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acquire); + } + +-uint32_t ghc___aarch64_ldset4_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldset4_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldset4_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldset4_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_release); + } + +-uint32_t ghc___aarch64_ldset4_acq_rel(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldset4_acq_rel(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldset4_acq_rel(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldset4_acq_rel(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acq_rel); + } + +-uint32_t ghc___aarch64_ldset4_sync(uint32_t v, uint32_t* p); +-uint32_t ghc___aarch64_ldset4_sync(uint32_t v, uint32_t* p) { ++uint32_t ghc___aarch64_ldset4_sync(uint32_t v, atomic_uint_least32_t* p); ++uint32_t ghc___aarch64_ldset4_sync(uint32_t v, atomic_uint_least32_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_seq_cst); + } + +-uint64_t ghc___aarch64_ldset8_relax(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldset8_relax(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldset8_relax(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldset8_relax(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_relaxed); + } + +-uint64_t ghc___aarch64_ldset8_acq(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldset8_acq(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldset8_acq(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldset8_acq(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acquire); + } + +-uint64_t ghc___aarch64_ldset8_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldset8_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldset8_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldset8_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_release); + } + +-uint64_t ghc___aarch64_ldset8_acq_rel(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldset8_acq_rel(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldset8_acq_rel(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldset8_acq_rel(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_acq_rel); + } + +-uint64_t ghc___aarch64_ldset8_sync(uint64_t v, uint64_t* p); +-uint64_t ghc___aarch64_ldset8_sync(uint64_t v, uint64_t* p) { ++uint64_t ghc___aarch64_ldset8_sync(uint64_t v, atomic_uint_least64_t* p); ++uint64_t ghc___aarch64_ldset8_sync(uint64_t v, atomic_uint_least64_t* p) { + return atomic_fetch_or_explicit(p, v, memory_order_seq_cst); + } + diff --git a/overlays/patches/ghc/ghc-9.6.7-JS-implement-TH-support.patch b/overlays/patches/ghc/ghc-9.6.7-JS-implement-TH-support.patch new file mode 100644 index 0000000000..32a6482a38 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6.7-JS-implement-TH-support.patch @@ -0,0 +1,3661 @@ +diff --git a/compiler/GHC.hs b/compiler/GHC.hs +index 211c8dc9a2..30d6d6b014 100644 +--- a/compiler/GHC.hs ++++ b/compiler/GHC.hs +@@ -1,3 +1,4 @@ ++{-# LANGUAGE MultiWayIf #-} + {-# LANGUAGE CPP #-} + {-# LANGUAGE NondecreasingIndentation, ScopedTypeVariables #-} + {-# LANGUAGE TupleSections, NamedFieldPuns #-} +@@ -316,6 +317,7 @@ import GHC.Driver.Backend + import GHC.Driver.Config.Finder (initFinderOpts) + import GHC.Driver.Config.Parser (initParserOpts) + import GHC.Driver.Config.Logger (initLogFlags) ++import GHC.Driver.Config.StgToJS (initStgToJSConfig) + import GHC.Driver.Config.Diagnostic + import GHC.Driver.Main + import GHC.Driver.Make +@@ -675,8 +677,10 @@ setTopSessionDynFlags dflags = do + logger <- getLogger + + -- Interpreter +- interp <- if gopt Opt_ExternalInterpreter dflags +- then do ++ interp <- if ++ -- external interpreter ++ | gopt Opt_ExternalInterpreter dflags ++ -> do + let + prog = pgm_i dflags ++ flavour + profiled = ways dflags `hasWay` WayProf +@@ -698,10 +702,31 @@ setTopSessionDynFlags dflags = do + , iservConfHook = createIservProcessHook (hsc_hooks hsc_env) + , iservConfTrace = tr + } +- s <- liftIO $ newMVar IServPending ++ s <- liftIO $ newMVar InterpPending ++ loader <- liftIO Loader.uninitializedLoader ++ return (Just (Interp (ExternalInterp (ExtIServ (ExtInterpState conf s))) loader)) ++ ++ -- JavaScript interpreter ++ | ArchJavaScript <- platformArch (targetPlatform dflags) ++ -> do ++ s <- liftIO $ newMVar InterpPending + loader <- liftIO Loader.uninitializedLoader +- return (Just (Interp (ExternalInterp conf (IServ s)) loader)) +- else ++ let cfg = JSInterpConfig ++ { jsInterpNodeConfig = defaultNodeJsSettings ++ , jsInterpScript = topDir dflags "ghc-interp.js" ++ , jsInterpTmpFs = hsc_tmpfs hsc_env ++ , jsInterpTmpDir = tmpDir dflags ++ , jsInterpLogger = hsc_logger hsc_env ++ , jsInterpCodegenCfg = initStgToJSConfig dflags ++ , jsInterpUnitEnv = hsc_unit_env hsc_env ++ , jsInterpFinderOpts = initFinderOpts dflags ++ , jsInterpFinderCache = hsc_FC hsc_env ++ } ++ return (Just (Interp (ExternalInterp (ExtJS (ExtInterpState cfg s))) loader)) ++ ++ -- Internal interpreter ++ | otherwise ++ -> + #if defined(HAVE_INTERNAL_INTERPRETER) + do + loader <- liftIO Loader.uninitializedLoader +diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs +index 651f9bf8a2..24bfd5dfc4 100644 +--- a/compiler/GHC/Driver/Main.hs ++++ b/compiler/GHC/Driver/Main.hs +@@ -140,9 +140,10 @@ import GHC.Driver.Hooks + import GHC.Driver.GenerateCgIPEStub (generateCgIPEStub, lookupEstimatedTicks) + + import GHC.Runtime.Context +-import GHC.Runtime.Interpreter ( addSptEntry ) ++import GHC.Runtime.Interpreter ++import GHC.Runtime.Interpreter.JS + import GHC.Runtime.Loader ( initializePlugins ) +-import GHCi.RemoteTypes ( ForeignHValue ) ++import GHCi.RemoteTypes + import GHC.ByteCode.Types + + import GHC.Linker.Loader +@@ -156,6 +157,9 @@ import GHC.HsToCore + + import GHC.StgToByteCode ( byteCodeGen ) + import GHC.StgToJS ( stgToJS ) ++import GHC.StgToJS.Ids ++import GHC.StgToJS.Types ++import GHC.JS.Syntax + + import GHC.IfaceToCore ( typecheckIface, typecheckWholeCoreBindings ) + +@@ -172,7 +176,6 @@ import GHC.Core + import GHC.Core.Lint.Interactive ( interactiveInScope ) + import GHC.Core.Tidy ( tidyExpr ) + import GHC.Core.Type ( Type, Kind ) +-import GHC.Core.Multiplicity + import GHC.Core.Utils ( exprType ) + import GHC.Core.ConLike + import GHC.Core.Opt.Pipeline +@@ -201,7 +204,6 @@ import GHC.Stg.Pipeline ( stg2stg, StgCgInfos ) + + import GHC.Builtin.Utils + import GHC.Builtin.Names +-import GHC.Builtin.Uniques ( mkPseudoUniqueE ) + + import qualified GHC.StgToCmm as StgToCmm ( codeGen ) + import GHC.StgToCmm.Types (CmmCgInfos (..), ModuleLFInfos) +@@ -230,7 +232,7 @@ import GHC.Types.Id + import GHC.Types.SourceError + import GHC.Types.SafeHaskell + import GHC.Types.ForeignStubs +-import GHC.Types.Var.Env ( emptyTidyEnv ) ++import GHC.Types.Var.Env ( mkEmptyTidyEnv ) + import GHC.Types.Error + import GHC.Types.Fixity.Env + import GHC.Types.CostCentre +@@ -243,6 +245,8 @@ import GHC.Types.Name.Reader + import GHC.Types.Name.Ppr + import GHC.Types.TyThing + import GHC.Types.HpcInfo ++import GHC.Types.Unique.Supply (uniqFromTag) ++import GHC.Types.Unique (getKey) + + import GHC.Utils.Fingerprint ( Fingerprint ) + import GHC.Utils.Panic +@@ -289,6 +293,7 @@ import GHC.Stg.InferTags.TagSig (seqTagSig) + import GHC.StgToCmm.Utils (IPEStats) + import GHC.Types.Unique.FM + import GHC.Cmm.Config (CmmConfig) ++import GHC.Types.Unique.DFM + + + {- ********************************************************************** +@@ -2157,31 +2162,6 @@ doCodeGen hsc_env this_mod denv data_tycons + + return $ Stream.mapM dump2 pipeline_stream + +-myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext +- -> Bool +- -> Module -> ModLocation -> CoreExpr +- -> IO ( Id +- , [CgStgTopBinding] +- , InfoTableProvMap +- , CollectedCCs +- , StgCgInfos ) +-myCoreToStgExpr logger dflags ictxt for_bytecode this_mod ml prepd_expr = do +- {- Create a temporary binding (just because myCoreToStg needs a +- binding for the stg2stg step) -} +- let bco_tmp_id = mkSysLocal (fsLit "BCO_toplevel") +- (mkPseudoUniqueE 0) +- ManyTy +- (exprType prepd_expr) +- (stg_binds, prov_map, collected_ccs, stg_cg_infos) <- +- myCoreToStg logger +- dflags +- ictxt +- for_bytecode +- this_mod +- ml +- [NonRec bco_tmp_id prepd_expr] +- return (bco_tmp_id, stg_binds, prov_map, collected_ccs, stg_cg_infos) +- + myCoreToStg :: Logger -> DynFlags -> InteractiveContext + -> Bool + -> Module -> ModLocation -> CoreProgram +@@ -2562,56 +2542,117 @@ hscCompileCoreExpr hsc_env loc expr = + Just h -> h hsc_env loc expr + + hscCompileCoreExpr' :: HscEnv -> SrcSpan -> CoreExpr -> IO (ForeignHValue, [Linkable], PkgsLoaded) +-hscCompileCoreExpr' hsc_env srcspan ds_expr +- = do { {- Simplify it -} +- -- Question: should we call SimpleOpt.simpleOptExpr here instead? +- -- It is, well, simpler, and does less inlining etc. +- let dflags = hsc_dflags hsc_env +- ; let logger = hsc_logger hsc_env +- ; let ic = hsc_IC hsc_env +- ; let unit_env = hsc_unit_env hsc_env +- ; let simplify_expr_opts = initSimplifyExprOpts dflags ic +- ; simpl_expr <- simplifyExpr logger (ue_eps unit_env) simplify_expr_opts ds_expr +- +- {- Tidy it (temporary, until coreSat does cloning) -} +- ; let tidy_expr = tidyExpr emptyTidyEnv simpl_expr +- +- {- Prepare for codegen -} +- ; cp_cfg <- initCorePrepConfig hsc_env +- ; prepd_expr <- corePrepExpr +- logger cp_cfg +- tidy_expr +- +- {- Lint if necessary -} +- ; lintInteractiveExpr (text "hscCompileExpr") hsc_env prepd_expr +- ; let iNTERACTIVELoc = ModLocation{ ml_hs_file = Nothing, +- ml_hi_file = panic "hscCompileCoreExpr':ml_hi_file", +- ml_obj_file = panic "hscCompileCoreExpr':ml_obj_file", +- ml_dyn_obj_file = panic "hscCompileCoreExpr': ml_obj_file", +- ml_dyn_hi_file = panic "hscCompileCoreExpr': ml_dyn_hi_file", +- ml_hie_file = panic "hscCompileCoreExpr':ml_hie_file" } +- +- ; let ictxt = hsc_IC hsc_env +- ; (binding_id, stg_expr, _, _, _stg_cg_info) <- +- myCoreToStgExpr logger +- dflags +- ictxt +- True +- (icInteractiveModule ictxt) +- iNTERACTIVELoc +- prepd_expr +- +- {- Convert to BCOs -} +- ; bcos <- byteCodeGen hsc_env +- (icInteractiveModule ictxt) +- stg_expr +- [] Nothing +- +- {- load it -} +- ; (fv_hvs, mods_needed, units_needed) <- loadDecls (hscInterp hsc_env) hsc_env srcspan bcos +- {- Get the HValue for the root -} +- ; return (expectJust "hscCompileCoreExpr'" +- $ lookup (idName binding_id) fv_hvs, mods_needed, units_needed) } ++hscCompileCoreExpr' hsc_env srcspan ds_expr = do ++ {- Simplify it -} ++ -- Question: should we call SimpleOpt.simpleOptExpr here instead? ++ -- It is, well, simpler, and does less inlining etc. ++ let dflags = hsc_dflags hsc_env ++ let logger = hsc_logger hsc_env ++ let ic = hsc_IC hsc_env ++ let unit_env = hsc_unit_env hsc_env ++ let simplify_expr_opts = initSimplifyExprOpts dflags ic ++ ++ simpl_expr <- simplifyExpr logger (ue_eps unit_env) simplify_expr_opts ds_expr ++ ++ -- Create a unique temporary binding ++ -- ++ -- The id has to be exported for the JS backend. This isn't required for the ++ -- byte-code interpreter but it does no harm to always do it. ++ u <- uniqFromTag 'I' ++ let binding_name = mkSystemVarName u (fsLit ("BCO_toplevel")) ++ let binding_id = mkExportedVanillaId binding_name (exprType simpl_expr) ++ ++ {- Tidy it (temporary, until coreSat does cloning) -} ++ let tidy_occ_env = initTidyOccEnv [occName binding_id] ++ let tidy_env = mkEmptyTidyEnv tidy_occ_env ++ let tidy_expr = tidyExpr tidy_env simpl_expr ++ ++ {- Prepare for codegen -} ++ cp_cfg <- initCorePrepConfig hsc_env ++ prepd_expr <- corePrepExpr ++ logger cp_cfg ++ tidy_expr ++ ++ {- Lint if necessary -} ++ lintInteractiveExpr (text "hscCompileExpr") hsc_env prepd_expr ++ let this_loc = ModLocation{ ml_hs_file = Nothing, ++ ml_hi_file = panic "hscCompileCoreExpr':ml_hi_file", ++ ml_obj_file = panic "hscCompileCoreExpr':ml_obj_file", ++ ml_dyn_obj_file = panic "hscCompileCoreExpr': ml_obj_file", ++ ml_dyn_hi_file = panic "hscCompileCoreExpr': ml_dyn_hi_file", ++ ml_hie_file = panic "hscCompileCoreExpr':ml_hie_file" } ++ ++ let ictxt = (hsc_IC hsc_env) { ++ ic_mod_index = fromIntegral (getKey u) ++ -- Ensure module uniqueness ("GhciNNNN") by reusing the unique ++ -- we've used for the binding. If ic_mod_index was mutable, we ++ -- would simply bump it here after its use. ++ -- ++ -- This uniqueness is needed by the JS linker. Without it we ++ -- break the 1-2-1 relationship between modules and object ++ -- files, i.e. we get different object files for the same module ++ -- End the linker doesn't support this. ++ } ++ let this_mod = icInteractiveModule ictxt ++ let for_bytecode = True ++ ++ (stg_binds, _prov_map, _collected_ccs, _stg_cg_infos) <- ++ myCoreToStg logger ++ dflags ++ ictxt ++ for_bytecode ++ this_mod ++ this_loc ++ [NonRec binding_id prepd_expr] ++ ++ let interp = hscInterp hsc_env ++ let tmpfs = hsc_tmpfs hsc_env ++ let tmp_dir = tmpDir dflags ++ ++ case interp of ++ Interp (ExternalInterp (ExtJS i)) _ -> do ++ let js_config = initStgToJSConfig dflags ++ foreign_stubs = NoStubs ++ spt_entries = mempty ++ cost_centre_info = mempty ++ ++ -- codegen into object file whose path is in out_obj ++ out_obj <- newTempName logger tmpfs tmp_dir TFL_CurrentModule "o" ++ stgToJS logger js_config stg_binds this_mod spt_entries foreign_stubs cost_centre_info out_obj ++ ++ let TxtI id_sym = makeIdentForId binding_id Nothing IdPlain this_mod ++ -- link code containing binding "id_sym = expr", using id_sym as root ++ withJSInterp i $ \inst -> do ++ let roots = mkExportedModFuns this_mod [id_sym] ++ jsLinkObject logger tmpfs tmp_dir js_config unit_env inst out_obj roots ++ ++ -- look up "id_sym" closure and create a StablePtr (HValue) from it ++ href <- lookupClosure interp (unpackFS id_sym) >>= \case ++ Nothing -> pprPanic "Couldn't find just linked TH closure" (ppr id_sym) ++ Just r -> pure r ++ ++ binding_fref <- withJSInterp i $ \inst -> ++ mkForeignRef href (freeReallyRemoteRef inst href) ++ ++ -- FIXME: LoaderState doesn't make sense for the JS linker ++ -- The state is maintained in the interpreter instance (jsLinkState field) ++ let linkables = mempty ++ let loaded_pkgs = emptyUDFM ++ ++ return (castForeignRef binding_fref, linkables, loaded_pkgs) ++ ++ _ -> do ++ {- Convert to BCOs -} ++ bcos <- byteCodeGen hsc_env ++ this_mod ++ stg_binds ++ [] Nothing ++ ++ {- load it -} ++ (fv_hvs, mods_needed, units_needed) <- loadDecls interp hsc_env srcspan bcos ++ {- Get the HValue for the root -} ++ return (expectJust "hscCompileCoreExpr'" ++ $ lookup (idName binding_id) fv_hvs, mods_needed, units_needed) + + + {- ********************************************************************** +diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs +index a036334b04..801b9a021d 100644 +--- a/compiler/GHC/Driver/Pipeline.hs ++++ b/compiler/GHC/Driver/Pipeline.hs +@@ -111,8 +111,6 @@ import GHC.Types.SourceError + + import GHC.Unit + import GHC.Unit.Env +---import GHC.Unit.Finder +---import GHC.Unit.State + import GHC.Unit.Module.ModSummary + import GHC.Unit.Module.ModIface + import GHC.Unit.Module.Deps +diff --git a/compiler/GHC/Runtime/Interpreter.hs b/compiler/GHC/Runtime/Interpreter.hs +index 843c7ff463..466d60d29a 100644 +--- a/compiler/GHC/Runtime/Interpreter.hs ++++ b/compiler/GHC/Runtime/Interpreter.hs +@@ -3,6 +3,8 @@ + {-# LANGUAGE RecordWildCards #-} + {-# LANGUAGE ScopedTypeVariables #-} + {-# LANGUAGE TupleSections #-} ++{-# LANGUAGE LambdaCase #-} ++{-# LANGUAGE RankNTypes #-} + + -- | Interacting with the iserv interpreter, whether it is running on an + -- external process or in the current process. +@@ -47,22 +49,30 @@ module GHC.Runtime.Interpreter + , resolveObjs + , findSystemLibrary + +- -- * Lower-level API using messages +- , interpCmd, Message(..), withIServ, withIServ_ ++ , interpCmd ++ , withExtInterp ++ , withExtInterpStatus ++ , withIServ ++ , withJSInterp + , stopInterp +- , iservCall, readIServ, writeIServ + , purgeLookupSymbolCache ++ , freeReallyRemoteRef + , freeHValueRefs + , mkFinalizedHValue + , wormhole, wormholeRef + , fromEvalResult ++ ++ -- * Reexport for convenience ++ , Message (..) ++ , module GHC.Runtime.Interpreter.Process + ) where + + import GHC.Prelude + +-import GHC.IO (catchException) +- + import GHC.Runtime.Interpreter.Types ++import GHC.Runtime.Interpreter.JS ++import GHC.Runtime.Interpreter.Process ++import GHC.Runtime.Utils + import GHCi.Message + import GHCi.RemoteTypes + import GHCi.ResolvedBCO +@@ -98,7 +108,7 @@ import GHC.Platform.Ways + import Control.Concurrent + import Control.Monad + import Control.Monad.IO.Class +-import Control.Monad.Catch as MC (mask, onException) ++import Control.Monad.Catch as MC (mask) + import Data.Binary + import Data.Binary.Put + import Data.ByteString (ByteString) +@@ -108,19 +118,6 @@ import Data.IORef + import Foreign hiding (void) + import qualified GHC.Exts.Heap as Heap + import GHC.Stack.CCS (CostCentre,CostCentreStack) +-import System.Exit +-import GHC.IO.Handle.Types (Handle) +-#if defined(mingw32_HOST_OS) +-import Foreign.C +-import GHC.IO.Handle.FD (fdToHandle) +-# if defined(__IO_MANAGER_WINIO__) +-import GHC.IO.SubSystem (()) +-import GHC.IO.Handle.Windows (handleToHANDLE) +-import GHC.Event.Windows (associateHandle') +-# endif +-#else +-import System.Posix as Posix +-#endif + import System.Directory + import System.Process + import GHC.Conc (pseq, par) +@@ -199,10 +196,20 @@ interpCmd interp msg = case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) + InternalInterp -> run msg -- Just run it directly + #endif +- ExternalInterp c i -> withIServ_ c i $ \iserv -> ++ ExternalInterp ext -> withExtInterp ext $ \inst -> + uninterruptibleMask_ $ -- Note [uninterruptibleMask_ and interpCmd] +- iservCall iserv msg ++ sendMessage inst msg ++ + ++withExtInterp :: ExceptionMonad m => ExtInterp -> (forall d. ExtInterpInstance d -> m a) -> m a ++withExtInterp ext action = case ext of ++ ExtJS i -> withJSInterp i action ++ ExtIServ i -> withIServ i action ++ ++withExtInterpStatus :: ExtInterp -> (forall d. ExtInterpStatusVar d -> m a) -> m a ++withExtInterpStatus ext action = case ext of ++ ExtJS i -> action (interpStatus i) ++ ExtIServ i -> action (interpStatus i) + + -- Note [uninterruptibleMask_ and interpCmd] + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -217,37 +224,51 @@ interpCmd interp msg = case interpInstance interp of + -- Overloaded because this is used from TcM as well as IO. + withIServ + :: (ExceptionMonad m) +- => IServConfig -> IServ -> (IServInstance -> m (IServInstance, a)) -> m a +-withIServ conf (IServ mIServState) action = +- MC.mask $ \restore -> do +- state <- liftIO $ takeMVar mIServState +- +- iserv <- case state of +- -- start the external iserv process if we haven't done so yet +- IServPending -> +- liftIO (spawnIServ conf) +- `MC.onException` (liftIO $ putMVar mIServState state) +- +- IServRunning inst -> return inst +- +- +- let iserv' = iserv{ iservPendingFrees = [] } +- +- (iserv'',a) <- (do +- -- free any ForeignHValues that have been garbage collected. +- liftIO $ when (not (null (iservPendingFrees iserv))) $ +- iservCall iserv (FreeHValueRefs (iservPendingFrees iserv)) +- -- run the inner action +- restore $ action iserv') +- `MC.onException` (liftIO $ putMVar mIServState (IServRunning iserv')) +- liftIO $ putMVar mIServState (IServRunning iserv'') +- return a +- +-withIServ_ +- :: (MonadIO m, ExceptionMonad m) +- => IServConfig -> IServ -> (IServInstance -> m a) -> m a +-withIServ_ conf iserv action = withIServ conf iserv $ \inst -> +- (inst,) <$> action inst ++ => IServ -> (ExtInterpInstance () -> m a) -> m a ++withIServ (ExtInterpState cfg mstate) action = do ++ inst <- spawnInterpMaybe cfg spawnIServ mstate ++ action inst ++ ++-- | Spawn JS interpreter if it isn't already running and execute the given action ++-- ++-- Update the interpreter state. ++withJSInterp :: ExceptionMonad m => JSInterp -> (ExtInterpInstance JSInterpExtra -> m a) -> m a ++withJSInterp (ExtInterpState cfg mstate) action = do ++ inst <- spawnInterpMaybe cfg spawnJSInterp mstate ++ action inst ++ ++-- | Spawn an interpreter if not already running according to the status in the ++-- MVar. Update the status, free pending heap references, and return the ++-- interpreter instance. ++-- ++-- This function is generic to support both the native external interpreter and ++-- the JS one. ++spawnInterpMaybe :: ExceptionMonad m => cfg -> (cfg -> IO (ExtInterpInstance d)) -> ExtInterpStatusVar d -> m (ExtInterpInstance d) ++spawnInterpMaybe cfg spawn mstatus = do ++ inst <- liftIO $ modifyMVarMasked mstatus $ \case ++ -- start the external iserv process if we haven't done so yet ++ InterpPending -> do ++ inst <- spawn cfg ++ pure (InterpRunning inst, inst) ++ ++ InterpRunning inst -> do ++ pure (InterpRunning inst, inst) ++ ++ -- free any ForeignRef that have been garbage collected. ++ pending_frees <- liftIO $ swapMVar (instPendingFrees inst) [] ++ liftIO $ when (not (null (pending_frees))) $ ++ sendMessage inst (FreeHValueRefs pending_frees) ++ ++ -- run the inner action ++ pure inst ++ ++withExtInterpMaybe ++ :: (ExceptionMonad m) ++ => ExtInterp -> (forall d. Maybe (ExtInterpInstance d) -> m a) -> m a ++withExtInterpMaybe ext action = withExtInterpStatus ext $ \mstate -> do ++ liftIO (readMVar mstate) >>= \case ++ InterpPending {} -> action Nothing -- already shut down or never launched ++ InterpRunning inst -> action (Just inst) + + -- ----------------------------------------------------------------------------- + -- Wrappers around messages +@@ -454,24 +475,27 @@ lookupSymbol interp str = case interpInstance interp of + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) + #endif + +- ExternalInterp c i -> withIServ c i $ \iserv -> do +- -- Profiling of GHCi showed a lot of time and allocation spent +- -- making cross-process LookupSymbol calls, so I added a GHC-side +- -- cache which sped things up quite a lot. We have to be careful +- -- to purge this cache when unloading code though. +- let cache = iservLookupSymbolCache iserv +- case lookupUFM cache str of +- Just p -> return (iserv, Just p) +- Nothing -> do +- m <- uninterruptibleMask_ $ +- iservCall iserv (LookupSymbol (unpackFS str)) +- case m of +- Nothing -> return (iserv, Nothing) +- Just r -> do +- let p = fromRemotePtr r +- cache' = addToUFM cache str p +- iserv' = iserv {iservLookupSymbolCache = cache'} +- return (iserv', Just p) ++ ExternalInterp ext -> case ext of ++ ExtIServ i -> withIServ i $ \inst -> do ++ -- Profiling of GHCi showed a lot of time and allocation spent ++ -- making cross-process LookupSymbol calls, so I added a GHC-side ++ -- cache which sped things up quite a lot. We have to be careful ++ -- to purge this cache when unloading code though. ++ cache <- readMVar (instLookupSymbolCache inst) ++ case lookupUFM cache str of ++ Just p -> return (Just p) ++ Nothing -> do ++ m <- uninterruptibleMask_ $ ++ sendMessage inst (LookupSymbol (unpackFS str)) ++ case m of ++ Nothing -> return Nothing ++ Just r -> do ++ let p = fromRemotePtr r ++ cache' = addToUFM cache str p ++ modifyMVar_ (instLookupSymbolCache inst) (const (pure cache')) ++ return (Just p) ++ ++ ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) + + lookupClosure :: Interp -> String -> IO (Maybe HValueRef) + lookupClosure interp str = +@@ -482,12 +506,9 @@ purgeLookupSymbolCache interp = case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) + InternalInterp -> pure () + #endif +- ExternalInterp _ (IServ mstate) -> +- modifyMVar_ mstate $ \state -> pure $ case state of +- IServPending -> state +- IServRunning iserv -> IServRunning +- (iserv { iservLookupSymbolCache = emptyUFM }) +- ++ ExternalInterp ext -> withExtInterpMaybe ext $ \case ++ Nothing -> pure () -- interpreter stopped, nothing to do ++ Just inst -> modifyMVar_ (instLookupSymbolCache inst) (const (pure emptyUFM)) + + -- | loadDLL loads a dynamic library using the OS's native linker + -- (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either +@@ -537,56 +558,35 @@ resolveObjs interp = successIf <$> interpCmd interp ResolveObjs + findSystemLibrary :: Interp -> String -> IO (Maybe String) + findSystemLibrary interp str = interpCmd interp (FindSystemLibrary str) + +- + -- ----------------------------------------------------------------------------- +--- Raw calls and messages +- +--- | Send a 'Message' and receive the response from the iserv process +-iservCall :: Binary a => IServInstance -> Message a -> IO a +-iservCall iserv msg = +- remoteCall (iservPipe iserv) msg +- `catchException` \(e :: SomeException) -> handleIServFailure iserv e +- +--- | Read a value from the iserv process +-readIServ :: IServInstance -> Get a -> IO a +-readIServ iserv get = +- readPipe (iservPipe iserv) get +- `catchException` \(e :: SomeException) -> handleIServFailure iserv e +- +--- | Send a value to the iserv process +-writeIServ :: IServInstance -> Put -> IO () +-writeIServ iserv put = +- writePipe (iservPipe iserv) put +- `catchException` \(e :: SomeException) -> handleIServFailure iserv e +- +-handleIServFailure :: IServInstance -> SomeException -> IO a +-handleIServFailure iserv e = do +- let proc = iservProcess iserv +- ex <- getProcessExitCode proc +- case ex of +- Just (ExitFailure n) -> +- throwIO (InstallationError ("ghc-iserv terminated (" ++ show n ++ ")")) +- _ -> do +- terminateProcess proc +- _ <- waitForProcess proc +- throw e ++-- IServ specific calls and messages + + -- | Spawn an external interpreter +-spawnIServ :: IServConfig -> IO IServInstance ++spawnIServ :: IServConfig -> IO (ExtInterpInstance ()) + spawnIServ conf = do + iservConfTrace conf + let createProc = fromMaybe (\cp -> do { (_,_,_,ph) <- createProcess cp + ; return ph }) + (iservConfHook conf) + (ph, rh, wh) <- runWithPipes createProc (iservConfProgram conf) ++ [] + (iservConfOpts conf) + lo_ref <- newIORef Nothing +- return $ IServInstance +- { iservPipe = Pipe { pipeRead = rh, pipeWrite = wh, pipeLeftovers = lo_ref } +- , iservProcess = ph +- , iservLookupSymbolCache = emptyUFM +- , iservPendingFrees = [] +- } ++ let pipe = Pipe { pipeRead = rh, pipeWrite = wh, pipeLeftovers = lo_ref } ++ let process = InterpProcess ++ { interpHandle = ph ++ , interpPipe = pipe ++ } ++ ++ pending_frees <- newMVar [] ++ lookup_cache <- newMVar emptyUFM ++ let inst = ExtInterpInstance ++ { instProcess = process ++ , instPendingFrees = pending_frees ++ , instLookupSymbolCache = lookup_cache ++ , instExtra = () ++ } ++ pure inst + + -- | Stop the interpreter + stopInterp :: Interp -> IO () +@@ -594,76 +594,16 @@ stopInterp interp = case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) + InternalInterp -> pure () + #endif +- ExternalInterp _ (IServ mstate) -> ++ ExternalInterp ext -> withExtInterpStatus ext $ \mstate -> do + MC.mask $ \_restore -> modifyMVar_ mstate $ \state -> do + case state of +- IServPending -> pure state -- already stopped +- IServRunning i -> do +- ex <- getProcessExitCode (iservProcess i) ++ InterpPending -> pure state -- already stopped ++ InterpRunning i -> do ++ ex <- getProcessExitCode (interpHandle (instProcess i)) + if isJust ex + then pure () +- else iservCall i Shutdown +- pure IServPending +- +-runWithPipes :: (CreateProcess -> IO ProcessHandle) +- -> FilePath -> [String] -> IO (ProcessHandle, Handle, Handle) +-#if defined(mingw32_HOST_OS) +-foreign import ccall "io.h _close" +- c__close :: CInt -> IO CInt +- +-foreign import ccall unsafe "io.h _get_osfhandle" +- _get_osfhandle :: CInt -> IO CInt +- +-runWithPipesPOSIX :: (CreateProcess -> IO ProcessHandle) +- -> FilePath -> [String] -> IO (ProcessHandle, Handle, Handle) +-runWithPipesPOSIX createProc prog opts = do +- (rfd1, wfd1) <- createPipeFd -- we read on rfd1 +- (rfd2, wfd2) <- createPipeFd -- we write on wfd2 +- wh_client <- _get_osfhandle wfd1 +- rh_client <- _get_osfhandle rfd2 +- let args = show wh_client : show rh_client : opts +- ph <- createProc (proc prog args) +- rh <- mkHandle rfd1 +- wh <- mkHandle wfd2 +- return (ph, rh, wh) +- where mkHandle :: CInt -> IO Handle +- mkHandle fd = (fdToHandle fd) `Ex.onException` (c__close fd) +- +-# if defined (__IO_MANAGER_WINIO__) +-runWithPipesNative :: (CreateProcess -> IO ProcessHandle) +- -> FilePath -> [String] -> IO (ProcessHandle, Handle, Handle) +-runWithPipesNative createProc prog opts = do +- (rh, wfd1) <- createPipe -- we read on rfd1 +- (rfd2, wh) <- createPipe -- we write on wfd2 +- wh_client <- handleToHANDLE wfd1 +- rh_client <- handleToHANDLE rfd2 +- -- Associate the handle with the current manager +- -- but don't touch the ones we're passing to the child +- -- since it needs to register the handle with its own manager. +- associateHandle' =<< handleToHANDLE rh +- associateHandle' =<< handleToHANDLE wh +- let args = show wh_client : show rh_client : opts +- ph <- createProc (proc prog args) +- return (ph, rh, wh) +- +-runWithPipes = runWithPipesPOSIX runWithPipesNative +-# else +-runWithPipes = runWithPipesPOSIX +-# endif +-#else +-runWithPipes createProc prog opts = do +- (rfd1, wfd1) <- Posix.createPipe -- we read on rfd1 +- (rfd2, wfd2) <- Posix.createPipe -- we write on wfd2 +- setFdOption rfd1 CloseOnExec True +- setFdOption wfd2 CloseOnExec True +- let args = show wfd1 : show rfd2 : opts +- ph <- createProc (proc prog args) +- closeFd wfd1 +- closeFd rfd2 +- rh <- fdToHandle rfd1 +- wh <- fdToHandle wfd2 +- return (ph, rh, wh) +-#endif ++ else sendMessage i Shutdown ++ pure InterpPending + + -- ----------------------------------------------------------------------------- + {- Note [External GHCi pointers] +@@ -680,10 +620,10 @@ we cannot use this to refer to things in the external process. + RemoteRef + --------- + +-RemoteRef is a StablePtr to a heap-resident value. When +--fexternal-interpreter is used, this value resides in the external +-process's heap. RemoteRefs are mostly used to send pointers in +-messages between GHC and iserv. ++RemoteRef is a StablePtr to a heap-resident value. When -fexternal-interpreter ++or the JS interpreter is used, this value resides in the external process's ++heap. RemoteRefs are mostly used to send pointers in messages between GHC and ++iserv. + + A RemoteRef must be explicitly freed when no longer required, using + freeHValueRefs, or by attaching a finalizer with mkForeignHValue. +@@ -709,20 +649,18 @@ principle it would probably be ok, but it seems less hairy this way. + -- 'RemoteRef' when it is no longer referenced. + mkFinalizedHValue :: Interp -> RemoteRef a -> IO (ForeignRef a) + mkFinalizedHValue interp rref = do +- let hvref = toHValueRef rref +- +- free <- case interpInstance interp of ++ case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) +- InternalInterp -> return (freeRemoteRef hvref) ++ InternalInterp -> mkForeignRef rref (freeRemoteRef rref) + #endif +- ExternalInterp _ (IServ i) -> return $ modifyMVar_ i $ \state -> +- case state of +- IServPending {} -> pure state -- already shut down +- IServRunning inst -> do +- let !inst' = inst {iservPendingFrees = hvref:iservPendingFrees inst} +- pure (IServRunning inst') ++ ExternalInterp ext -> withExtInterpMaybe ext $ \case ++ Nothing -> mkForeignRef rref (pure ()) -- nothing to do, interpreter already stopped ++ Just inst -> mkForeignRef rref (freeReallyRemoteRef inst rref) + +- mkForeignRef rref free ++freeReallyRemoteRef :: ExtInterpInstance d -> RemoteRef a -> IO () ++freeReallyRemoteRef inst rref = ++ -- add to the list of HValues to free ++ modifyMVar_ (instPendingFrees inst) (\xs -> pure (castRemoteRef rref : xs)) + + + freeHValueRefs :: Interp -> [HValueRef] -> IO () +@@ -772,7 +710,9 @@ interpreterProfiled interp = case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) + InternalInterp -> hostIsProfiled + #endif +- ExternalInterp c _ -> iservConfProfiled c ++ ExternalInterp ext -> case ext of ++ ExtIServ i -> iservConfProfiled (interpConfig i) ++ ExtJS {} -> False -- we don't support profiling yet in the JS backend + + -- | Interpreter uses Dynamic way + interpreterDynamic :: Interp -> Bool +@@ -780,4 +720,6 @@ interpreterDynamic interp = case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) + InternalInterp -> hostIsDynamic + #endif +- ExternalInterp c _ -> iservConfDynamic c ++ ExternalInterp ext -> case ext of ++ ExtIServ i -> iservConfDynamic (interpConfig i) ++ ExtJS {} -> False -- dynamic doesn't make sense for JS +diff --git a/compiler/GHC/Runtime/Interpreter/JS.hs b/compiler/GHC/Runtime/Interpreter/JS.hs +new file mode 100644 +index 0000000000..2016eb4458 +--- /dev/null ++++ b/compiler/GHC/Runtime/Interpreter/JS.hs +@@ -0,0 +1,391 @@ ++{-# LANGUAGE GADTs #-} ++{-# LANGUAGE TupleSections #-} ++{-# LANGUAGE BlockArguments #-} ++{-# LANGUAGE LambdaCase #-} ++ ++-- | JavaScript interpreter ++-- ++-- The JS interpreter works as follows: ++-- ++-- ghc-interp.js is a simple JS script used to bootstrap the external ++-- interpreter server (iserv) that is written in Haskell. This script waits for ++-- commands on stdin: ++-- LOAD foo.js -- load a JS file in the current JS environment ++-- RUN_SERVER -- execute h$main(h$ghciZCGHCiziServerzidefaultServer) ++-- (entry point of the interpreter server) ++-- ++-- On the GHC side, when we need the interpreter we do the following: ++-- ++-- 1. spawn nodejs with $topdir/ghc-interp.js script ++-- 2. link the JS rts and send a LOAD command to load it ++-- 3. link iserv (i.e. use GHCi.Server.defaultServer as root) and LOAD it ++-- 4. send a RUN_SERVER command to execute the JS iserv ++-- ++-- From this moment on, everything happens as with the native iserv, using a ++-- pipe for communication, with the following differences: ++-- ++-- - the JS iserv only supports the LoadObj linking command which has been ++-- repurposed to load a JS source file. The JS iserv doesn't deal with ++-- libraries (.a) and with object files (.o). The linker state is maintained on ++-- the GHC side and GHC only sends the appropriate chunks of JS code to link. ++-- ++-- - the JS iserv doesn't support ByteCode (i.e. it doesn't support CreateBCOs ++-- messages). JS iserv clients should use the usual JS compilation pipeline and ++-- send JS code instead. See GHC.Driver.Main.hscCompileCoreExpr for an example. ++-- ++-- GHC keeps track of JS blocks (JS unit of linking corresponding to top-level ++-- binding groups) that have already been linked by the JS interpreter. It only ++-- links new ones when necessary, using the JS linker incremental link plan ++-- feature. ++-- ++-- Note that the JS interpreter isn't subject to staging issues: we can use it ++-- in a Stage1 GHC. ++-- ++module GHC.Runtime.Interpreter.JS ++ ( spawnJSInterp ++ , jsLinkRts ++ , jsLinkInterp ++ , jsLinkObject ++ , jsLinkObjects ++ , jsLoadFile ++ , jsRunServer ++ -- * Reexported for convenience ++ , mkExportedModFuns ++ ) ++where ++ ++import GHC.Prelude ++import GHC.Runtime.Interpreter.Types ++import GHC.Runtime.Interpreter.Process ++import GHC.Runtime.Utils ++import GHCi.Message ++ ++import GHC.StgToJS.Linker.Types ++import GHC.StgToJS.Linker.Linker ++import GHC.StgToJS.Types ++import GHC.StgToJS.Object ++ ++import GHC.Unit.Env ++import GHC.Unit.Types ++import GHC.Unit.State ++ ++import GHC.Utils.Logger ++import GHC.Utils.TmpFs ++import GHC.Utils.Panic ++import GHC.Utils.Error (logInfo) ++import GHC.Utils.Outputable (text) ++import GHC.Data.FastString ++import GHC.Types.Unique.FM ++ ++import Control.Concurrent ++import Control.Monad ++ ++import System.Process ++import System.IO ++import System.FilePath ++ ++import Data.IORef ++import qualified Data.Set as Set ++import qualified Data.ByteString as B ++ ++import Foreign.C.String ++ ++--------------------------------------------------------- ++-- Running node ++--------------------------------------------------------- ++ ++-- | Start NodeJS interactively with "ghc-interp.js" script loaded in ++startTHRunnerProcess :: FilePath -> NodeJsSettings -> IO (Handle,InterpProcess) ++startTHRunnerProcess interp_js settings = do ++ interp_in <- newIORef undefined ++ ++ let createProc cp = do ++ let cp' = cp ++ { std_in = CreatePipe ++ , std_out = Inherit ++ , std_err = Inherit ++ } ++ (mb_in, _mb_out, _mb_err, hdl) <- createProcess cp' ++ -- we can't directly return stdin for the process given the current ++ -- implementation of runWithPipes. So we just use an IORef for this... ++ case mb_in of ++ Nothing -> panic "startTHRunnerProcess: expected stdin for interpreter" ++ Just i -> writeIORef interp_in i ++ return hdl ++ ++ (hdl, rh, wh) <- runWithPipes createProc (nodeProgram settings) ++ [interp_js] ++ (nodeExtraArgs settings) ++ std_in <- readIORef interp_in ++ ++ lo_ref <- newIORef Nothing ++ let pipe = Pipe { pipeRead = rh, pipeWrite = wh, pipeLeftovers = lo_ref } ++ let proc = InterpProcess ++ { interpHandle = hdl ++ , interpPipe = pipe ++ } ++ pure (std_in, proc) ++ ++-- | Spawn a JS interpreter ++-- ++-- Run NodeJS with "ghc-interp.js" loaded in. Then load GHCi.Server and its deps ++-- (including the rts) and run GHCi.Server.defaultServer. ++spawnJSInterp :: JSInterpConfig -> IO (ExtInterpInstance JSInterpExtra) ++spawnJSInterp cfg = do ++ let logger= jsInterpLogger cfg ++ when (logVerbAtLeast logger 2) $ ++ logInfo logger (text "Spawning JS interpreter") ++ ++ let tmpfs = jsInterpTmpFs cfg ++ tmp_dir = jsInterpTmpDir cfg ++ logger = jsInterpLogger cfg ++ codegen_cfg = jsInterpCodegenCfg cfg ++ unit_env = jsInterpUnitEnv cfg ++ finder_opts = jsInterpFinderOpts cfg ++ finder_cache = jsInterpFinderCache cfg ++ ++ (std_in, proc) <- startTHRunnerProcess (jsInterpScript cfg) (jsInterpNodeConfig cfg) ++ ++ js_state <- newMVar (JSState ++ { jsLinkState = emptyLinkPlan ++ , jsServerStarted = False ++ }) ++ ++ -- get the unit-id of the ghci package. We need this to load the ++ -- interpreter code. ++ ghci_unit_id <- case lookupPackageName (ue_units unit_env) (PackageName (fsLit "ghci")) of ++ Nothing -> cmdLineErrorIO "JS interpreter: couldn't find \"ghci\" package" ++ Just i -> pure i ++ ++ let extra = JSInterpExtra ++ { instStdIn = std_in ++ , instJSState = js_state ++ , instFinderCache = finder_cache ++ , instFinderOpts = finder_opts ++ , instGhciUnitId = ghci_unit_id ++ } ++ ++ pending_frees <- newMVar [] ++ lookup_cache <- newMVar emptyUFM ++ let inst = ExtInterpInstance ++ { instProcess = proc ++ , instPendingFrees = pending_frees ++ , instLookupSymbolCache = lookup_cache ++ , instExtra = extra ++ } ++ ++ -- link rts and its deps ++ jsLinkRts logger tmpfs tmp_dir codegen_cfg unit_env inst ++ ++ -- link interpreter and its deps ++ jsLinkInterp logger tmpfs tmp_dir codegen_cfg unit_env inst ++ ++ -- run interpreter main loop ++ jsRunServer inst ++ ++ pure inst ++ ++ ++ ++--------------------------------------------------------- ++-- Interpreter commands ++--------------------------------------------------------- ++ ++-- | Link JS RTS ++jsLinkRts :: Logger -> TmpFs -> TempDir -> StgToJSConfig -> UnitEnv -> ExtInterpInstance JSInterpExtra -> IO () ++jsLinkRts logger tmpfs tmp_dir cfg unit_env inst = do ++ let link_cfg = JSLinkConfig ++ { lcNoStats = True -- we don't need the stats ++ , lcNoRts = False -- we need the RTS ++ , lcCombineAll = False -- we don't need the combined all.js, we'll link each part independently below ++ , lcForeignRefs = False -- we don't need foreign references ++ , lcNoJSExecutables = True -- we don't need executables ++ , lcNoHsMain = True -- nor HsMain ++ } ++ ++ -- link the RTS and its dependencies (things it uses from `base`, etc.) ++ let link_spec = LinkSpec ++ { lks_unit_ids = [rtsUnitId, baseUnitId, primUnitId] ++ , lks_obj_files = mempty ++ , lks_obj_root_filter = const False ++ , lks_extra_roots = mempty ++ , lks_extra_js = mempty ++ } ++ ++ let finder_opts = instFinderOpts (instExtra inst) ++ finder_cache = instFinderCache (instExtra inst) ++ ++ link_plan <- computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache ++ jsLinkPlan logger tmpfs tmp_dir link_cfg cfg inst link_plan ++ ++-- | Link JS interpreter ++jsLinkInterp :: Logger -> TmpFs -> TempDir -> StgToJSConfig -> UnitEnv -> ExtInterpInstance JSInterpExtra -> IO () ++jsLinkInterp logger tmpfs tmp_dir cfg unit_env inst = do ++ ++ let link_cfg = JSLinkConfig ++ { lcNoStats = True -- we don't need the stats ++ , lcNoRts = True -- we don't need the RTS ++ , lcCombineAll = False -- we don't need the combined all.js, we'll link each part independently below ++ , lcForeignRefs = False -- we don't need foreign references ++ , lcNoJSExecutables = True -- we don't need executables ++ , lcNoHsMain = True -- nor HsMain ++ } ++ ++ let is_root _ = True -- FIXME: we shouldn't consider every function as a root ++ ++ let ghci_unit_id = instGhciUnitId (instExtra inst) ++ ++ -- compute unit dependencies of ghc_unit_id ++ let unit_map = unitInfoMap (ue_units unit_env) ++ dep_units <- mayThrowUnitErr $ closeUnitDeps unit_map [(ghci_unit_id,Nothing)] ++ let units = dep_units ++ [ghci_unit_id] ++ ++ -- indicate that our root function is GHCi.Server.defaultServer ++ let root_deps = Set.fromList $ mkExportedFuns ghci_unit_id (fsLit "GHCi.Server") [fsLit "defaultServer"] ++ ++ -- link the interpreter and its dependencies ++ let link_spec = LinkSpec ++ { lks_unit_ids = units ++ , lks_obj_files = mempty ++ , lks_obj_root_filter = is_root ++ , lks_extra_roots = root_deps ++ , lks_extra_js = mempty ++ } ++ ++ let finder_cache = instFinderCache (instExtra inst) ++ finder_opts = instFinderOpts (instExtra inst) ++ ++ link_plan <- computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache ++ ++ jsLinkPlan logger tmpfs tmp_dir link_cfg cfg inst link_plan ++ ++ ++-- | Link object files ++jsLinkObjects :: Logger -> TmpFs -> TempDir -> StgToJSConfig -> UnitEnv -> ExtInterpInstance JSInterpExtra -> [FilePath] -> (ExportedFun -> Bool) -> IO () ++jsLinkObjects logger tmpfs tmp_dir cfg unit_env inst objs is_root = do ++ let link_cfg = JSLinkConfig ++ { lcNoStats = True -- we don't need the stats ++ , lcNoRts = True -- we don't need the RTS (already linked) ++ , lcCombineAll = False -- we don't need the combined all.js, we'll link each part independently below ++ , lcForeignRefs = False -- we don't need foreign references ++ , lcNoJSExecutables = True -- we don't need executables ++ , lcNoHsMain = True -- nor HsMain ++ } ++ ++ let units = preloadUnits (ue_units unit_env) ++ ++ [thUnitId] -- don't forget TH which is an implicit dep ++ ++ -- compute dependencies ++ let link_spec = LinkSpec ++ { lks_unit_ids = units ++ , lks_obj_files = fmap ObjFile objs ++ , lks_obj_root_filter = is_root ++ , lks_extra_roots = mempty ++ , lks_extra_js = mempty ++ } ++ ++ let finder_opts = instFinderOpts (instExtra inst) ++ finder_cache = instFinderCache (instExtra inst) ++ ++ link_plan <- computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache ++ ++ -- link ++ jsLinkPlan logger tmpfs tmp_dir link_cfg cfg inst link_plan ++ ++ ++ ++-- | Link an object file using the given functions as roots ++jsLinkObject :: Logger -> TmpFs -> TempDir -> StgToJSConfig -> UnitEnv -> ExtInterpInstance JSInterpExtra -> FilePath -> [ExportedFun] -> IO () ++jsLinkObject logger tmpfs tmp_dir cfg unit_env inst obj roots = do ++ let is_root f = Set.member f (Set.fromList roots) ++ let objs = [obj] ++ jsLinkObjects logger tmpfs tmp_dir cfg unit_env inst objs is_root ++ ++ ++-- | Link the given link plan ++-- ++-- Perform incremental linking by removing what is already linked from the plan ++jsLinkPlan :: Logger -> TmpFs -> TempDir -> JSLinkConfig -> StgToJSConfig -> ExtInterpInstance JSInterpExtra -> LinkPlan -> IO () ++jsLinkPlan logger tmpfs tmp_dir link_cfg cfg inst link_plan = do ++ ---------------------------------------------------------------- ++ -- Get already linked stuff and compute incremental plan ++ ---------------------------------------------------------------- ++ ++ old_plan <- jsLinkState <$> readMVar (instJSState (instExtra inst)) ++ ++ -- compute new plan discarding what's already linked ++ let (diff_plan, total_plan) = incrementLinkPlan old_plan link_plan ++ ++ ---------------------------------------------------------------- ++ -- Generate JS code for the incremental plan ++ ---------------------------------------------------------------- ++ ++ tmp_out <- newTempSubDir logger tmpfs tmp_dir ++ void $ jsLink link_cfg cfg logger tmp_out diff_plan ++ ++ -- Code has been linked into the following files: ++ -- - generated rts from tmp_out/rts.js (depends on link options) ++ -- - raw js files from tmp_out/lib.js ++ -- - Haskell generated JS from tmp_out/out.js ++ ++ -- We need to combine at least rts.js and lib.js for the RTS because they ++ -- depend on each other. We might as well combine them all, so that's what we ++ -- do. ++ let filenames ++ | lcNoRts link_cfg = ["lib.js", "out.js"] ++ | otherwise = ["rts.js", "lib.js", "out.js"] ++ let files = map (tmp_out ) filenames ++ let all_js = tmp_out "all.js" ++ let all_files = all_js : files ++ withBinaryFile all_js WriteMode $ \h -> do ++ let cpy i = B.readFile i >>= B.hPut h ++ mapM_ cpy files ++ ++ -- add files to clean ++ addFilesToClean tmpfs TFL_CurrentModule all_files ++ ++ ---------------------------------------------------------------- ++ -- Link JS code ++ ---------------------------------------------------------------- ++ ++ -- linking JS code depends on the phase we're in: ++ -- - during in the initialization phase, we send a LoadFile message to the ++ -- JS server; ++ -- - once the Haskell server is started, we send a LoadObj message to the ++ -- Haskell server. ++ server_started <- jsServerStarted <$> readMVar (instJSState (instExtra inst)) ++ if server_started ++ then sendMessageNoResponse inst $ LoadObj all_js ++ else jsLoadFile inst all_js ++ ++ ---------------------------------------------------------------- ++ -- update linker state ++ ---------------------------------------------------------------- ++ modifyMVar_ (instJSState (instExtra inst)) $ \state -> pure state { jsLinkState = total_plan } ++ ++ ++-- | Send a command to the JS interpreter ++jsSendCommand :: ExtInterpInstance JSInterpExtra -> String -> IO () ++jsSendCommand inst cmd = send_cmd cmd ++ where ++ extra = instExtra inst ++ handle = instStdIn extra ++ send_cmd s = do ++ withCStringLen s \(p,n) -> hPutBuf handle p n ++ hFlush handle ++ ++-- | Load a JS file in the interpreter ++jsLoadFile :: ExtInterpInstance JSInterpExtra -> FilePath -> IO () ++jsLoadFile inst path = jsSendCommand inst ("LOAD " ++ path ++ "\n") ++ ++-- | Run JS server ++jsRunServer :: ExtInterpInstance JSInterpExtra -> IO () ++jsRunServer inst = do ++ let ghci_unit_id = instGhciUnitId (instExtra inst) ++ let zghci_unit_id = zString (zEncodeFS (unitIdFS ghci_unit_id)) ++ ++ -- Run `GHCi.Server.defaultServer` ++ jsSendCommand inst ("RUN_SERVER " ++ zghci_unit_id ++ "\n") ++ ++ -- indicate that the Haskell server is now started ++ modifyMVar_ (instJSState (instExtra inst)) $ \state -> pure state { jsServerStarted = True } +diff --git a/compiler/GHC/Runtime/Interpreter/Process.hs b/compiler/GHC/Runtime/Interpreter/Process.hs +new file mode 100644 +index 0000000000..a93d00d7bc +--- /dev/null ++++ b/compiler/GHC/Runtime/Interpreter/Process.hs +@@ -0,0 +1,102 @@ ++module GHC.Runtime.Interpreter.Process ++ ( ++ -- * Low-level API ++ callInterpProcess ++ , readInterpProcess ++ , writeInterpProcess ++ ++ -- * Message API ++ , Message(..) ++ , DelayedResponse (..) ++ , sendMessage ++ , sendMessageNoResponse ++ , sendMessageDelayedResponse ++ , sendAnyValue ++ , receiveAnyValue ++ , receiveDelayedResponse ++ , receiveTHMessage ++ ++ ) ++where ++ ++import GHC.Prelude ++ ++import GHC.Runtime.Interpreter.Types ++import GHCi.Message ++ ++import GHC.IO (catchException) ++import GHC.Utils.Panic ++import GHC.Utils.Exception as Ex ++ ++import Data.Binary ++import System.Exit ++import System.Process ++ ++data DelayedResponse a = DelayedResponse ++ ++-- | Send a message to the interpreter process that doesn't expect a response ++sendMessageNoResponse :: ExtInterpInstance d -> Message () -> IO () ++sendMessageNoResponse i m = writeInterpProcess (instProcess i) (putMessage m) ++ ++-- | Send a message to the interpreter that excepts a response ++sendMessage :: Binary a => ExtInterpInstance d -> Message a -> IO a ++sendMessage i m = callInterpProcess (instProcess i) m ++ ++-- | Send a message to the interpreter process whose response is expected later ++-- ++-- This is useful to avoid forgetting to receive the value and to ensure that ++-- the type of the response isn't lost. Use receiveDelayedResponse to read it. ++sendMessageDelayedResponse :: ExtInterpInstance d -> Message a -> IO (DelayedResponse a) ++sendMessageDelayedResponse i m = do ++ writeInterpProcess (instProcess i) (putMessage m) ++ pure DelayedResponse ++ ++-- | Send any value ++sendAnyValue :: Binary a => ExtInterpInstance d -> a -> IO () ++sendAnyValue i m = writeInterpProcess (instProcess i) (put m) ++ ++-- | Expect a value to be received ++receiveAnyValue :: ExtInterpInstance d -> Get a -> IO a ++receiveAnyValue i get = readInterpProcess (instProcess i) get ++ ++-- | Expect a delayed result to be received now ++receiveDelayedResponse :: Binary a => ExtInterpInstance d -> DelayedResponse a -> IO a ++receiveDelayedResponse i DelayedResponse = readInterpProcess (instProcess i) get ++ ++-- | Expect a value to be received ++receiveTHMessage :: ExtInterpInstance d -> IO THMsg ++receiveTHMessage i = receiveAnyValue i getTHMessage ++ ++ ++-- ----------------------------------------------------------------------------- ++-- Low-level API ++ ++-- | Send a 'Message' and receive the response from the interpreter process ++callInterpProcess :: Binary a => InterpProcess -> Message a -> IO a ++callInterpProcess i msg = ++ remoteCall (interpPipe i) msg ++ `catchException` \(e :: SomeException) -> handleInterpProcessFailure i e ++ ++-- | Read a value from the interpreter process ++readInterpProcess :: InterpProcess -> Get a -> IO a ++readInterpProcess i get = ++ readPipe (interpPipe i) get ++ `catchException` \(e :: SomeException) -> handleInterpProcessFailure i e ++ ++-- | Send a value to the interpreter process ++writeInterpProcess :: InterpProcess -> Put -> IO () ++writeInterpProcess i put = ++ writePipe (interpPipe i) put ++ `catchException` \(e :: SomeException) -> handleInterpProcessFailure i e ++ ++handleInterpProcessFailure :: InterpProcess -> SomeException -> IO a ++handleInterpProcessFailure i e = do ++ let hdl = interpHandle i ++ ex <- getProcessExitCode hdl ++ case ex of ++ Just (ExitFailure n) -> ++ throwIO (InstallationError ("External interpreter terminated (" ++ show n ++ ")")) ++ _ -> do ++ terminateProcess hdl ++ _ <- waitForProcess hdl ++ throw e +diff --git a/compiler/GHC/Runtime/Interpreter/Types.hs b/compiler/GHC/Runtime/Interpreter/Types.hs +index e1b33198d0..962c21491f 100644 +--- a/compiler/GHC/Runtime/Interpreter/Types.hs ++++ b/compiler/GHC/Runtime/Interpreter/Types.hs +@@ -4,10 +4,22 @@ + module GHC.Runtime.Interpreter.Types + ( Interp(..) + , InterpInstance(..) +- , IServ(..) +- , IServInstance(..) ++ , InterpProcess (..) ++ , ExtInterp (..) ++ , ExtInterpStatusVar ++ , ExtInterpInstance (..) ++ , ExtInterpState (..) ++ , InterpStatus(..) ++ -- * IServ ++ , IServ + , IServConfig(..) +- , IServState(..) ++ -- * JSInterp ++ , JSInterp ++ , JSInterpExtra (..) ++ , JSInterpConfig (..) ++ , JSState (..) ++ , NodeJsSettings (..) ++ , defaultNodeJsSettings + ) + where + +@@ -20,8 +32,17 @@ import GHC.Types.Unique.FM + import GHC.Data.FastString ( FastString ) + import Foreign + ++import GHC.Utils.TmpFs ++import GHC.Utils.Logger ++import GHC.Unit.Env ++import GHC.Unit.Types ++import GHC.StgToJS.Types ++import GHC.StgToJS.Linker.Types ++ + import Control.Concurrent + import System.Process ( ProcessHandle, CreateProcess ) ++import System.IO ++import GHC.Unit.Finder.Types (FinderCache, FinderOpts) + + -- | Interpreter + data Interp = Interp +@@ -32,24 +53,40 @@ data Interp = Interp + -- ^ Interpreter loader + } + +- + data InterpInstance +- = ExternalInterp !IServConfig !IServ -- ^ External interpreter ++ = ExternalInterp !ExtInterp -- ^ External interpreter + #if defined(HAVE_INTERNAL_INTERPRETER) +- | InternalInterp -- ^ Internal interpreter ++ | InternalInterp -- ^ Internal interpreter + #endif + ++data ExtInterp ++ = ExtIServ !IServ ++ | ExtJS !JSInterp ++ + -- | External interpreter + -- + -- The external interpreter is spawned lazily (on first use) to avoid slowing + -- down sessions that don't require it. The contents of the MVar reflects the + -- state of the interpreter (running or not). +-newtype IServ = IServ (MVar IServState) ++data ExtInterpState cfg details = ExtInterpState ++ { interpConfig :: !cfg ++ , interpStatus :: !(ExtInterpStatusVar details) ++ } ++ ++type ExtInterpStatusVar d = MVar (InterpStatus (ExtInterpInstance d)) ++ ++type IServ = ExtInterpState IServConfig () ++type JSInterp = ExtInterpState JSInterpConfig JSInterpExtra + +--- | State of an external interpreter +-data IServState +- = IServPending -- ^ Not spawned yet +- | IServRunning !IServInstance -- ^ Running ++data InterpProcess = InterpProcess ++ { interpPipe :: !Pipe -- ^ Pipe to communicate with the server ++ , interpHandle :: !ProcessHandle -- ^ Process handle of the server ++ } ++ ++-- | Status of an external interpreter ++data InterpStatus inst ++ = InterpPending -- ^ Not spawned yet ++ | InterpRunning !inst -- ^ Running + + -- | Configuration needed to spawn an external interpreter + data IServConfig = IServConfig +@@ -61,14 +98,66 @@ data IServConfig = IServConfig + , iservConfTrace :: IO () -- ^ Trace action executed after spawn + } + +--- | External interpreter instance +-data IServInstance = IServInstance +- { iservPipe :: !Pipe +- , iservProcess :: !ProcessHandle +- , iservLookupSymbolCache :: !(UniqFM FastString (Ptr ())) +- , iservPendingFrees :: ![HValueRef] ++-- | Common field between native external interpreter and the JS one ++data ExtInterpInstance c = ExtInterpInstance ++ { instProcess :: {-# UNPACK #-} !InterpProcess ++ -- ^ External interpreter process and its pipe (communication channel) ++ ++ , instPendingFrees :: !(MVar [HValueRef]) + -- ^ Values that need to be freed before the next command is sent. +- -- Threads can append values to this list asynchronously (by modifying the +- -- IServ state MVar). ++ -- Finalizers for ForeignRefs can append values to this list ++ -- asynchronously. ++ ++ , instLookupSymbolCache :: !(MVar (UniqFM FastString (Ptr ()))) ++ -- ^ LookupSymbol cache ++ ++ , instExtra :: !c ++ -- ^ Instance specific extra fields ++ } ++ ++------------------------ ++-- JS Stuff ++------------------------ ++ ++data JSInterpExtra = JSInterpExtra ++ { instStdIn :: !Handle -- ^ Stdin for the process ++ , instFinderCache :: !FinderCache ++ , instFinderOpts :: !FinderOpts ++ , instJSState :: !(MVar JSState) -- ^ Mutable state ++ , instGhciUnitId :: !UnitId -- ^ GHCi unit-id ++ } ++ ++data JSState = JSState ++ { jsLinkState :: !LinkPlan -- ^ Linker state of the interpreter ++ , jsServerStarted :: !Bool -- ^ Is the Haskell server started? ++ } ++ ++-- | NodeJs configuration ++data NodeJsSettings = NodeJsSettings ++ { nodeProgram :: FilePath -- ^ location of node.js program ++ , nodePath :: Maybe FilePath -- ^ value of NODE_PATH environment variable (search path for Node modules; GHCJS used to provide some) ++ , nodeExtraArgs :: [String] -- ^ extra arguments to pass to node.js ++ , nodeKeepAliveMaxMem :: Integer -- ^ keep node.js (TH, GHCJSi) processes alive if they don't use more than this ++ } ++ ++defaultNodeJsSettings :: NodeJsSettings ++defaultNodeJsSettings = NodeJsSettings ++ { nodeProgram = "node" ++ , nodePath = Nothing ++ , nodeExtraArgs = [] ++ , nodeKeepAliveMaxMem = 536870912 ++ } ++ ++ ++data JSInterpConfig = JSInterpConfig ++ { jsInterpNodeConfig :: !NodeJsSettings -- ^ NodeJS settings ++ , jsInterpScript :: !FilePath -- ^ Path to "ghc-interp.js" script ++ , jsInterpTmpFs :: !TmpFs ++ , jsInterpTmpDir :: !TempDir ++ , jsInterpLogger :: !Logger ++ , jsInterpCodegenCfg :: !StgToJSConfig ++ , jsInterpUnitEnv :: !UnitEnv ++ , jsInterpFinderOpts :: !FinderOpts ++ , jsInterpFinderCache :: !FinderCache + } + +diff --git a/compiler/GHC/Runtime/Utils.hs b/compiler/GHC/Runtime/Utils.hs +new file mode 100644 +index 0000000000..083d592990 +--- /dev/null ++++ b/compiler/GHC/Runtime/Utils.hs +@@ -0,0 +1,84 @@ ++{-# LANGUAGE CPP #-} ++ ++module GHC.Runtime.Utils ++ ( runWithPipes ++ ) ++where ++ ++import GHC.Prelude ++ ++#if defined(mingw32_HOST_OS) ++import Foreign.C ++import GHC.IO.Handle.FD (fdToHandle) ++import GHC.Utils.Exception as Ex ++# if defined(__IO_MANAGER_WINIO__) ++import GHC.IO.SubSystem (()) ++import GHC.IO.Handle.Windows (handleToHANDLE) ++import GHC.Event.Windows (associateHandle') ++# endif ++#else ++import System.Posix as Posix ++#endif ++import System.Process ++import System.IO ++ ++runWithPipes :: (CreateProcess -> IO ProcessHandle) ++ -> FilePath -> [String] -> [String] -> IO (ProcessHandle, Handle, Handle) ++#if defined(mingw32_HOST_OS) ++foreign import ccall "io.h _close" ++ c__close :: CInt -> IO CInt ++ ++foreign import ccall unsafe "io.h _get_osfhandle" ++ _get_osfhandle :: CInt -> IO CInt ++ ++runWithPipesPOSIX :: (CreateProcess -> IO ProcessHandle) ++ -> FilePath -> [String] -> [String] -> IO (ProcessHandle, Handle, Handle) ++runWithPipesPOSIX createProc prog pre_opts opts = do ++ (rfd1, wfd1) <- createPipeFd -- we read on rfd1 ++ (rfd2, wfd2) <- createPipeFd -- we write on wfd2 ++ wh_client <- _get_osfhandle wfd1 ++ rh_client <- _get_osfhandle rfd2 ++ let args = pre_opts ++ (show wh_client : show rh_client : opts) ++ ph <- createProc (proc prog args) ++ rh <- mkHandle rfd1 ++ wh <- mkHandle wfd2 ++ return (ph, rh, wh) ++ where mkHandle :: CInt -> IO Handle ++ mkHandle fd = (fdToHandle fd) `Ex.onException` (c__close fd) ++ ++# if defined (__IO_MANAGER_WINIO__) ++runWithPipesNative :: (CreateProcess -> IO ProcessHandle) ++ -> FilePath -> [String] -> [String] -> IO (ProcessHandle, Handle, Handle) ++runWithPipesNative createProc prog pre_opts opts = do ++ (rh, wfd1) <- createPipe -- we read on rfd1 ++ (rfd2, wh) <- createPipe -- we write on wfd2 ++ wh_client <- handleToHANDLE wfd1 ++ rh_client <- handleToHANDLE rfd2 ++ -- Associate the handle with the current manager ++ -- but don't touch the ones we're passing to the child ++ -- since it needs to register the handle with its own manager. ++ associateHandle' =<< handleToHANDLE rh ++ associateHandle' =<< handleToHANDLE wh ++ let args = pre_opts ++ (show wh_client : show rh_client : opts) ++ ph <- createProc (proc prog args) ++ return (ph, rh, wh) ++ ++runWithPipes = runWithPipesPOSIX runWithPipesNative ++# else ++runWithPipes = runWithPipesPOSIX ++# endif ++#else ++runWithPipes createProc prog pre_opts opts = do ++ (rfd1, wfd1) <- Posix.createPipe -- we read on rfd1 ++ (rfd2, wfd2) <- Posix.createPipe -- we write on wfd2 ++ setFdOption rfd1 CloseOnExec True ++ setFdOption wfd2 CloseOnExec True ++ let args = pre_opts ++ (show wfd1 : show rfd2 : opts) ++ ph <- createProc (proc prog args) ++ closeFd wfd1 ++ closeFd rfd2 ++ rh <- fdToHandle rfd1 ++ wh <- fdToHandle wfd2 ++ return (ph, rh, wh) ++#endif ++ +diff --git a/compiler/GHC/StgToJS/CodeGen.hs b/compiler/GHC/StgToJS/CodeGen.hs +index 7703398aea..9bf0f7e0ec 100644 +--- a/compiler/GHC/StgToJS/CodeGen.hs ++++ b/compiler/GHC/StgToJS/CodeGen.hs +@@ -90,11 +90,11 @@ stgToJS logger config stg_binds0 this_mod spt_entries foreign_stubs cccs output_ + -- Doc to dump when -ddump-js is enabled + when (logHasDumpFlag logger Opt_D_dump_js) $ do + putDumpFileMaybe logger Opt_D_dump_js "JavaScript code" FormatJS +- $ vcat (fmap (docToSDoc . jsToDoc . oiStat . luObjUnit) lus) ++ $ vcat (fmap (docToSDoc . jsToDoc . oiStat . luObjBlock) lus) + + -- Write the object file + bh <- openBinMem (4 * 1024 * 1000) -- a bit less than 4kB +- Object.putObject bh (moduleName this_mod) deps (map luObjUnit lus) ++ Object.putObject bh (moduleName this_mod) deps (map luObjBlock lus) + + createDirectoryIfMissing True (takeDirectory output_fn) + writeBinMem bh output_fn +@@ -137,7 +137,7 @@ genUnits m ss spt_entries foreign_stubs = do + jsSaturate (Just $ modulePrefix m 1) + $ mconcat (reverse glbl) <> staticInit) + let syms = [moduleGlobalSymbol m] +- let oi = ObjUnit ++ let oi = ObjBlock + { oiSymbols = syms + , oiClInfo = [] + , oiStatic = [] +@@ -147,7 +147,7 @@ genUnits m ss spt_entries foreign_stubs = do + , oiFImports = [] + } + let lu = LinkableUnit +- { luObjUnit = oi ++ { luObjBlock = oi + , luIdExports = [] + , luOtherExports = syms + , luIdDeps = [] +@@ -169,7 +169,7 @@ genUnits m ss spt_entries foreign_stubs = do + + let syms = [moduleExportsSymbol m] + let raw = utf8EncodeByteString $ renderWithContext defaultSDocContext f_c +- let oi = ObjUnit ++ let oi = ObjBlock + { oiSymbols = syms + , oiClInfo = [] + , oiStatic = [] +@@ -179,7 +179,7 @@ genUnits m ss spt_entries foreign_stubs = do + , oiFImports = [] + } + let lu = LinkableUnit +- { luObjUnit = oi ++ { luObjBlock = oi + , luIdExports = [] + , luOtherExports = syms + , luIdDeps = [] +@@ -210,7 +210,7 @@ genUnits m ss spt_entries foreign_stubs = do + let stat = jsSaturate (Just $ modulePrefix m n) body + let ids = [bnd] + syms <- (\(TxtI i) -> [i]) <$> identForId bnd +- let oi = ObjUnit ++ let oi = ObjBlock + { oiSymbols = syms + , oiClInfo = [] + , oiStatic = si +@@ -220,7 +220,7 @@ genUnits m ss spt_entries foreign_stubs = do + , oiFImports = [] + } + let lu = LinkableUnit +- { luObjUnit = oi ++ { luObjBlock = oi + , luIdExports = ids + , luOtherExports = [] + , luIdDeps = [] +@@ -248,7 +248,7 @@ genUnits m ss spt_entries foreign_stubs = do + jsSaturate (Just $ modulePrefix m n) + $ mconcat (reverse extraTl) <> tl + syms <- mapM (fmap (\(TxtI i) -> i) . identForId) topDeps +- let oi = ObjUnit ++ let oi = ObjBlock + { oiSymbols = syms + , oiClInfo = ci + , oiStatic = si +@@ -258,7 +258,7 @@ genUnits m ss spt_entries foreign_stubs = do + , oiFImports = fRefs + } + let lu = LinkableUnit +- { luObjUnit = oi ++ { luObjBlock = oi + , luIdExports = topDeps + , luOtherExports = [] + , luIdDeps = allDeps +diff --git a/compiler/GHC/StgToJS/Deps.hs b/compiler/GHC/StgToJS/Deps.hs +index 2947736590..5d2964335c 100644 +--- a/compiler/GHC/StgToJS/Deps.hs ++++ b/compiler/GHC/StgToJS/Deps.hs +@@ -22,7 +22,7 @@ where + + import GHC.Prelude + +-import GHC.StgToJS.Object as Object ++import GHC.StgToJS.Object + import GHC.StgToJS.Types + import GHC.StgToJS.Ids + +@@ -56,9 +56,9 @@ import Control.Monad.Trans.Class + import Control.Monad.Trans.State + + data DependencyDataCache = DDC +- { ddcModule :: !(Word64Map Unit) -- ^ Unique Module -> Unit +- , ddcId :: !(Word64Map Object.ExportedFun) -- ^ Unique Id -> Object.ExportedFun (only to other modules) +- , ddcOther :: !(Map OtherSymb Object.ExportedFun) ++ { ddcModule :: !(Word64Map Unit) -- ^ Unique Module -> Unit ++ , ddcId :: !(Word64Map ExportedFun) -- ^ Unique Id -> ExportedFun (only to other modules) ++ , ddcOther :: !(Map OtherSymb ExportedFun) + } + + -- | Generate module dependency data +@@ -69,24 +69,16 @@ genDependencyData + :: HasDebugCallStack + => Module + -> [LinkableUnit] +- -> G Object.Deps ++ -> G BlockInfo + genDependencyData mod units = do +- -- [(blockindex, blockdeps, required, exported)] + ds <- evalStateT (mapM (uncurry oneDep) blocks) + (DDC WM.empty WM.empty M.empty) +- return $ Object.Deps +- { depsModule = mod +- , depsRequired = IS.fromList [ n | (n, _, True, _) <- ds ] +- , depsHaskellExported = M.fromList $ (\(n,_,_,es) -> map (,n) es) =<< ds +- , depsBlocks = listArray (0, length blocks-1) (map (\(_,deps,_,_) -> deps) ds) ++ return $ BlockInfo ++ { bi_module = mod ++ , bi_must_link = IS.fromList [ n | (n, _, True, _) <- ds ] ++ , bi_exports = M.fromList $ (\(n,_,_,es) -> map (,n) es) =<< ds ++ , bi_block_deps = listArray (0, length blocks-1) (map (\(_,deps,_,_) -> deps) ds) + } +- -- XXX +- -- return $ BlockInfo +- -- { bi_module = mod +- -- , bi_must_link = IS.fromList [ n | (n, _, True, _) <- ds ] +- -- , bi_exports = M.fromList $ (\(n,_,_,es) -> map (,n) es) =<< ds +- -- , bi_block_deps = listArray (0, length blocks-1) (map (\(_,deps,_,_) -> deps) ds) +- -- } + where + -- Id -> Block + unitIdExports :: UniqFM Id Int +@@ -107,7 +99,7 @@ genDependencyData mod units = do + -- generate the list of exports and set of dependencies for one unit + oneDep :: LinkableUnit + -> Int +- -> StateT DependencyDataCache G (Int, Object.BlockDeps, Bool, [Object.ExportedFun]) ++ -> StateT DependencyDataCache G (Int, BlockDeps, Bool, [ExportedFun]) + oneDep (LinkableUnit _ idExports otherExports idDeps pseudoIdDeps otherDeps req _frefs) n = do + (edi, bdi) <- partitionEithers <$> mapM (lookupIdFun n) idDeps + (edo, bdo) <- partitionEithers <$> mapM lookupOtherFun otherDeps +@@ -115,9 +107,10 @@ genDependencyData mod units = do + expi <- mapM lookupExportedId (filter isExportedId idExports) + expo <- mapM lookupExportedOther otherExports + -- fixme thin deps, remove all transitive dependencies! +- let bdeps = Object.BlockDeps +- (IS.toList . IS.fromList . filter (/=n) $ bdi++bdo++bdp) +- (S.toList . S.fromList $ edi++edo++edp) ++ let bdeps = BlockDeps ++ { blockBlockDeps = IS.toList . IS.fromList . filter (/=n) $ bdi++bdo++bdp ++ , blockFunDeps = S.toList . S.fromList $ edi++edo++edp ++ } + return (n, bdeps, req, expi++expo) + + idModule :: Id -> Maybe Module +@@ -125,7 +118,7 @@ genDependencyData mod units = do + guard (m /= mod) >> return m + + lookupPseudoIdFun :: Int -> Unique +- -> StateT DependencyDataCache G (Either Object.ExportedFun Int) ++ -> StateT DependencyDataCache G (Either ExportedFun Int) + lookupPseudoIdFun _n u = + case lookupUFM_Directly unitIdExports u of + Just k -> return (Right k) +@@ -138,14 +131,14 @@ genDependencyData mod units = do + -- assumes function is internal to the current block if it's + -- from teh current module and not in the unitIdExports map. + lookupIdFun :: Int -> Id +- -> StateT DependencyDataCache G (Either Object.ExportedFun Int) ++ -> StateT DependencyDataCache G (Either ExportedFun Int) + lookupIdFun n i = case lookupUFM unitIdExports i of + Just k -> return (Right k) + Nothing -> case idModule i of + Nothing -> return (Right n) + Just m -> + let k = getKey . getUnique $ i +- addEntry :: StateT DependencyDataCache G Object.ExportedFun ++ addEntry :: StateT DependencyDataCache G ExportedFun + addEntry = do + (TxtI idTxt) <- lift (identForId i) + lookupExternalFun (Just k) (OtherSymb m idTxt) +@@ -157,7 +150,7 @@ genDependencyData mod units = do + + -- get the function for an OtherSymb from the cache, add it if necessary + lookupOtherFun :: OtherSymb +- -> StateT DependencyDataCache G (Either Object.ExportedFun Int) ++ -> StateT DependencyDataCache G (Either ExportedFun Int) + lookupOtherFun od@(OtherSymb m idTxt) = + case M.lookup od unitOtherExports of + Just n -> return (Right n) +@@ -165,22 +158,22 @@ genDependencyData mod units = do + Nothing -> Left <$> (maybe (lookupExternalFun Nothing od) return =<< + gets (M.lookup od . ddcOther)) + +- lookupExportedId :: Id -> StateT DependencyDataCache G Object.ExportedFun ++ lookupExportedId :: Id -> StateT DependencyDataCache G ExportedFun + lookupExportedId i = do + (TxtI idTxt) <- lift (identForId i) + lookupExternalFun (Just . getKey . getUnique $ i) (OtherSymb mod idTxt) + +- lookupExportedOther :: FastString -> StateT DependencyDataCache G Object.ExportedFun ++ lookupExportedOther :: FastString -> StateT DependencyDataCache G ExportedFun + lookupExportedOther = lookupExternalFun Nothing . OtherSymb mod + + -- lookup a dependency to another module, add to the id cache if there's + -- an id key, otherwise add to other cache + lookupExternalFun :: Maybe Word64 +- -> OtherSymb -> StateT DependencyDataCache G Object.ExportedFun ++ -> OtherSymb -> StateT DependencyDataCache G ExportedFun + lookupExternalFun mbIdKey od@(OtherSymb m idTxt) = do + let mk = getKey . getUnique $ m + mpk = moduleUnit m +- exp_fun = Object.ExportedFun m (LexicalFastString idTxt) ++ exp_fun = ExportedFun m (LexicalFastString idTxt) + addCache = do + ms <- gets ddcModule + let !cache' = WM.insert mk mpk ms +diff --git a/compiler/GHC/StgToJS/Linker/Linker.hs b/compiler/GHC/StgToJS/Linker/Linker.hs +index 0739c73204..d44627f405 100644 +--- a/compiler/GHC/StgToJS/Linker/Linker.hs ++++ b/compiler/GHC/StgToJS/Linker/Linker.hs +@@ -21,7 +21,17 @@ + + module GHC.StgToJS.Linker.Linker + ( jsLinkBinary ++ , jsLink + , embedJsFile ++ , staticInitStat ++ , staticDeclStat ++ , mkExportedFuns ++ , mkExportedModFuns ++ , computeLinkDependencies ++ , LinkSpec (..) ++ , LinkPlan (..) ++ , emptyLinkPlan ++ , incrementLinkPlan + ) + where + +@@ -38,6 +48,7 @@ import GHC.SysTools.Cpp + import GHC.SysTools + + import GHC.Linker.Static.Utils (exeFileName) ++import GHC.Linker.Types (Unlinked(..), linkableUnlinked) + + import GHC.StgToJS.Linker.Types + import GHC.StgToJS.Linker.Utils +@@ -51,7 +62,7 @@ import GHC.StgToJS.Closure + + import GHC.Unit.State + import GHC.Unit.Env +-import GHC.Unit.Home ++import GHC.Unit.Home.ModInfo + import GHC.Unit.Types + import GHC.Unit.Module (moduleStableString) + +@@ -71,23 +82,17 @@ import qualified GHC.SysTools.Ar as Ar + import qualified GHC.Data.ShortText as ST + import GHC.Data.FastString + +-import Control.Concurrent.MVar + import Control.Monad + + import Data.Array + import qualified Data.ByteString as B + import qualified Data.ByteString.Char8 as BC +-import qualified Data.ByteString.Lazy.Char8 as BLC + import qualified Data.ByteString.Lazy as BL + import qualified Data.ByteString as BS + import Data.Function (on) +-import Data.IntSet (IntSet) + import qualified Data.IntSet as IS + import Data.IORef +-import Data.List ( partition, nub, intercalate, sort +- , groupBy, intersperse, +- ) +-import qualified Data.List.NonEmpty as NE ++import Data.List ( nub, intercalate, groupBy, intersperse, sortBy) + import Data.Map.Strict (Map) + import qualified Data.Map.Strict as M + import Data.Maybe +@@ -105,6 +110,10 @@ import System.Directory ( createDirectoryIfMissing + , getPermissions + ) + ++import GHC.Unit.Finder.Types ++import GHC.Unit.Finder (findObjectLinkableMaybe, initFinderCache, findHomeModule) ++import GHC.Driver.Config.Finder (initFinderOpts) ++ + data LinkerStats = LinkerStats + { bytesPerModule :: !(Map Module Word64) -- ^ number of bytes linked per module + , packedMetaDataSize :: !Word64 -- ^ number of bytes for metadata +@@ -125,7 +134,7 @@ jsLinkBinary + -> [FilePath] + -> [UnitId] + -> IO () +-jsLinkBinary lc_cfg cfg js_srcs logger dflags u_env objs dep_pkgs ++jsLinkBinary lc_cfg cfg js_srcs logger dflags unit_env objs dep_units + | lcNoJSExecutables lc_cfg = return () + | otherwise = do + -- additional objects to link are passed as FileOption ldInputs... +@@ -135,47 +144,59 @@ jsLinkBinary lc_cfg cfg js_srcs logger dflags u_env objs dep_pkgs + let + objs' = map ObjFile (objs ++ cmdline_js_objs) + js_srcs' = js_srcs ++ cmdline_js_srcs +- isRoot _ = True ++ is_root _ = True -- FIXME: we shouldn't consider every function as a root, ++ -- but only the program entry point (main), either the ++ -- generated one or coming from an object + exe = jsExeFileName dflags + +- void $ link lc_cfg cfg logger u_env exe mempty dep_pkgs objs' js_srcs' isRoot mempty ++ -- compute dependencies ++ let link_spec = LinkSpec ++ { lks_unit_ids = dep_units ++ , lks_obj_files = objs' ++ , lks_obj_root_filter = is_root ++ , lks_extra_roots = mempty ++ , lks_extra_js = js_srcs' ++ } ++ ++ -- XXX we should probably get this from the HscEnv instead? ++ finder_cache <- initFinderCache ++ ++ let finder_opts = initFinderOpts dflags ++ ++ link_plan <- computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache ++ ++ void $ jsLink lc_cfg cfg logger exe link_plan + + -- | link and write result to disk (jsexe directory) +-link :: JSLinkConfig ++jsLink ++ :: JSLinkConfig + -> StgToJSConfig + -> Logger +- -> UnitEnv + -> FilePath -- ^ output file/directory +- -> [FilePath] -- ^ include path for home package +- -> [UnitId] -- ^ packages to link +- -> [LinkedObj] -- ^ the object files we're linking +- -> [FilePath] -- ^ extra js files to include +- -> (ExportedFun -> Bool) -- ^ functions from the objects to use as roots (include all their deps) +- -> Set ExportedFun -- ^ extra symbols to link in ++ -> LinkPlan + -> IO () +-link lc_cfg cfg logger unit_env out _include units objFiles jsFiles isRootFun extraStaticDeps = do ++jsLink lc_cfg cfg logger out link_plan = do + + -- create output directory + createDirectoryIfMissing False out + ++ when (logVerbAtLeast logger 2) $ ++ logInfo logger $ hang (text "jsLink:") 2 (ppr link_plan) ++ + ------------------------------------------------------------- + -- link all Haskell code (program + dependencies) into out.js + +- -- compute dependencies +- (dep_map, dep_units, all_deps, _rts_wired_functions, dep_archives) +- <- computeLinkDependencies cfg logger out unit_env units objFiles extraStaticDeps isRootFun +- +- -- retrieve code for dependencies +- mods <- collectDeps dep_map dep_units all_deps ++ -- retrieve code for Haskell dependencies ++ mods <- collectModuleCodes link_plan + + -- LTO + rendering of JS code + link_stats <- withBinaryFile (out "out.js") WriteMode $ \h -> +- renderLinker h mods jsFiles ++ renderLinker h mods (lkp_extra_js link_plan) + + ------------------------------------------------------------- + + -- dump foreign references file (.frefs) +- unless (lcOnlyOut lc_cfg) $ do ++ when (lcForeignRefs lc_cfg) $ do + let frefsFile = "out.frefs" + -- frefs = concatMap mc_frefs mods + jsonFrefs = mempty -- FIXME: toJson frefs +@@ -191,12 +212,11 @@ link lc_cfg cfg logger unit_env out _include units objFiles jsFiles isRootFun ex + + -- link generated RTS parts into rts.js + unless (lcNoRts lc_cfg) $ do +- BL.writeFile (out "rts.js") ( BLC.pack rtsDeclsText +- <> BLC.pack (rtsText cfg)) ++ BL.writeFile (out "rts.js") (generatedRTS cfg) + + -- link dependencies' JS files into lib.js + withBinaryFile (out "lib.js") WriteMode $ \h -> do +- forM_ dep_archives $ \archive_file -> do ++ forM_ (lkp_archives link_plan) $ \archive_file -> do + Ar.Archive entries <- Ar.loadAr archive_file + forM_ entries $ \entry -> do + case getJsArchiveEntry entry of +@@ -205,47 +225,96 @@ link lc_cfg cfg logger unit_env out _include units objFiles jsFiles isRootFun ex + B.hPut h bs + hPutChar h '\n' + +- -- link everything together into all.js +- when (generateAllJs lc_cfg) $ do ++ -- link everything together into a runnable all.js ++ -- only if we link a complete application, ++ -- no incremental linking and no skipped parts ++ when (lcCombineAll lc_cfg && not (lcNoRts lc_cfg)) $ do + _ <- combineFiles lc_cfg out + writeHtml out + writeRunMain out + writeRunner lc_cfg out + writeExterns out + ++data LinkSpec = LinkSpec ++ { lks_unit_ids :: [UnitId] ++ ++ , lks_obj_files :: [LinkedObj] ++ ++ , lks_obj_root_filter :: ExportedFun -> Bool ++ -- ^ Predicate for exported functions in objects to declare as root ++ ++ , lks_extra_roots :: Set ExportedFun ++ -- ^ Extra root functions from loaded units ++ ++ , lks_extra_js :: [FilePath] ++ -- ^ Extra JS files to link ++ } ++ ++instance Outputable LinkSpec where ++ ppr s = hang (text "LinkSpec") 2 $ vcat ++ [ hcat [text "Unit ids: ", ppr (lks_unit_ids s)] ++ , hcat [text "Object files:", ppr (lks_obj_files s)] ++ , text "Object root filter: " ++ , hcat [text "Extra roots: ", ppr (lks_extra_roots s)] ++ , hang (text "Extra JS:") 2 (vcat (fmap text (lks_extra_js s))) ++ ] ++ ++emptyLinkPlan :: LinkPlan ++emptyLinkPlan = LinkPlan ++ { lkp_block_info = mempty ++ , lkp_dep_blocks = mempty ++ , lkp_archives = mempty ++ , lkp_extra_js = mempty ++ } ++ ++-- | Given a `base` link plan (assumed to be already linked) and a `new` link ++-- plan, compute `(diff, total)` link plans. ++-- ++-- - `diff` is the incremental link plan to get from `base` to `total` ++-- - `total` is the total link plan as if `base` and `new` were linked at once ++incrementLinkPlan :: LinkPlan -> LinkPlan -> (LinkPlan, LinkPlan) ++incrementLinkPlan base new = (diff,total) ++ where ++ total = LinkPlan ++ { lkp_block_info = M.union (lkp_block_info base) (lkp_block_info new) ++ , lkp_dep_blocks = S.union (lkp_dep_blocks base) (lkp_dep_blocks new) ++ , lkp_archives = S.union (lkp_archives base) (lkp_archives new) ++ , lkp_extra_js = S.union (lkp_extra_js base) (lkp_extra_js new) ++ } ++ diff = LinkPlan ++ { lkp_block_info = lkp_block_info new -- block info from "new" contains all we need to load new blocks ++ , lkp_dep_blocks = S.difference (lkp_dep_blocks new) (lkp_dep_blocks base) ++ , lkp_archives = S.difference (lkp_archives new) (lkp_archives base) ++ , lkp_extra_js = S.difference (lkp_extra_js new) (lkp_extra_js base) ++ } ++ + + computeLinkDependencies + :: StgToJSConfig +- -> Logger +- -> String + -> UnitEnv +- -> [UnitId] +- -> [LinkedObj] +- -> Set ExportedFun +- -> (ExportedFun -> Bool) +- -> IO (Map Module (Deps, DepsLocation), [UnitId], Set LinkableUnit, Set ExportedFun, [FilePath]) +-computeLinkDependencies cfg logger target unit_env units objFiles extraStaticDeps isRootFun = do +- +- (objDepsMap, objRequiredUnits) <- loadObjDeps objFiles +- +- let roots = S.fromList . filter isRootFun $ concatMap (M.keys . depsHaskellExported . fst) (M.elems objDepsMap) +- rootMods = map (moduleNameString . moduleName . NE.head) . NE.group . sort . map funModule . S.toList $ roots +- objPkgs = map moduleUnitId $ nub (M.keys objDepsMap) +- +- when (logVerbAtLeast logger 2) $ void $ do +- compilationProgressMsg logger $ hcat +- [ text "Linking ", text target, text " (", text (intercalate "," rootMods), char ')' ] +- compilationProgressMsg logger $ hcat +- [ text "objDepsMap ", ppr objDepsMap ] +- compilationProgressMsg logger $ hcat +- [ text "objFiles ", ppr objFiles ] ++ -> LinkSpec ++ -> FinderOpts ++ -> FinderCache ++ -> IO LinkPlan ++computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache = do ++ ++ let units = lks_unit_ids link_spec ++ let obj_files = lks_obj_files link_spec ++ let extra_roots = lks_extra_roots link_spec ++ let obj_is_root = lks_obj_root_filter link_spec ++ ++ (objs_block_info, objs_required_blocks) <- loadObjBlockInfo obj_files ++ ++ let obj_roots = S.fromList . filter obj_is_root $ concatMap (M.keys . bi_exports . lbi_info) (M.elems objs_block_info) ++ obj_units = map moduleUnitId $ nub (M.keys objs_block_info) + + let (rts_wired_units, rts_wired_functions) = rtsDeps units + + -- all the units we want to link together, without their dependencies + let root_units = filter (/= mainUnitId) ++ $ filter (/= interactiveUnitId) + $ nub +- $ rts_wired_units ++ reverse objPkgs ++ reverse units ++ $ rts_wired_units ++ reverse obj_units ++ reverse units + + -- all the units we want to link together, including their dependencies, + -- preload units, and backpack instantiations +@@ -254,26 +323,72 @@ computeLinkDependencies cfg logger target unit_env units objFiles extraStaticDep + let all_units = fmap unitId all_units_infos + + dep_archives <- getPackageArchives cfg unit_env all_units +- env <- newGhcjsEnv +- (archsDepsMap, archsRequiredUnits) <- loadArchiveDeps env dep_archives +- +- when (logVerbAtLeast logger 2) $ +- logInfo logger $ hang (text "Linking with archives:") 2 (vcat (fmap text dep_archives)) ++ (archives_block_info, archives_required_blocks) <- loadArchiveBlockInfo dep_archives + + -- compute dependencies +- let dep_units = all_units ++ [homeUnitId (ue_unsafeHomeUnit $ unit_env)] +- dep_map = objDepsMap `M.union` archsDepsMap +- excluded_units = S.empty +- dep_fun_roots = roots `S.union` rts_wired_functions `S.union` extraStaticDeps +- dep_unit_roots = archsRequiredUnits ++ objRequiredUnits +- +- all_deps <- getDeps (fmap fst dep_map) excluded_units dep_fun_roots dep_unit_roots +- +- when (logVerbAtLeast logger 2) $ +- logInfo logger $ hang (text "Units to link:") 2 (vcat (fmap ppr dep_units)) +- -- logInfo logger $ hang (text "All deps:") 2 (vcat (fmap ppr (S.toList all_deps))) ++ let block_info = objs_block_info `M.union` archives_block_info ++ dep_fun_roots = obj_roots `S.union` rts_wired_functions `S.union` extra_roots ++ ++ -- read transitive dependencies ++ new_required_blocks_var <- newIORef [] ++ let load_info mod = do ++ -- Adapted from the tangled code in GHC.Linker.Loader.getLinkDeps. ++ linkable <- case lookupHugByModule mod (ue_home_unit_graph unit_env) of ++ Nothing -> ++ -- It's not in the HPT because we are in one shot mode, ++ -- so use the Finder to get a ModLocation... ++ case ue_homeUnit unit_env of ++ Nothing -> pprPanic "getDeps: No home-unit: " (pprModule mod) ++ Just home_unit -> do ++ mb_stuff <- findHomeModule finder_cache finder_opts home_unit (moduleName mod) ++ case mb_stuff of ++ Found loc mod -> found loc mod ++ _ -> pprPanic "getDeps: Couldn't find home-module: " (pprModule mod) ++ where ++ found loc mod = do { ++ mb_lnk <- findObjectLinkableMaybe mod loc ; ++ case mb_lnk of { ++ Nothing -> pprPanic "getDeps: Couldn't find linkable for module: " (pprModule mod) ; ++ Just lnk -> pure lnk ++ }} ++ ++ Just mod_info -> case homeModInfoObject mod_info of ++ Nothing -> pprPanic "getDeps: Couldn't find object file for home-module: " (pprModule mod) ++ Just lnk -> pure lnk ++ ++ case linkableUnlinked linkable of ++ [DotO p] -> do ++ (bis, req_b) <- loadObjBlockInfo [ObjFile p] ++ -- Store new required blocks in IORef ++ modifyIORef new_required_blocks_var ((++) req_b) ++ case M.lookup mod bis of ++ Nothing -> pprPanic "getDeps: Didn't load any block info for home-module: " (pprModule mod) ++ Just bi -> pure bi ++ ul -> pprPanic "getDeps: Unrecognized linkable for home-module: " ++ (vcat [ pprModule mod ++ , ppr ul]) ++ ++ -- required blocks have no dependencies, so don't have to use them as roots in ++ -- the traversal ++ (updated_block_info, transitive_deps) <- getDeps block_info load_info dep_fun_roots mempty ++ ++ new_required_blocks <- readIORef new_required_blocks_var ++ let required_blocks = S.fromList $ mconcat ++ [ archives_required_blocks ++ , objs_required_blocks ++ , new_required_blocks ++ ] ++ ++ let all_deps = S.union transitive_deps required_blocks ++ ++ let plan = LinkPlan ++ { lkp_block_info = updated_block_info ++ , lkp_dep_blocks = all_deps ++ , lkp_archives = S.fromList dep_archives ++ , lkp_extra_js = S.fromList (lks_extra_js link_spec) ++ } + +- return (dep_map, dep_units, all_deps, rts_wired_functions, dep_archives) ++ return plan + + + -- | Compiled module +@@ -300,9 +415,9 @@ data CompactedModuleCode = CompactedModuleCode + renderLinker + :: Handle + -> [ModuleCode] -- ^ linked code per module +- -> [FilePath] -- ^ additional JS files ++ -> Set FilePath -- ^ additional JS files + -> IO LinkerStats +-renderLinker h mods jsFiles = do ++renderLinker h mods js_files = do + + -- link modules + let (compacted_mods, meta) = linkModules mods +@@ -336,7 +451,7 @@ renderLinker h mods jsFiles = do + mapM_ (putBS . cmc_exports) compacted_mods + + -- explicit additional JS files +- mapM_ (\i -> B.readFile i >>= putBS) jsFiles ++ mapM_ (\i -> B.readFile i >>= putBS) (S.toList js_files) + + -- stats + let link_stats = LinkerStats +@@ -469,99 +584,147 @@ writeExterns :: FilePath -> IO () + writeExterns out = writeFile (out "all.js.externs") + $ unpackFS rtsExterns + +--- | get all dependencies for a given set of roots +-getDeps :: Map Module Deps -- ^ loaded deps +- -> Set LinkableUnit -- ^ don't link these blocks +- -> Set ExportedFun -- ^ start here +- -> [LinkableUnit] -- ^ and also link these +- -> IO (Set LinkableUnit) +-getDeps loaded_deps base fun startlu = go' S.empty (S.fromList startlu) (S.toList fun) ++-- | Get all block dependencies for a given set of roots ++-- ++-- Returns the update block info map and the blocks. ++getDeps :: Map Module LocatedBlockInfo -- ^ Block info per module ++ -> (Module -> IO LocatedBlockInfo) -- ^ Used to load block info if missing ++ -> Set ExportedFun -- ^ start here ++ -> Set BlockRef -- ^ and also link these ++ -> IO (Map Module LocatedBlockInfo, Set BlockRef) ++getDeps init_infos load_info root_funs root_blocks = traverse_funs init_infos S.empty root_blocks (S.toList root_funs) + where +- go :: Set LinkableUnit +- -> Set LinkableUnit +- -> IO (Set LinkableUnit) +- go result open = case S.minView open of +- Nothing -> return result +- Just (lu@(lmod,n), open') -> +- case M.lookup lmod loaded_deps of +- Nothing -> pprPanic "getDeps.go: object file not loaded for: " (pprModule lmod) +- Just (Deps _ _ _ b) -> +- let block = b!n +- result' = S.insert lu result +- in go' result' +- (addOpen result' open' $ +- map (lmod,) (blockBlockDeps block)) (blockFunDeps block) +- +- go' :: Set LinkableUnit +- -> Set LinkableUnit +- -> [ExportedFun] +- -> IO (Set LinkableUnit) +- go' result open [] = go result open +- go' result open (f:fs) = +- let key = funModule f +- in case M.lookup key loaded_deps of +- Nothing -> pprPanic "getDeps.go': object file not loaded for: " $ pprModule key +- Just (Deps _m _r e _b) -> +- let lun :: Int +- lun = fromMaybe (pprPanic "exported function not found: " $ ppr f) +- (M.lookup f e) +- lu = (key, lun) +- in go' result (addOpen result open [lu]) fs +- +- addOpen :: Set LinkableUnit -> Set LinkableUnit -> [LinkableUnit] +- -> Set LinkableUnit +- addOpen result open newUnits = +- let alreadyLinked s = S.member s result || +- S.member s open || +- S.member s base +- in open `S.union` S.fromList (filter (not . alreadyLinked) newUnits) ++ -- A block may depend on: ++ -- 1. other blocks from the same module ++ -- 2. exported functions from another module ++ -- ++ -- Process: ++ -- 1. We use the BlockInfos to find the block corresponding to every ++ -- exported root functions. ++ -- ++ -- 2. We had these blocks to the set of root_blocks if they aren't already ++ -- added to the result. ++ -- ++ -- 3. Then we traverse the root_blocks to find their dependencies and we ++ -- add them to root_blocks (if they aren't already added to the result) and ++ -- to root_funs. ++ -- ++ -- 4. back to 1 ++ ++ lookup_info infos mod = case M.lookup mod infos of ++ Just info -> pure (infos, lbi_info info) ++ Nothing -> do ++ -- load info and update cache with it ++ info <- load_info mod ++ pure (M.insert mod info infos, lbi_info info) ++ ++ traverse_blocks ++ :: Map Module LocatedBlockInfo ++ -> Set BlockRef ++ -> Set BlockRef ++ -> IO (Map Module LocatedBlockInfo, Set BlockRef) ++ traverse_blocks infos result open = case S.minView open of ++ Nothing -> return (infos, result) ++ Just (ref, open') -> do ++ let mod = block_ref_mod ref ++ !(infos',info) <- lookup_info infos mod ++ let block = bi_block_deps info ! block_ref_idx ref ++ result' = S.insert ref result ++ to_block_ref i = BlockRef ++ { block_ref_mod = mod ++ , block_ref_idx = i ++ } ++ traverse_funs infos' result' ++ (addOpen result' open' $ ++ map to_block_ref (blockBlockDeps block)) (blockFunDeps block) ++ ++ traverse_funs ++ :: Map Module LocatedBlockInfo ++ -> Set BlockRef ++ -> Set BlockRef ++ -> [ExportedFun] ++ -> IO (Map Module LocatedBlockInfo, Set BlockRef) ++ traverse_funs infos result open = \case ++ [] -> traverse_blocks infos result open ++ (f:fs) -> do ++ let mod = funModule f ++ -- lookup module block info for the module that exports the function ++ !(infos',info) <- lookup_info infos mod ++ -- lookup block index associated to the function in the block info ++ case M.lookup f (bi_exports info) of ++ Nothing -> pprPanic "exported function not found: " $ ppr f ++ Just idx -> do ++ let fun_block_ref = BlockRef ++ { block_ref_mod = mod ++ , block_ref_idx = idx ++ } ++ -- always add the module "global block" when we link a module ++ let global_block_ref = BlockRef ++ { block_ref_mod = mod ++ , block_ref_idx = 0 ++ } ++ traverse_funs infos' result (addOpen result open [fun_block_ref,global_block_ref]) fs ++ ++ -- extend the open block set with new blocks that are not already in the ++ -- result block set nor in the open block set. ++ addOpen ++ :: Set BlockRef ++ -> Set BlockRef ++ -> [BlockRef] ++ -> Set BlockRef ++ addOpen result open new_blocks = ++ let alreadyLinked s = S.member s result || S.member s open ++ in open `S.union` S.fromList (filter (not . alreadyLinked) new_blocks) + + -- | collect dependencies for a set of roots +-collectDeps :: Map Module (Deps, DepsLocation) -- ^ Dependency map +- -> [UnitId] -- ^ packages, code linked in this order +- -> Set LinkableUnit -- ^ All dependencides +- -> IO [ModuleCode] +-collectDeps mod_deps packages all_deps = do +- +- -- read ghc-prim first, since we depend on that for static initialization +- let packages' = uncurry (++) $ partition (== primUnitId) (nub packages) +- +- units_by_module :: Map Module IntSet +- units_by_module = M.fromListWith IS.union $ +- map (\(m,n) -> (m, IS.singleton n)) (S.toList all_deps) +- +- mod_deps_bypkg :: Map UnitId [(Deps, DepsLocation)] +- mod_deps_bypkg = M.fromListWith (++) +- (map (\(m,v) -> (moduleUnitId m,[v])) (M.toList mod_deps)) +- ++collectModuleCodes :: LinkPlan -> IO [ModuleCode] ++collectModuleCodes link_plan = do ++ ++ let block_info = lkp_block_info link_plan ++ let blocks = lkp_dep_blocks link_plan ++ ++ -- we're going to load all the blocks. Instead of doing this randomly, we ++ -- group them by module first. ++ let module_blocks :: Map Module BlockIds ++ module_blocks = M.fromListWith IS.union $ ++ map (\ref -> (block_ref_mod ref, IS.singleton (block_ref_idx ref))) (S.toList blocks) ++ ++ -- GHCJS had this comment: "read ghc-prim first, since we depend on that for ++ -- static initialization". Not sure if it's still true as we haven't ported ++ -- the compactor yet. Still we sort to read ghc-prim blocks first just in ++ -- case. ++ let pred x = moduleUnitId (fst x) == primUnitId ++ cmp x y = case (pred x, pred y) of ++ (True,False) -> LT ++ (False,True) -> GT ++ (True,True) -> EQ ++ (False,False) -> EQ ++ ++ sorted_module_blocks :: [(Module,BlockIds)] ++ sorted_module_blocks = sortBy cmp (M.toList module_blocks) ++ ++ -- load blocks + ar_state <- emptyArchiveState +- fmap (catMaybes . concat) . forM packages' $ \pkg -> +- mapM (uncurry $ extractDeps ar_state units_by_module) +- (fromMaybe [] $ M.lookup pkg mod_deps_bypkg) +- +-extractDeps :: ArchiveState +- -> Map Module IntSet +- -> Deps +- -> DepsLocation +- -> IO (Maybe ModuleCode) +-extractDeps ar_state units deps loc = +- case M.lookup mod units of +- Nothing -> return Nothing +- Just mod_units -> Just <$> do +- let selector n _ = fromIntegral n `IS.member` mod_units || isGlobalUnit (fromIntegral n) +- case loc of +- ObjectFile fp -> do +- us <- readObjectUnits fp selector +- pure (collectCode us) +- ArchiveFile a -> do +- obj <- readArObject ar_state mod a +- us <- getObjectUnits obj selector +- pure (collectCode us) +- InMemory _n obj -> do +- us <- getObjectUnits obj selector +- pure (collectCode us) ++ forM sorted_module_blocks $ \(mod,bids) -> do ++ case M.lookup mod block_info of ++ Nothing -> pprPanic "collectModuleCodes: couldn't find block info for module" (ppr mod) ++ Just lbi -> extractBlocks ar_state lbi bids ++ ++extractBlocks :: ArchiveState -> LocatedBlockInfo -> BlockIds -> IO ModuleCode ++extractBlocks ar_state lbi blocks = do ++ case lbi_loc lbi of ++ ObjectFile fp -> do ++ us <- readObjectBlocks fp blocks ++ pure (collectCode us) ++ ArchiveFile a -> do ++ obj <- readArObject ar_state mod a ++ us <- getObjectBlocks obj blocks ++ pure (collectCode us) ++ InMemory _n obj -> do ++ us <- getObjectBlocks obj blocks ++ pure (collectCode us) + where +- mod = depsModule deps ++ mod = bi_module (lbi_info lbi) + newline = BC.pack "\n" + mk_exports = mconcat . intersperse newline . filter (not . BS.null) . map oiRaw + mk_js_code = mconcat . map oiStat +@@ -693,40 +856,32 @@ mkPrimFuns = mkExportedFuns primUnitId + -- | Given a @UnitId@, a module name, and a set of symbols in the module, + -- package these into an @ExportedFun@. + mkExportedFuns :: UnitId -> FastString -> [FastString] -> [ExportedFun] +-mkExportedFuns uid mod_name symbols = map mk_fun symbols ++mkExportedFuns uid mod_name symbols = mkExportedModFuns mod names + where + mod = mkModule (RealUnit (Definite uid)) (mkModuleNameFS mod_name) +- mk_fun sym = ExportedFun mod (LexicalFastString (mkJsSymbol True mod sym)) ++ names = map (mkJsSymbol True mod) symbols ++ ++-- | Given a @Module@ and a set of symbols in the module, package these into an ++-- @ExportedFun@. ++mkExportedModFuns :: Module -> [FastString] -> [ExportedFun] ++mkExportedModFuns mod symbols = map mk_fun symbols ++ where ++ mk_fun sym = ExportedFun mod (LexicalFastString sym) + + -- | read all dependency data from the to-be-linked files +-loadObjDeps :: [LinkedObj] -- ^ object files to link +- -> IO (Map Module (Deps, DepsLocation), [LinkableUnit]) +-loadObjDeps objs = (prepareLoadedDeps . catMaybes) <$> mapM readDepsFromObj objs ++loadObjBlockInfo :: [LinkedObj] -- ^ object files to link ++ -> IO (Map Module LocatedBlockInfo, [BlockRef]) ++loadObjBlockInfo objs = (prepareLoadedDeps . catMaybes) <$> mapM readBlockInfoFromObj objs + + -- | Load dependencies for the Linker from Ar +-loadArchiveDeps :: GhcjsEnv +- -> [FilePath] +- -> IO ( Map Module (Deps, DepsLocation) +- , [LinkableUnit] +- ) +-loadArchiveDeps env archives = modifyMVar (linkerArchiveDeps env) $ \m -> +- case M.lookup archives' m of +- Just r -> return (m, r) +- Nothing -> loadArchiveDeps' archives >>= \r -> return (M.insert archives' r m, r) +- where +- archives' = S.fromList archives +- +-loadArchiveDeps' :: [FilePath] +- -> IO ( Map Module (Deps, DepsLocation) +- , [LinkableUnit] +- ) +-loadArchiveDeps' archives = do ++loadArchiveBlockInfo :: [FilePath] -> IO (Map Module LocatedBlockInfo, [BlockRef]) ++loadArchiveBlockInfo archives = do + archDeps <- forM archives $ \file -> do + (Ar.Archive entries) <- Ar.loadAr file + catMaybes <$> mapM (readEntry file) entries + return (prepareLoadedDeps $ concat archDeps) + where +- readEntry :: FilePath -> Ar.ArchiveEntry -> IO (Maybe (Deps, DepsLocation)) ++ readEntry :: FilePath -> Ar.ArchiveEntry -> IO (Maybe LocatedBlockInfo) + readEntry ar_file ar_entry = do + let bs = Ar.filedata ar_entry + bh <- unsafeUnpackBinBuffer bs +@@ -734,8 +889,8 @@ loadArchiveDeps' archives = do + Left _ -> pure Nothing -- not a valid object entry + Right mod_name -> do + obj <- getObjectBody bh mod_name +- let !deps = objDeps obj +- pure $ Just (deps, ArchiveFile ar_file) ++ let !info = objBlockInfo obj ++ pure $ Just (LocatedBlockInfo (ArchiveFile ar_file) info) + + -- | Predicate to check that an entry in Ar is a JS source + -- and to return it without its header +@@ -765,29 +920,32 @@ jsHeaderLength = B.length jsHeader + + + +-prepareLoadedDeps :: [(Deps, DepsLocation)] +- -> ( Map Module (Deps, DepsLocation) +- , [LinkableUnit] +- ) +-prepareLoadedDeps deps = +- let req = concatMap (requiredUnits . fst) deps +- depsMap = M.fromList $ map (\d -> (depsModule (fst d), d)) deps +- in (depsMap, req) ++prepareLoadedDeps :: [LocatedBlockInfo] ++ -> (Map Module LocatedBlockInfo, [BlockRef]) ++prepareLoadedDeps lbis = (module_blocks, must_link) ++ where ++ must_link = concatMap (requiredBlocks . lbi_info) lbis ++ module_blocks = M.fromList $ map (\d -> (bi_module (lbi_info d), d)) lbis + +-requiredUnits :: Deps -> [LinkableUnit] +-requiredUnits d = map (depsModule d,) (IS.toList $ depsRequired d) ++requiredBlocks :: BlockInfo -> [BlockRef] ++requiredBlocks d = map mk_block_ref (IS.toList $ bi_must_link d) ++ where ++ mk_block_ref i = BlockRef ++ { block_ref_mod = bi_module d ++ , block_ref_idx = i ++ } + +--- | read dependencies from an object that might have already been into memory ++-- | read block info from an object that might have already been into memory + -- pulls in all Deps from an archive +-readDepsFromObj :: LinkedObj -> IO (Maybe (Deps, DepsLocation)) +-readDepsFromObj = \case ++readBlockInfoFromObj :: LinkedObj -> IO (Maybe LocatedBlockInfo) ++readBlockInfoFromObj = \case + ObjLoaded name obj -> do +- let !deps = objDeps obj +- pure $ Just (deps,InMemory name obj) ++ let !info = objBlockInfo obj ++ pure $ Just (LocatedBlockInfo (InMemory name obj) info) + ObjFile file -> do +- readObjectDeps file >>= \case ++ readObjectBlockInfo file >>= \case + Nothing -> pure Nothing +- Just deps -> pure $ Just (deps,ObjectFile file) ++ Just info -> pure $ Just (LocatedBlockInfo (ObjectFile file) info) + + + -- | Embed a JS file into a .o file +diff --git a/compiler/GHC/StgToJS/Linker/Types.hs b/compiler/GHC/StgToJS/Linker/Types.hs +index 9e1714fc00..7f4cc683b9 100644 +--- a/compiler/GHC/StgToJS/Linker/Types.hs ++++ b/compiler/GHC/StgToJS/Linker/Types.hs +@@ -2,8 +2,6 @@ + {-# LANGUAGE PartialTypeSignatures #-} + {-# LANGUAGE LambdaCase #-} + +-{-# OPTIONS_GHC -Wno-orphans #-} -- for Ident's Binary instance +- + ----------------------------------------------------------------------------- + -- | + -- Module : GHC.StgToJS.Linker.Types +@@ -19,26 +17,21 @@ + ----------------------------------------------------------------------------- + + module GHC.StgToJS.Linker.Types +- ( GhcjsEnv (..) +- , newGhcjsEnv +- , JSLinkConfig (..) ++ ( JSLinkConfig (..) + , defaultJSLinkConfig +- , generateAllJs + , LinkedObj (..) +- , LinkableUnit ++ , LinkPlan (..) + ) + where + + import GHC.StgToJS.Object + + import GHC.Unit.Types +-import GHC.Utils.Outputable (hsep,Outputable(..),text,ppr) ++import GHC.Utils.Outputable (hsep,Outputable(..),text,ppr, hang, IsDoc (vcat), IsLine (hcat)) + + import Data.Map.Strict (Map) +-import qualified Data.Map.Strict as M + import Data.Set (Set) +- +-import Control.Concurrent.MVar ++import qualified Data.Set as S + + import System.IO + +@@ -49,35 +42,53 @@ import Prelude + -------------------------------------------------------------------------------- + + data JSLinkConfig = JSLinkConfig +- { lcNoJSExecutables :: Bool +- , lcNoHsMain :: Bool +- , lcOnlyOut :: Bool +- , lcNoRts :: Bool +- , lcNoStats :: Bool ++ { lcNoJSExecutables :: !Bool -- ^ Dont' build JS executables ++ , lcNoHsMain :: !Bool -- ^ Don't generate Haskell main entry ++ , lcNoRts :: !Bool -- ^ Don't dump the generated RTS ++ , lcNoStats :: !Bool -- ^ Disable .stats file generation ++ , lcForeignRefs :: !Bool -- ^ Dump .frefs (foreign references) files ++ , lcCombineAll :: !Bool -- ^ Generate all.js (combined js) + wrappers + } + +--- | we generate a runnable all.js only if we link a complete application, +--- no incremental linking and no skipped parts +-generateAllJs :: JSLinkConfig -> Bool +-generateAllJs s = not (lcOnlyOut s) && not (lcNoRts s) +- ++-- | Default linker configuration + defaultJSLinkConfig :: JSLinkConfig + defaultJSLinkConfig = JSLinkConfig + { lcNoJSExecutables = False + , lcNoHsMain = False +- , lcOnlyOut = False + , lcNoRts = False + , lcNoStats = False ++ , lcCombineAll = True ++ , lcForeignRefs = True + } + ++data LinkPlan = LinkPlan ++ { lkp_block_info :: Map Module LocatedBlockInfo ++ -- ^ Block information ++ ++ , lkp_dep_blocks :: Set BlockRef ++ -- ^ Blocks to link ++ ++ , lkp_archives :: Set FilePath ++ -- ^ Archives to load JS sources from ++ ++ , lkp_extra_js :: Set FilePath ++ -- ^ Extra JS files to link ++ } ++ ++instance Outputable LinkPlan where ++ ppr s = hang (text "LinkPlan") 2 $ vcat ++ -- Hidden because it's too verbose and it's not really part of the ++ -- plan, just meta info used to retrieve actual block contents ++ -- [ hcat [ text "Block info: ", ppr (lkp_block_info s)] ++ [ hcat [ text "Blocks: ", ppr (S.size (lkp_dep_blocks s))] ++ , hang (text "JS files from archives:") 2 (vcat (fmap text (S.toList (lkp_archives s)))) ++ , hang (text "Extra JS:") 2 (vcat (fmap text (S.toList (lkp_extra_js s)))) ++ ] ++ + -------------------------------------------------------------------------------- + -- Linker Environment + -------------------------------------------------------------------------------- + +--- | A @LinkableUnit@ is a pair of a module and the index of the block in the +--- object file +-type LinkableUnit = (Module, Int) +- + -- | An object file that's either already in memory (with name) or on disk + data LinkedObj + = ObjFile FilePath -- ^ load from this file +@@ -87,15 +98,3 @@ instance Outputable LinkedObj where + ppr = \case + ObjFile fp -> hsep [text "ObjFile", text fp] + ObjLoaded s o -> hsep [text "ObjLoaded", text s, ppr (objModuleName o)] +- +-data GhcjsEnv = GhcjsEnv +- { linkerArchiveDeps :: MVar (Map (Set FilePath) +- (Map Module (Deps, DepsLocation) +- , [LinkableUnit] +- ) +- ) +- } +- +--- | return a fresh @GhcjsEnv@ +-newGhcjsEnv :: IO GhcjsEnv +-newGhcjsEnv = GhcjsEnv <$> newMVar M.empty +diff --git a/compiler/GHC/StgToJS/Object.hs b/compiler/GHC/StgToJS/Object.hs +index f75d27e20b..575acd0507 100644 +--- a/compiler/GHC/StgToJS/Object.hs ++++ b/compiler/GHC/StgToJS/Object.hs +@@ -46,14 +46,20 @@ module GHC.StgToJS.Object + , getObjectBody + , getObject + , readObject +- , getObjectUnits +- , readObjectUnits +- , readObjectDeps +- , isGlobalUnit ++ , getObjectBlocks ++ , readObjectBlocks ++ , readObjectBlockInfo ++ , isGlobalBlock + , isJsObjectFile + , Object(..) + , IndexEntry(..) +- , Deps (..), BlockDeps (..), DepsLocation (..) ++ , LocatedBlockInfo (..) ++ , BlockInfo (..) ++ , BlockDeps (..) ++ , BlockLocation (..) ++ , BlockId ++ , BlockIds ++ , BlockRef (..) + , ExportedFun (..) + ) + where +@@ -96,63 +102,75 @@ data Object = Object + { objModuleName :: !ModuleName + -- ^ name of the module + , objHandle :: !BinHandle +- -- ^ BinHandle that can be used to read the ObjUnits +- , objPayloadOffset :: !(Bin ObjUnit) ++ -- ^ BinHandle that can be used to read the ObjBlocks ++ , objPayloadOffset :: !(Bin ObjBlock) + -- ^ Offset of the payload (units) +- , objDeps :: !Deps +- -- ^ Dependencies ++ , objBlockInfo :: !BlockInfo ++ -- ^ Information about blocks + , objIndex :: !Index +- -- ^ The Index, serialed unit indices and their linkable units ++ -- ^ Block index: symbols per block and block offset in the object file + } + + type BlockId = Int + type BlockIds = IntSet + +--- | dependencies for a single module +-data Deps = Deps +- { depsModule :: !Module +- -- ^ module +- , depsRequired :: !BlockIds ++-- | Information about blocks (linkable units) ++data BlockInfo = BlockInfo ++ { bi_module :: !Module ++ -- ^ Module they were generated from ++ , bi_must_link :: !BlockIds + -- ^ blocks that always need to be linked when this object is loaded (e.g. + -- everything that contains initializer code or foreign exports) +- , depsHaskellExported :: !(Map ExportedFun BlockId) ++ , bi_exports :: !(Map ExportedFun BlockId) + -- ^ exported Haskell functions -> block +- , depsBlocks :: !(Array BlockId BlockDeps) +- -- ^ info about each block ++ , bi_block_deps :: !(Array BlockId BlockDeps) ++ -- ^ dependencies of each block + } + +-instance Outputable Deps where ++data LocatedBlockInfo = LocatedBlockInfo ++ { lbi_loc :: !BlockLocation -- ^ Where to find the blocks ++ , lbi_info :: !BlockInfo -- ^ Block information ++ } ++ ++instance Outputable BlockInfo where + ppr d = vcat +- [ hcat [ text "module: ", pprModule (depsModule d) ] +- , hcat [ text "exports: ", ppr (M.keys (depsHaskellExported d)) ] ++ [ hcat [ text "module: ", pprModule (bi_module d) ] ++ , hcat [ text "exports: ", ppr (M.keys (bi_exports d)) ] + ] + +--- | Where are the dependencies +-data DepsLocation ++-- | Where are the blocks ++data BlockLocation + = ObjectFile FilePath -- ^ In an object file at path + | ArchiveFile FilePath -- ^ In a Ar file at path + | InMemory String Object -- ^ In memory + +-instance Outputable DepsLocation where ++instance Outputable BlockLocation where + ppr = \case + ObjectFile fp -> hsep [text "ObjectFile", text fp] + ArchiveFile fp -> hsep [text "ArchiveFile", text fp] + InMemory s o -> hsep [text "InMemory", text s, ppr (objModuleName o)] + ++-- | A @BlockRef@ is a pair of a module and the index of the block in the ++-- object file ++data BlockRef = BlockRef ++ { block_ref_mod :: !Module -- ^ Module ++ , block_ref_idx :: !BlockId -- ^ Block index in the object file ++ } ++ deriving (Eq,Ord) ++ + data BlockDeps = BlockDeps +- { blockBlockDeps :: [Int] -- ^ dependencies on blocks in this object ++ { blockBlockDeps :: [BlockId] -- ^ dependencies on blocks in this object + , blockFunDeps :: [ExportedFun] -- ^ dependencies on exported symbols in other objects + -- , blockForeignExported :: [ExpFun] + -- , blockForeignImported :: [ForeignRef] + } + +-{- | we use the convention that the first unit (0) is a module-global +- unit that's always included when something from the module +- is loaded. everything in a module implicitly depends on the +- global block. the global unit itself can't have dependencies +- -} +-isGlobalUnit :: Int -> Bool +-isGlobalUnit n = n == 0 ++-- | we use the convention that the first block (0) is a module-global block ++-- that's always included when something from the module is loaded. everything ++-- in a module implicitly depends on the global block. The global block itself ++-- can't have dependencies ++isGlobalBlock :: BlockId -> Bool ++isGlobalBlock n = n == 0 + + -- | Exported Functions + data ExportedFun = ExportedFun +@@ -166,10 +184,10 @@ instance Outputable ExportedFun where + , hcat [ text "symbol: ", ppr f ] + ] + +--- | Write an ObjUnit, except for the top level symbols which are stored in the ++-- | Write an ObjBlock, except for the top level symbols which are stored in the + -- index +-putObjUnit :: BinHandle -> ObjUnit -> IO () +-putObjUnit bh (ObjUnit _syms b c d e f g) = do ++putObjBlock :: BinHandle -> ObjBlock -> IO () ++putObjBlock bh (ObjBlock _syms b c d e f g) = do + put_ bh b + put_ bh c + lazyPut bh d +@@ -177,17 +195,17 @@ putObjUnit bh (ObjUnit _syms b c d e f g) = do + put_ bh f + put_ bh g + +--- | Read an ObjUnit and associate it to the given symbols (that must have been ++-- | Read an ObjBlock and associate it to the given symbols (that must have been + -- read from the index) +-getObjUnit :: [FastString] -> BinHandle -> IO ObjUnit +-getObjUnit syms bh = do ++getObjBlock :: [FastString] -> BinHandle -> IO ObjBlock ++getObjBlock syms bh = do + b <- get bh + c <- get bh + d <- lazyGet bh + e <- get bh + f <- get bh + g <- get bh +- pure $ ObjUnit ++ pure $ ObjBlock + { oiSymbols = syms + , oiClInfo = b + , oiStatic = c +@@ -203,12 +221,12 @@ getObjUnit syms bh = do + magic :: String + magic = "GHCJSOBJ" + +--- | Serialized unit indexes and their exported symbols +--- (the first unit is module-global) ++-- | Serialized block indexes and their exported symbols ++-- (the first block is module-global) + type Index = [IndexEntry] + data IndexEntry = IndexEntry +- { idxSymbols :: ![FastString] -- ^ Symbols exported by a unit +- , idxOffset :: !(Bin ObjUnit) -- ^ Offset of the unit in the object file ++ { idxSymbols :: ![FastString] -- ^ Symbols exported by a block ++ , idxOffset :: !(Bin ObjBlock) -- ^ Offset of the block in the object file + } + + +@@ -221,8 +239,8 @@ data IndexEntry = IndexEntry + putObject + :: BinHandle + -> ModuleName -- ^ module +- -> Deps -- ^ dependencies +- -> [ObjUnit] -- ^ linkable units and their symbols ++ -> BlockInfo -- ^ block infos ++ -> [ObjBlock] -- ^ linkable units and their symbols + -> IO () + putObject bh mod_name deps os = do + forM_ magic (putByte bh . fromIntegral . ord) +@@ -243,7 +261,7 @@ putObject bh mod_name deps os = do + idx <- forM os $ \o -> do + p <- tellBin bh_fs + -- write units without their symbols +- putObjUnit bh_fs o ++ putObjBlock bh_fs o + -- return symbols and offset to store in the index + pure (oiSymbols o,p) + pure idx +@@ -295,15 +313,15 @@ getObjectBody bh0 mod_name = do + dict <- forwardGet bh0 (getDictionary bh0) + let bh = setUserData bh0 $ noUserData { ud_get_fs = getDictFastString dict } + +- deps <- get bh +- idx <- forwardGet bh (get bh) ++ block_info <- get bh ++ idx <- forwardGet bh (get bh) + payload_pos <- tellBin bh + + pure $ Object + { objModuleName = mod_name + , objHandle = bh + , objPayloadOffset = payload_pos +- , objDeps = deps ++ , objBlockInfo = block_info + , objIndex = idx + } + +@@ -322,31 +340,31 @@ readObject file = do + bh <- readBinMem file + getObject bh + +--- | Reads only the part necessary to get the dependencies +-readObjectDeps :: FilePath -> IO (Maybe Deps) +-readObjectDeps file = do ++-- | Reads only the part necessary to get the block info ++readObjectBlockInfo :: FilePath -> IO (Maybe BlockInfo) ++readObjectBlockInfo file = do + bh <- readBinMem file + getObject bh >>= \case +- Just obj -> pure $! Just $! objDeps obj ++ Just obj -> pure $! Just $! objBlockInfo obj + Nothing -> pure Nothing + +--- | Get units in the object file, using the given filtering function +-getObjectUnits :: Object -> (Word -> IndexEntry -> Bool) -> IO [ObjUnit] +-getObjectUnits obj pred = mapMaybeM read_entry (zip (objIndex obj) [0..]) ++-- | Get blocks in the object file, using the given filtering function ++getObjectBlocks :: Object -> BlockIds -> IO [ObjBlock] ++getObjectBlocks obj bids = mapMaybeM read_entry (zip (objIndex obj) [0..]) + where + bh = objHandle obj +- read_entry (e@(IndexEntry syms offset),i) +- | pred i e = do ++ read_entry (IndexEntry syms offset,i) ++ | IS.member i bids = do + seekBin bh offset +- Just <$> getObjUnit syms bh ++ Just <$> getObjBlock syms bh + | otherwise = pure Nothing + +--- | Read units in the object file, using the given filtering function +-readObjectUnits :: FilePath -> (Word -> IndexEntry -> Bool) -> IO [ObjUnit] +-readObjectUnits file pred = do ++-- | Read blocks in the object file, using the given filtering function ++readObjectBlocks :: FilePath -> BlockIds -> IO [ObjBlock] ++readObjectBlocks file bids = do + readObject file >>= \case + Nothing -> pure [] +- Just obj -> getObjectUnits obj pred ++ Just obj -> getObjectBlocks obj bids + + + -------------------------------------------------------------------------------- +@@ -378,13 +396,13 @@ instance Binary IndexEntry where + put_ bh (IndexEntry a b) = put_ bh a >> put_ bh b + get bh = IndexEntry <$> get bh <*> get bh + +-instance Binary Deps where +- put_ bh (Deps m r e b) = do ++instance Binary BlockInfo where ++ put_ bh (BlockInfo m r e b) = do + put_ bh m + put_ bh (map toI32 $ IS.toList r) + put_ bh (map (\(x,y) -> (x, toI32 y)) $ M.toList e) + put_ bh (elems b) +- get bh = Deps <$> get bh ++ get bh = BlockInfo <$> get bh + <*> (IS.fromList . map fromI32 <$> get bh) + <*> (M.fromList . map (\(x,y) -> (x, fromI32 y)) <$> get bh) + <*> ((\xs -> listArray (0, length xs - 1) xs) <$> get bh) +diff --git a/compiler/GHC/StgToJS/Rts/Rts.hs b/compiler/GHC/StgToJS/Rts/Rts.hs +index 55e1a3f312..6209f0bce4 100644 +--- a/compiler/GHC/StgToJS/Rts/Rts.hs ++++ b/compiler/GHC/StgToJS/Rts/Rts.hs +@@ -47,6 +47,7 @@ import Data.Array + import Data.Monoid + import Data.Char (toLower, toUpper) + import qualified Data.Bits as Bits ++import qualified Data.ByteString.Lazy.Char8 as BLC + + -- | The garbageCollector resets registers and result variables. + garbageCollector :: JStat +@@ -356,6 +357,10 @@ rtsDecls = jsSaturate (Just "h$RTSD") $ + , declRegs + , declRets] + ++-- | Get the generated part of the RTS ++generatedRTS :: StgToJSConfig -> BLC.ByteString ++generatedRTS cfg = BLC.pack rtsDeclsText <> BLC.pack (rtsText cfg) ++ + -- | print the embedded RTS to a String + rtsText :: StgToJSConfig -> String + rtsText = show . pretty . rts +diff --git a/compiler/GHC/StgToJS/Types.hs b/compiler/GHC/StgToJS/Types.hs +index 0984dd791a..cba79b5eaa 100644 +--- a/compiler/GHC/StgToJS/Types.hs ++++ b/compiler/GHC/StgToJS/Types.hs +@@ -302,9 +302,9 @@ data ForeignJSRef = ForeignJSRef + , foreignRefResult :: !FastString + } deriving stock (Generic) + +--- | data used to generate one ObjUnit in our object file ++-- | data used to generate one ObjBlock in our object file + data LinkableUnit = LinkableUnit +- { luObjUnit :: ObjUnit -- ^ serializable unit info ++ { luObjBlock :: ObjBlock -- ^ serializable unit info + , luIdExports :: [Id] -- ^ exported names from haskell identifiers + , luOtherExports :: [FastString] -- ^ other exports + , luIdDeps :: [Id] -- ^ identifiers this unit depends on +@@ -315,7 +315,7 @@ data LinkableUnit = LinkableUnit + } + + -- | one toplevel block in the object file +-data ObjUnit = ObjUnit ++data ObjBlock = ObjBlock + { oiSymbols :: ![FastString] -- ^ toplevel symbols (stored in index) + , oiClInfo :: ![ClosureInfo] -- ^ closure information of all closures in block + , oiStatic :: ![StaticInfo] -- ^ static closure data +diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs +index 5cf69c0dfe..227765d43c 100644 +--- a/compiler/GHC/Tc/Gen/Splice.hs ++++ b/compiler/GHC/Tc/Gen/Splice.hs +@@ -155,6 +155,7 @@ import qualified Data.Map as Map + import Data.Typeable ( typeOf, Typeable, TypeRep, typeRep ) + import Data.Data (Data) + import Data.Proxy ( Proxy (..) ) ++import Data.IORef + import GHC.Parser.HaddockLex (lexHsDoc) + import GHC.Parser (parseIdentifier) + import GHC.Rename.Doc (rnHsDoc) +@@ -1058,6 +1059,7 @@ runRemoteModFinalizers (ThModFinalizers finRefs) = do + withForeignRefs (x : xs) f = withForeignRef x $ \r -> + withForeignRefs xs $ \rs -> f (r : rs) + interp <- tcGetInterp ++ + case interpInstance interp of + #if defined(HAVE_INTERNAL_INTERPRETER) + InternalInterp -> do +@@ -1065,17 +1067,18 @@ runRemoteModFinalizers (ThModFinalizers finRefs) = do + runQuasi $ sequence_ qs + #endif + +- ExternalInterp conf iserv -> withIServ_ conf iserv $ \i -> do ++ ExternalInterp ext -> withExtInterp ext $ \inst -> do + tcg <- getGblEnv + th_state <- readTcRef (tcg_th_remote_state tcg) + case th_state of + Nothing -> return () -- TH was not started, nothing to do + Just fhv -> do +- liftIO $ withForeignRef fhv $ \st -> ++ r <- liftIO $ withForeignRef fhv $ \st -> + withForeignRefs finRefs $ \qrefs -> +- writeIServ i (putMessage (RunModFinalizers st qrefs)) +- () <- runRemoteTH i [] +- readQResult i ++ sendMessageDelayedResponse inst (RunModFinalizers st qrefs) ++ () <- runRemoteTH inst [] ++ qr <- liftIO $ receiveDelayedResponse inst r ++ checkQResult qr + + runQResult + :: (a -> String) +@@ -1691,37 +1694,40 @@ runTH ty fhv = do + return r + #endif + +- ExternalInterp conf iserv -> ++ ExternalInterp ext -> withExtInterp ext $ \inst -> do + -- Run it on the server. For an overview of how TH works with + -- Remote GHCi, see Note [Remote Template Haskell] in + -- libraries/ghci/GHCi/TH.hs. +- withIServ_ conf iserv $ \i -> do +- rstate <- getTHState i +- loc <- TH.qLocation +- liftIO $ +- withForeignRef rstate $ \state_hv -> +- withForeignRef fhv $ \q_hv -> +- writeIServ i (putMessage (RunTH state_hv q_hv ty (Just loc))) +- runRemoteTH i [] +- bs <- readQResult i +- return $! runGet get (LB.fromStrict bs) ++ rstate <- getTHState inst ++ loc <- TH.qLocation ++ -- run a remote TH request ++ r <- liftIO $ ++ withForeignRef rstate $ \state_hv -> ++ withForeignRef fhv $ \q_hv -> ++ sendMessageDelayedResponse inst (RunTH state_hv q_hv ty (Just loc)) ++ -- respond to requests from the interpreter ++ runRemoteTH inst [] ++ -- get the final result ++ qr <- liftIO $ receiveDelayedResponse inst r ++ bs <- checkQResult qr ++ return $! runGet get (LB.fromStrict bs) + + + -- | communicate with a remotely-running TH computation until it finishes. + -- See Note [Remote Template Haskell] in libraries/ghci/GHCi/TH.hs. + runRemoteTH +- :: IServInstance ++ :: ExtInterpInstance d + -> [Messages TcRnMessage] -- saved from nested calls to qRecover + -> TcM () +-runRemoteTH iserv recovers = do +- THMsg msg <- liftIO $ readIServ iserv getTHMessage ++runRemoteTH inst recovers = do ++ THMsg msg <- liftIO $ receiveTHMessage inst + case msg of + RunTHDone -> return () + StartRecover -> do -- Note [TH recover with -fexternal-interpreter] + v <- getErrsVar + msgs <- readTcRef v + writeTcRef v emptyMessages +- runRemoteTH iserv (msgs : recovers) ++ runRemoteTH inst (msgs : recovers) + EndRecover caught_error -> do + let (prev_msgs, rest) = case recovers of + [] -> panic "EndRecover" +@@ -1732,16 +1738,15 @@ runRemoteTH iserv recovers = do + writeTcRef v $ if caught_error + then prev_msgs + else mkMessages warn_msgs `unionMessages` prev_msgs +- runRemoteTH iserv rest ++ runRemoteTH inst rest + _other -> do + r <- handleTHMessage msg +- liftIO $ writeIServ iserv (put r) +- runRemoteTH iserv recovers ++ liftIO $ sendAnyValue inst r ++ runRemoteTH inst recovers + +--- | Read a value of type QResult from the iserv +-readQResult :: Binary a => IServInstance -> TcM a +-readQResult i = do +- qr <- liftIO $ readIServ i get ++-- | Check a QResult ++checkQResult :: QResult a -> TcM a ++checkQResult qr = + case qr of + QDone a -> return a + QException str -> liftIO $ throwIO (ErrorCall str) +@@ -1788,17 +1793,18 @@ Back in GHC, when we receive: + -- + -- The TH state is stored in tcg_th_remote_state in the TcGblEnv. + -- +-getTHState :: IServInstance -> TcM (ForeignRef (IORef QState)) +-getTHState i = do +- tcg <- getGblEnv +- th_state <- readTcRef (tcg_th_remote_state tcg) +- case th_state of +- Just rhv -> return rhv +- Nothing -> do +- interp <- tcGetInterp +- fhv <- liftIO $ mkFinalizedHValue interp =<< iservCall i StartTH +- writeTcRef (tcg_th_remote_state tcg) (Just fhv) +- return fhv ++getTHState :: ExtInterpInstance d -> TcM (ForeignRef (IORef QState)) ++getTHState inst = do ++ th_state_var <- tcg_th_remote_state <$> getGblEnv ++ liftIO $ do ++ th_state <- readIORef th_state_var ++ case th_state of ++ Just rhv -> return rhv ++ Nothing -> do ++ rref <- sendMessage inst StartTH ++ fhv <- mkForeignRef rref (freeReallyRemoteRef inst rref) ++ writeIORef th_state_var (Just fhv) ++ return fhv + + wrapTHResult :: TcM a -> TcM (THResult a) + wrapTHResult tcm = do +diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in +index 8cb5b2a952..d8fba4308f 100644 +--- a/compiler/ghc.cabal.in ++++ b/compiler/ghc.cabal.in +@@ -602,8 +602,11 @@ Library + GHC.Runtime.Heap.Inspect + GHC.Runtime.Heap.Layout + GHC.Runtime.Interpreter ++ GHC.Runtime.Interpreter.JS ++ GHC.Runtime.Interpreter.Process + GHC.Runtime.Interpreter.Types + GHC.Runtime.Loader ++ GHC.Runtime.Utils + GHC.Settings + GHC.Settings.Config + GHC.Settings.Constants +diff --git a/ghc-interp.js b/ghc-interp.js +new file mode 100644 +index 0000000000..6e4e4d7201 +--- /dev/null ++++ b/ghc-interp.js +@@ -0,0 +1,99 @@ ++/* ++ GHC JS Interpreter ++ ++ Read commands on stdin (ending with \n): ++ LOAD foo.js : load foo.js file ++ RUN_SERVER ghci_unit_id : run ghci_unit_id:GHCi.Server.defaultServer ++ ++ Once the Haskell server is started with RUN_SERVER, the JS server no longer ++ reads commands on stdin. Everything must go through the Haskell server (which ++ uses pipes for communication) ++*/ ++ ++var h$THfs = require('fs'); ++var h$THvm = require('vm'); ++ ++function h$debug_log(s) { ++ // uncomment the following line to enable some debug messages ++ // console.log("[JS interpreter] " + s); ++} ++ ++// load and exec JS file ++function h$loadJS(path) { ++ h$debug_log("Loading file: " + path); ++ var data = h$THfs.readFileSync(path); ++ const script = new h$THvm.Script(data); ++ script.runInThisContext(); ++} ++ ++// Lookup a static closure by its name ++function h$lookupClosure(v) { ++ h$debug_log("Looking up closure: " + v); ++ const r = eval(v); ++ h$debug_log(" -> Result: " + r); ++ if (!r) return 0; ++ // a RemoteRef is just the offset of a stable pointer ++ return h$makeStablePtr(r); ++} ++ ++// give access to these functions to the dynamically linked code ++globalThis.h$loadJS = h$loadJS; ++globalThis.h$lookupClosure = h$lookupClosure; ++global.require = require; ++global.module = module; ++ ++ ++function h$initInterp() { ++ h$debug_log("Welcome to GHC's JS interpreter"); ++ ++ function stdin_end() { ++ h$debug_log('GHC disconnected: goodbye.'); ++ process.exit(1); ++ }; ++ ++ // read until we find '\n' ++ // Accumulate bytes in "bytes" array ++ let bytes = []; ++ let decoder = new TextDecoder('utf8'); ++ ++ function stdin_readable() { ++ // read until we find '\n' ++ while (null !== (bs = process.stdin.read(1))) { ++ let b = bs[0]; ++ switch(b) { ++ case 10: // `\n` found. `bytes` must contain a command ++ let cmd = decoder.decode(new Uint8Array(bytes)); ++ bytes = []; ++ // we only supports 2 commands: LOAD, RUN_SERVER ++ if (cmd.startsWith("LOAD ")) { ++ h$loadJS(cmd.slice(5)); ++ } ++ else if (cmd.startsWith("RUN_SERVER ")) { ++ let uid = cmd.slice(11); ++ let root = eval("h$" + uid + "ZCGHCiziServerzidefaultServer"); ++ // remove listeners ++ process.stdin.removeListener('end', stdin_end); ++ process.stdin.removeListener('readable', stdin_readable); ++ // run the server ++ h$debug_log("Run server"); ++ h$main(root); ++ // break the loop ++ return; ++ } ++ else { ++ console.log("[JS interpreter] Invalid command received: " + cmd); ++ process.exit(1); ++ } ++ break; ++ default: ++ bytes.push(b); ++ } ++ } ++ }; ++ ++ // read commands on STDIN ++ process.stdin.on('end', stdin_end); ++ process.stdin.on('readable', stdin_readable); ++} ++ ++h$initInterp(); +diff --git a/hadrian/src/Base.hs b/hadrian/src/Base.hs +index 3fcc3bb3c6..00746ed085 100644 +--- a/hadrian/src/Base.hs ++++ b/hadrian/src/Base.hs +@@ -123,6 +123,7 @@ ghcLibDeps stage iplace = do + ps <- mapM (\f -> stageLibPath stage <&> (-/- f)) + [ "llvm-targets" + , "llvm-passes" ++ , "ghc-interp.js" + , "settings" + ] + cxxStdLib <- systemCxxStdLibConfPath (PackageDbLoc stage iplace) +diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs +index 921253f2de..6110dc117a 100644 +--- a/hadrian/src/Rules/Generate.hs ++++ b/hadrian/src/Rules/Generate.hs +@@ -197,6 +197,7 @@ copyRules = do + prefix -/- "ghci-usage.txt" <~ return "driver" + prefix -/- "llvm-targets" <~ return "." + prefix -/- "llvm-passes" <~ return "." ++ prefix -/- "ghc-interp.js" <~ return "." + prefix -/- "template-hsc.h" <~ return (pkgPath hsc2hs -/- "data") + + prefix -/- "html/**" <~ return "utils/haddock/haddock-api/resources" +diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs +index e4b45532b6..bd3d4db8ca 100644 +--- a/libraries/base/System/Posix/Internals.hs ++++ b/libraries/base/System/Posix/Internals.hs +@@ -139,10 +139,10 @@ ioe_unknownfiletype = IOError Nothing UnsupportedOperation "fdType" + Nothing + + fdGetMode :: FD -> IO IOMode +-#if defined(mingw32_HOST_OS) ++#if defined(mingw32_HOST_OS) || defined(javascript_HOST_ARCH) + fdGetMode _ = do + -- We don't have a way of finding out which flags are set on FDs +- -- on Windows, so make a handle that thinks that anything goes. ++ -- on Windows/JS, so make a handle that thinks that anything goes. + let flags = o_RDWR + #else + fdGetMode fd = do +diff --git a/libraries/base/jsbits/base.js b/libraries/base/jsbits/base.js +index 5b60d060e3..1613e3b676 100644 +--- a/libraries/base/jsbits/base.js ++++ b/libraries/base/jsbits/base.js +@@ -450,6 +450,15 @@ function h$base_c_s_isdir(mode) { + function h$base_c_s_isfifo(mode) { + return 0; + } ++function h$base_c_fcntl_read(fd,cmd) { ++ return -1; ++} ++function h$base_c_fcntl_write(fd,cmd,value) { ++ return -1; ++} ++function h$base_c_fcntl_lock(fd,cmd,ptr,ptr_o) { ++ return -1; ++} + + #ifndef GHCJS_BROWSER + function h$base_fillStat(fs, b, off) { +diff --git a/libraries/ghci/GHCi/RemoteTypes.hs b/libraries/ghci/GHCi/RemoteTypes.hs +index bbd7d32bed..77b663b2c4 100644 +--- a/libraries/ghci/GHCi/RemoteTypes.hs ++++ b/libraries/ghci/GHCi/RemoteTypes.hs +@@ -8,14 +8,29 @@ + -- compiler/GHC/Runtime/Interpreter.hs. + -- + module GHCi.RemoteTypes +- ( RemotePtr(..), toRemotePtr, fromRemotePtr, castRemotePtr ++ ( -- * Remote pointer ++ RemotePtr(..) ++ , toRemotePtr ++ , fromRemotePtr ++ , castRemotePtr ++ -- * RemoteRef: reference to some heap object (potentially remote) ++ , RemoteRef (..) ++ , mkRemoteRef ++ , localRef ++ , freeRemoteRef ++ , castRemoteRef ++ -- * ForeignRef: RemoteRef with a finalizer ++ , ForeignRef ++ , mkForeignRef ++ , withForeignRef ++ , finalizeForeignRef ++ , castForeignRef ++ , unsafeForeignRefToRemoteRef ++ -- * HValue + , HValue(..) +- , RemoteRef, mkRemoteRef, localRef, freeRemoteRef +- , HValueRef, toHValueRef +- , ForeignRef, mkForeignRef, withForeignRef ++ , HValueRef + , ForeignHValue +- , unsafeForeignRefToRemoteRef, finalizeForeignRef +- ) where ++) where + + import Prelude -- See note [Why do we import Prelude here?] + import Control.DeepSeq +@@ -23,7 +38,6 @@ import Data.Word + import Foreign hiding (newForeignPtr) + import Foreign.Concurrent + import Data.Binary +-import Unsafe.Coerce + import GHC.Exts + import GHC.ForeignPtr + +@@ -52,23 +66,28 @@ deriving instance Binary (RemotePtr a) + deriving instance NFData (RemotePtr a) + + -- ----------------------------------------------------------------------------- +--- HValueRef ++-- HValue: alias for Any + + newtype HValue = HValue Any + + instance Show HValue where + show _ = "" + +--- | A reference to a remote value. These are allocated and freed explicitly. ++-- For convenience ++type HValueRef = RemoteRef HValue ++type ForeignHValue = ForeignRef HValue ++ ++-- ----------------------------------------------------------------------------- ++-- RemoteRef: pointer to a Heap object ++ ++-- | A reference to a heap object. Potentially in a remote heap! ++-- These are allocated and freed explicitly. + newtype RemoteRef a = RemoteRef (RemotePtr ()) + deriving (Show, Binary) + + -- We can discard type information if we want +-toHValueRef :: RemoteRef a -> RemoteRef HValue +-toHValueRef = unsafeCoerce +- +--- For convenience +-type HValueRef = RemoteRef HValue ++castRemoteRef :: RemoteRef a -> RemoteRef b ++castRemoteRef = coerce + + -- | Make a reference to a local value that we can send remotely. + -- This reference will keep the value that it refers to alive until +@@ -78,34 +97,33 @@ mkRemoteRef a = do + sp <- newStablePtr a + return $! RemoteRef (toRemotePtr (castStablePtrToPtr sp)) + +--- | Convert an HValueRef to an HValue. Should only be used if the HValue +--- originated in this process. ++-- | Convert a RemoteRef to its carried type. Should only be used if the ++-- RemoteRef originated in this process. + localRef :: RemoteRef a -> IO a + localRef (RemoteRef w) = + deRefStablePtr (castPtrToStablePtr (fromRemotePtr w)) + +--- | Release an HValueRef that originated in this process ++-- | Release a RemoteRef that originated in this process + freeRemoteRef :: RemoteRef a -> IO () + freeRemoteRef (RemoteRef w) = + freeStablePtr (castPtrToStablePtr (fromRemotePtr w)) + +--- | An HValueRef with a finalizer ++-- | An RemoteRef with a finalizer + newtype ForeignRef a = ForeignRef (ForeignPtr ()) + + instance NFData (ForeignRef a) where + rnf x = x `seq` () + +-type ForeignHValue = ForeignRef HValue + + -- | Create a 'ForeignRef' from a 'RemoteRef'. The finalizer +--- should arrange to call 'freeHValueRef' on the 'HValueRef'. (since ++-- should arrange to call 'freeRemoteRef' on the 'RemoteRef'. (since + -- this function needs to be called in the process that created the +--- 'HValueRef', it cannot be called directly from the finalizer). ++-- 'RemoteRef', it cannot be called directly from the finalizer). + mkForeignRef :: RemoteRef a -> IO () -> IO (ForeignRef a) + mkForeignRef (RemoteRef hvref) finalizer = + ForeignRef <$> newForeignPtr (fromRemotePtr hvref) finalizer + +--- | Use a 'ForeignHValue' ++-- | Use a 'ForeignRef' + withForeignRef :: ForeignRef a -> (RemoteRef a -> IO b) -> IO b + withForeignRef (ForeignRef fp) f = + withForeignPtr fp (f . RemoteRef . toRemotePtr) +@@ -116,3 +134,6 @@ unsafeForeignRefToRemoteRef (ForeignRef fp) = + + finalizeForeignRef :: ForeignRef a -> IO () + finalizeForeignRef (ForeignRef fp) = finalizeForeignPtr fp ++ ++castForeignRef :: ForeignRef a -> ForeignRef b ++castForeignRef = coerce +diff --git a/libraries/ghci/GHCi/Run.hs b/libraries/ghci/GHCi/Run.hs +index fae2ac07f5..2074445270 100644 +--- a/libraries/ghci/GHCi/Run.hs ++++ b/libraries/ghci/GHCi/Run.hs +@@ -1,5 +1,5 @@ + {-# LANGUAGE GADTs, RecordWildCards, MagicHash, ScopedTypeVariables, CPP, +- UnboxedTuples #-} ++ UnboxedTuples, LambdaCase #-} + {-# OPTIONS_GHC -fno-warn-name-shadowing #-} + + -- | +@@ -13,8 +13,14 @@ module GHCi.Run + ) where + + import Prelude -- See note [Why do we import Prelude here?] ++ ++#if !defined(javascript_HOST_ARCH) + import GHCi.CreateBCO + import GHCi.InfoTable ++import Data.Binary ++import Data.Binary.Get ++#endif ++ + import GHCi.FFI + import GHCi.Message + import GHCi.ObjLink +@@ -27,8 +33,6 @@ import Control.Concurrent + import Control.DeepSeq + import Control.Exception + import Control.Monad +-import Data.Binary +-import Data.Binary.Get + import Data.ByteString (ByteString) + import qualified Data.ByteString.Unsafe as B + import GHC.Exts +@@ -49,19 +53,36 @@ foreign import ccall "revertCAFs" rts_revertCAFs :: IO () + + run :: Message a -> IO a + run m = case m of ++#if defined(javascript_HOST_ARCH) ++ LoadObj p -> withCString p loadJS ++ InitLinker -> notSupportedJS m ++ LoadDLL {} -> notSupportedJS m ++ LoadArchive {} -> notSupportedJS m ++ UnloadObj {} -> notSupportedJS m ++ AddLibrarySearchPath {} -> notSupportedJS m ++ RemoveLibrarySearchPath {} -> notSupportedJS m ++ MkConInfoTable {} -> notSupportedJS m ++ ResolveObjs -> notSupportedJS m ++ FindSystemLibrary {} -> notSupportedJS m ++ CreateBCOs {} -> notSupportedJS m ++ LookupClosure str -> lookupJSClosure str ++#else + InitLinker -> initObjLinker RetainCAFs +- RtsRevertCAFs -> rts_revertCAFs +- LookupSymbol str -> fmap toRemotePtr <$> lookupSymbol str +- LookupClosure str -> lookupClosure str + LoadDLL str -> loadDLL str + LoadArchive str -> loadArchive str + LoadObj str -> loadObj str + UnloadObj str -> unloadObj str + AddLibrarySearchPath str -> toRemotePtr <$> addLibrarySearchPath str + RemoveLibrarySearchPath ptr -> removeLibrarySearchPath (fromRemotePtr ptr) ++ MkConInfoTable tc ptrs nptrs tag ptrtag desc -> ++ toRemotePtr <$> mkConInfoTable tc ptrs nptrs tag ptrtag desc + ResolveObjs -> resolveObjs + FindSystemLibrary str -> findSystemLibrary str + CreateBCOs bcos -> createBCOs (concatMap (runGet get) bcos) ++ LookupClosure str -> lookupClosure str ++#endif ++ RtsRevertCAFs -> rts_revertCAFs ++ LookupSymbol str -> fmap toRemotePtr <$> lookupSymbol str + FreeHValueRefs rs -> mapM_ freeRemoteRef rs + AddSptEntry fpr r -> localRef r >>= sptAddEntry fpr + EvalStmt opts r -> evalStmt opts r +@@ -90,15 +111,38 @@ run m = case m of + MallocStrings bss -> mapM mkString0 bss + PrepFFI conv args res -> toRemotePtr <$> prepForeignCall conv args res + FreeFFI p -> freeForeignCallInfo (fromRemotePtr p) +- MkConInfoTable tc ptrs nptrs tag ptrtag desc -> +- toRemotePtr <$> mkConInfoTable tc ptrs nptrs tag ptrtag desc + StartTH -> startTH + GetClosure ref -> do + clos <- Heap.getClosureData =<< localRef ref + mapM (\(Heap.Box x) -> mkRemoteRef (HValue x)) clos + Seq ref -> doSeq ref + ResumeSeq ref -> resumeSeq ref +- _other -> error "GHCi.Run.run" ++ ++ Shutdown -> unexpectedMessage m ++ RunTH {} -> unexpectedMessage m ++ RunModFinalizers {} -> unexpectedMessage m ++ ++unexpectedMessage :: Message a -> b ++unexpectedMessage m = error ("GHCi.Run.Run: unexpected message: " ++ show m) ++ ++#if defined(javascript_HOST_ARCH) ++foreign import javascript "((ptr,off) => globalThis.h$loadJS(h$decodeUtf8z(ptr,off)))" loadJS :: CString -> IO () ++ ++foreign import javascript "((ptr,off) => globalThis.h$lookupClosure(h$decodeUtf8z(ptr,off)))" lookupJSClosure# :: CString -> State# RealWorld -> (# State# RealWorld, Int# #) ++ ++lookupJSClosure' :: String -> IO Int ++lookupJSClosure' str = withCString str $ \cstr -> IO (\s -> ++ case lookupJSClosure# cstr s of ++ (# s', r #) -> (# s', I# r #)) ++ ++lookupJSClosure :: String -> IO (Maybe HValueRef) ++lookupJSClosure str = lookupJSClosure' str >>= \case ++ 0 -> pure Nothing ++ r -> pure (Just (RemoteRef (RemotePtr (fromIntegral r)))) ++ ++notSupportedJS :: Message a -> b ++notSupportedJS m = error ("Message not supported with the JavaScript interpreter: " ++ show m) ++#endif + + evalStmt :: EvalOpts -> EvalExpr HValueRef -> IO (EvalStatus [HValueRef]) + evalStmt opts expr = do +diff --git a/libraries/ghci/ghci.cabal.in b/libraries/ghci/ghci.cabal.in +index 700b7d62ea..ce7dc10a3e 100644 +--- a/libraries/ghci/ghci.cabal.in ++++ b/libraries/ghci/ghci.cabal.in +@@ -50,7 +50,6 @@ library + if flag(internal-interpreter) + CPP-Options: -DHAVE_INTERNAL_INTERPRETER + exposed-modules: +- GHCi.InfoTable + GHCi.Run + GHCi.CreateBCO + GHCi.ObjLink +@@ -59,6 +58,10 @@ library + GHCi.TH + GHCi.Server + ++ if !arch(javascript) ++ exposed-modules: ++ GHCi.InfoTable ++ + exposed-modules: + GHCi.BreakArray + GHCi.BinaryArray +diff --git a/libraries/template-haskell/tests/all.T b/libraries/template-haskell/tests/all.T +index 48f05c64fa..6fb09fc3c7 100644 +--- a/libraries/template-haskell/tests/all.T ++++ b/libraries/template-haskell/tests/all.T +@@ -1,3 +1,3 @@ + # difficult to test TH with profiling, because we have to build twice +-test('dataToExpQUnit', [omit_ways(prof_ways), req_interp], compile, ['-v0']) +-test('pragCompletePpr', [omit_ways(prof_ways), req_interp], compile_and_run, ['']) ++test('dataToExpQUnit', [omit_ways(prof_ways), req_th], compile, ['-v0']) ++test('pragCompletePpr', [omit_ways(prof_ways), req_th], compile_and_run, ['']) diff --git a/overlays/patches/ghc/ghc-9.8-android-convert-os.patch b/overlays/patches/ghc/ghc-9.8-android-convert-os.patch new file mode 100644 index 0000000000..bdbf1db0ac --- /dev/null +++ b/overlays/patches/ghc/ghc-9.8-android-convert-os.patch @@ -0,0 +1,13 @@ +diff --git a/m4/ghc_convert_os.m4 b/m4/ghc_convert_os.m4 +index 586b33d09b..275bd997eb 100644 +--- a/m4/ghc_convert_os.m4 ++++ b/m4/ghc_convert_os.m4 +@@ -10,7 +10,7 @@ AC_DEFUN([GHC_CONVERT_OS],[ + ios|watchos|tvos) + $3="ios" + ;; +- linux-android*) ++ linux-android*|android) + $3="linux-android" + ;; + linux-*|linux) diff --git a/overlays/patches/ghc/ghc-9.8-hadrian-strip-cmd.patch b/overlays/patches/ghc/ghc-9.8-hadrian-strip-cmd.patch new file mode 100644 index 0000000000..e6dc4079e5 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.8-hadrian-strip-cmd.patch @@ -0,0 +1,55 @@ +diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in +index 4912673869..85b5c58c2a 100644 +--- a/hadrian/cfg/system.config.in ++++ b/hadrian/cfg/system.config.in +@@ -18,6 +18,7 @@ merge-objects = @MergeObjsCmd@ + system-merge-objects = @LD_STAGE0@ + objdump = @ObjdumpCmd@ + ranlib = @REAL_RANLIB_CMD@ ++strip = @StripCmd@ + sphinx-build = @SPHINXBUILD@ + system-ar = @AR_STAGE0@ + system-cc = @CC_STAGE0@ +diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs +index a0f639d325..55f9a2f902 100644 +--- a/hadrian/src/Oracles/Setting.hs ++++ b/hadrian/src/Oracles/Setting.hs +@@ -73,6 +73,7 @@ data Setting = BuildArch + | ProjectPatchLevel + | ProjectPatchLevel1 + | ProjectPatchLevel2 ++ | Strip + | SystemGhc + | TargetArch + | TargetOs +@@ -176,6 +177,7 @@ setting key = lookupSystemConfig $ case key of + ProjectPatchLevel -> "project-patch-level" + ProjectPatchLevel1 -> "project-patch-level1" + ProjectPatchLevel2 -> "project-patch-level2" ++ Strip -> "strip" + SystemGhc -> "system-ghc" + TargetArch -> "target-arch" + TargetArmVersion -> "target-arm-version" +diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs +index 75eb78ccd8..6904c973d4 100644 +--- a/hadrian/src/Settings/Builders/Cabal.hs ++++ b/hadrian/src/Settings/Builders/Cabal.hs +@@ -85,15 +85,11 @@ commonCabalArgs :: Stage -> Args + commonCabalArgs stage = do + verbosity <- expr getVerbosity + pkg <- getPackage ++ strip <- getSetting Strip + package_id <- expr $ pkgUnitId stage pkg + let prefix = "${pkgroot}" ++ (if windowsHost then "" else "/..") +- mconcat [ -- Don't strip libraries when cross compiling. +- -- TODO: We need to set @--with-strip=(stripCmdPath :: Action FilePath)@, +- -- and if it's @:@ disable stripping as well. As it is now, I believe +- -- we might have issues with stripping on Windows, as I can't see a +- -- consumer of 'stripCmdPath'. +- -- TODO: See https://github.com/snowleopard/hadrian/issues/549. +- flag CrossCompiling ? pure [ "--disable-executable-stripping" ++ mconcat [ notStage0 ? strip /= "" ? pure [ "--with-strip=" ++ strip ] ++ , flag CrossCompiling ? pure [ "--disable-executable-stripping" + , "--disable-library-stripping" ] + -- We don't want to strip the debug RTS + , S.package rts ? pure [ "--disable-executable-stripping" diff --git a/overlays/patches/ghc/ghc-9.8.3-iog.patch b/overlays/patches/ghc/ghc-9.8.3-iog.patch new file mode 100644 index 0000000000..8f2df690c4 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.8.3-iog.patch @@ -0,0 +1,356 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 1f229f8173..7f954702a3 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -273,7 +273,7 @@ int ghciInsertSymbolTable( + RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); + if (!pinfo) /* new entry */ + { +- pinfo = stgMallocBytes(sizeof (*pinfo), "ghciInsertToSymbolTable"); ++ pinfo = stgCallocBytes(1, sizeof (*pinfo), "ghciInsertToSymbolTable"); + pinfo->value = data; + pinfo->owner = owner; + pinfo->strength = strength; +@@ -1203,7 +1203,7 @@ mkOc( ObjectType type, pathchar *path, char *image, int imageSize, + + + IF_DEBUG(linker, debugBelch("mkOc: %" PATH_FMT "\n", path)); +- oc = stgMallocBytes(sizeof(ObjectCode), "mkOc(oc)"); ++ oc = stgCallocBytes(1, sizeof(ObjectCode), "mkOc(oc)"); + + oc->info = NULL; + oc->type = type; +@@ -1223,7 +1223,7 @@ mkOc( ObjectType type, pathchar *path, char *image, int imageSize, + oc->fileName = pathdup(path); + + if (archiveMemberName) { +- oc->archiveMemberName = stgMallocBytes( (pathlen(archiveMemberName)+1) * pathsize, ++ oc->archiveMemberName = stgCallocBytes(1, (pathlen(archiveMemberName)+1) * pathsize, + "loadObj" ); + pathcopy(oc->archiveMemberName, archiveMemberName); + } else { +@@ -1380,12 +1380,12 @@ preloadObjectFile (pathchar *path) + // reading the file, and then we misalign image on purpose so + // that the actual sections end up aligned again. + misalignment = machoGetMisalignment(f); +- image = stgMallocBytes(fileSize + misalignment, "loadObj(image)"); ++ image = stgCallocBytes(1, fileSize + misalignment, "loadObj(image)"); + image += misalignment; + + # else /* !defined(darwin_HOST_OS) */ + +- image = stgMallocBytes(fileSize, "loadObj(image)"); ++ image = stgCallocBytes(1, fileSize, "loadObj(image)"); + + #endif /* !defined(darwin_HOST_OS) */ + +@@ -1678,6 +1678,8 @@ static HsInt resolveObjs_ (void) + IF_DEBUG(linker, debugBelch("resolveObjs: start\n")); + + for (ObjectCode *oc = objects; oc; oc = oc->next) { ++ if(oc->status == OBJECT_RESOLVED) ++ continue; + int r = ocTryLoad(oc); + if (!r) { + errorBelch("Could not load Object Code %" PATH_FMT ".\n", OC_INFORMATIVE_FILENAME(oc)); +@@ -1806,7 +1808,7 @@ void + addProddableBlock ( ObjectCode* oc, void* start, int size ) + { + ProddableBlock* pb +- = stgMallocBytes(sizeof(ProddableBlock), "addProddableBlock"); ++ = stgCallocBytes(1,sizeof(ProddableBlock), "addProddableBlock"); + + IF_DEBUG(linker, debugBelch("addProddableBlock: %p %p %d\n", oc, start, size)); + ASSERT(size > 0); +diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h +index e6098aa2b0..4b8992e817 100644 +--- a/rts/LinkerInternals.h ++++ b/rts/LinkerInternals.h +@@ -299,6 +299,10 @@ struct _ObjectCode { + int n_segments; + Segment *segments; + ++ // COMMON section ++ void * common_mem; ++ unsigned long common_size; ++ + // + // Garbage collection fields + // +diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c +index 4cac10ba15..fe0d8ca40e 100644 +--- a/rts/RtsUtils.c ++++ b/rts/RtsUtils.c +@@ -104,6 +104,11 @@ stgCallocBytes (size_t count, size_t size, char *msg) + rtsConfig.mallocFailHook((W_) count*size, msg); + stg_exit(EXIT_INTERNAL_ERROR); + } ++ // If we run under qemu with jemalloc, calloc is not guaranteed ++ // to zero memory. ++ // - https://giters.com/jemalloc/jemalloc/issues/1844 ++ // - https://lists.nongnu.org/archive/html/qemu-devel/2020-05/msg03119.html ++ memset(space, 0, count*size); + return space; + } + +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index d181450190..1ad05fc286 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -307,6 +307,15 @@ ocInit_ELF(ObjectCode * oc) + } + } + } ++ if(NULL != oc->common_mem) { ++#if RTS_LINKER_USE_MMAP ++ munmap(oc->common_mem, oc->common_size); ++#else ++ stgFree(oc->common_mem); ++#endif ++ } ++ oc->common_mem = NULL; ++ oc->common_size = 0; + } + + void +@@ -963,14 +972,17 @@ ocGetNames_ELF ( ObjectCode* oc ) + for (size_t j = 0; j < symTab->n_symbols; j++) { + ElfSymbol *symbol = &symTab->symbols[j]; + if (SHN_COMMON == symTab->symbols[j].elf_sym->st_shndx) { +- common_size += symbol->elf_sym->st_size; ++ // st_value holds the alignment. Adding alignment always ++ // should give us some wiggle room to get alignment right. ++ common_size += symbol->elf_sym->st_size + symbol->elf_sym->st_value; + } + } + } +- void * common_mem = NULL; ++ oc->common_mem = NULL; ++ oc->common_size = common_size; + if(common_size > 0) { +- common_mem = mmapAnonForLinker(common_size); +- if (common_mem == NULL) { ++ oc->common_mem = mmapAnonForLinker(common_size); ++ if (oc->common_mem == NULL) { + barf("ocGetNames_ELF: Failed to allocate memory for SHN_COMMONs"); + } + } +@@ -1011,9 +1023,10 @@ ocGetNames_ELF ( ObjectCode* oc ) + if (shndx == SHN_COMMON) { + isLocal = false; + CHECK(common_used < common_size); +- CHECK(common_mem); +- symbol->addr = (void*)((uintptr_t)common_mem + common_used); +- common_used += symbol->elf_sym->st_size; ++ CHECK(oc->common_mem); ++ int alignment = symbol->elf_sym->st_value-1; ++ symbol->addr = (void*)(((uintptr_t)oc->common_mem + common_used + alignment) & ~alignment); ++ common_used = (uintptr_t)symbol->addr - (uintptr_t)oc->common_mem + symbol->elf_sym->st_size; + CHECK(common_used <= common_size); + + IF_DEBUG(linker_verbose, +@@ -1027,7 +1040,9 @@ ocGetNames_ELF ( ObjectCode* oc ) + || ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK + ) + /* and not an undefined symbol */ +- && shndx != SHN_UNDEF ++ && (shndx != SHN_UNDEF ++ /* unless it's weak */ ++ || (shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK)) + /* and not in a "special section" */ + && (shndx < SHN_LORESERVE + #if defined(SHN_XINDEX) +@@ -1054,6 +1069,14 @@ ocGetNames_ELF ( ObjectCode* oc ) + (intptr_t) oc->sections[secno].start + + (intptr_t) symbol->elf_sym->st_value); + CHECK(symbol->addr != 0x0); ++ if(shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK) { ++ symbol->addr = NULL; ++ } else { ++ symbol->addr = (SymbolAddr*)( ++ (intptr_t) oc->sections[secno].start + ++ (intptr_t) symbol->elf_sym->st_value); ++ CHECK(symbol->addr != 0x0); ++ } + if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_LOCAL) { + isLocal = true; + isWeak = false; +@@ -1065,42 +1088,20 @@ ocGetNames_ELF ( ObjectCode* oc ) + isWeak = ELF_ST_BIND(symbol->elf_sym->st_info) + == STB_WEAK; + } +- } +- +- SymType sym_type; +- if (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC) { +- sym_type = SYM_TYPE_CODE; ++ } else if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK ++ && shndx == SHN_UNDEF ++ && (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_OBJECT ++ || ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_NOTYPE)) { ++ symbol->addr = NULL; ++ isLocal = false; ++ isWeak = true; + } else { +- sym_type = SYM_TYPE_DATA; +- } +- +- /* And the decision is ... */ +- +- if (symbol->addr != NULL) { +- CHECK(nm != NULL); +- /* Acquire! */ +- if (!isLocal) { +- +- if (isWeak == HS_BOOL_TRUE) { +- setWeakSymbol(oc, nm); +- } +- if (!ghciInsertSymbolTable(oc->fileName, symhash, +- nm, symbol->addr, isWeak, sym_type, oc) +- ) { +- goto fail; +- } +- oc->symbols[curSymbol].name = nm; +- oc->symbols[curSymbol].addr = symbol->addr; +- oc->symbols[curSymbol].type = sym_type; +- curSymbol++; +- } +- } else { +- /* Skip. */ ++ /* Skip. */ + IF_DEBUG(linker_verbose, + debugBelch("skipping `%s'\n", + nm) + ); +- + /* + debugBelch( + "skipping bind = %d, type = %d, secno = %d `%s'\n", +@@ -1110,7 +1111,34 @@ ocGetNames_ELF ( ObjectCode* oc ) + nm + ); + */ ++ continue; + } ++ ++ SymType sym_type; ++ if (ELF_ST_TYPE(symbol->elf_sym->st_info) == STT_FUNC) { ++ sym_type = SYM_TYPE_CODE; ++ } else { ++ sym_type = SYM_TYPE_DATA; ++ } ++ ++ /* And the decision is ... */ ++ CHECK(nm != NULL); ++ /* Acquire! */ ++ if (!isLocal) { ++ ++ if (isWeak == HS_BOOL_TRUE) { ++ setWeakSymbol(oc, nm); ++ } ++ if (!ghciInsertSymbolTable(oc->fileName, symhash, ++ nm, symbol->addr, isWeak, sym_type, oc) ++ ) { ++ goto fail; ++ } ++ oc->symbols[curSymbol].name = nm; ++ oc->symbols[curSymbol].addr = symbol->addr; ++ oc->symbols[curSymbol].type = sym_type; ++ curSymbol++; ++ } + } + } + } +diff --git a/rts/linker/elf_plt.c b/rts/linker/elf_plt.c +index 5c6ef8ed44..314d49cbc6 100644 +--- a/rts/linker/elf_plt.c ++++ b/rts/linker/elf_plt.c +@@ -1,4 +1,5 @@ + #include "Rts.h" ++#include "RtsUtils.h" + #include "elf_plt.h" + + #include +@@ -51,7 +52,7 @@ makeStub(Section * section, + void* * addr, + uint8_t flags) { + +- Stub * s = calloc(1, sizeof(Stub)); ++ Stub * s = stgCallocBytes(1, sizeof(Stub), "makeStub"); + ASSERT(s != NULL); + s->target = *addr; + s->flags = flags; +diff --git a/rts/linker/elf_plt_aarch64.c b/rts/linker/elf_plt_aarch64.c +index 11354a63db..6b27a2c73d 100644 +--- a/rts/linker/elf_plt_aarch64.c ++++ b/rts/linker/elf_plt_aarch64.c +@@ -25,6 +25,7 @@ const size_t stubSizeAarch64 = 5 * 4; + */ + bool needStubForRelAarch64(Elf_Rel * rel) { + switch(ELF64_R_TYPE(rel->r_info)) { ++ case COMPAT_R_AARCH64_CONDBR19: + case COMPAT_R_AARCH64_CALL26: + case COMPAT_R_AARCH64_JUMP26: + return true; +@@ -34,6 +35,7 @@ bool needStubForRelAarch64(Elf_Rel * rel) { + } + bool needStubForRelaAarch64(Elf_Rela * rela) { + switch(ELF64_R_TYPE(rela->r_info)) { ++ case COMPAT_R_AARCH64_CONDBR19: + case COMPAT_R_AARCH64_CALL26: + case COMPAT_R_AARCH64_JUMP26: + return true; +diff --git a/rts/linker/elf_reloc_aarch64.c b/rts/linker/elf_reloc_aarch64.c +index 51d7178094..dc0724c4f1 100644 +--- a/rts/linker/elf_reloc_aarch64.c ++++ b/rts/linker/elf_reloc_aarch64.c +@@ -105,8 +105,24 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) { + break; + } + /* - control flow relocations */ ++ case COMPAT_R_AARCH64_CONDBR19: { /* relocate b.* ... */ ++ // 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ++ // 0 1 0 1 0 1 0 0 [ imm19 ... ++ // ++ // 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ++ // ... imm19 ] 0 [ cond ] ++ CHECK(isInt64(19+2, addend)); /* X in range */ ++ *(inst_t *)P = (*(inst_t *)P & 0xff00001f) ++ | ((uint32_t)(addend << (5-2)) & 0x00ffffe0); ++ break; ++ } + case COMPAT_R_AARCH64_JUMP26: /* relocate b ... */ + case COMPAT_R_AARCH64_CALL26: { /* relocate bl ... */ ++ // 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ++ // 0|1 0 0 1 0 1 [ imm26 ... ++ ++ // 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ++ // ... imm26 ] + CHECK(isInt64(26+2, addend)); /* X in range */ + *(inst_t *)P = (*(inst_t *)P & 0xfc000000) /* keep upper 6 (32-6) + * bits */ +@@ -222,6 +238,23 @@ computeAddend(Section * section, Elf_Rel * rel, + case COMPAT_R_AARCH64_ADD_ABS_LO12_NC: + /* type: static, class: aarch64, op: S + A */ + return (S + A) & 0xfff; ++ case COMPAT_R_AARCH64_CONDBR19: { ++ int64_t V = S + A - P; ++ if(!isInt64(19+2, V)) { ++ /* need a stub */ ++ /* check if we already have that stub */ ++ if(findStub(section, (void**)&S, 0)) { ++ /* did not find it. Crete a new stub. */ ++ if(makeStub(section, (void**)&S, 0)) { ++ abort(/* could not find or make stub */); ++ } ++ } ++ ++ V = S + A -P; ++ assert(isInt64(19+2, V)); ++ } ++ return V; ++ } + case COMPAT_R_AARCH64_JUMP26: + case COMPAT_R_AARCH64_CALL26: { + // S+A-P diff --git a/overlays/patches/ghc/ghc-define-undefined-elf-st-visibility.patch b/overlays/patches/ghc/ghc-define-undefined-elf-st-visibility.patch new file mode 100644 index 0000000000..bd3b3ea604 --- /dev/null +++ b/overlays/patches/ghc/ghc-define-undefined-elf-st-visibility.patch @@ -0,0 +1,24 @@ +diff --git a/rts/linker/ElfTypes.h b/rts/linker/ElfTypes.h +index f5e2f819d9..7f75087738 100644 +--- a/rts/linker/ElfTypes.h ++++ b/rts/linker/ElfTypes.h +@@ -33,6 +33,9 @@ + #define Elf_Sym Elf64_Sym + #define Elf_Rel Elf64_Rel + #define Elf_Rela Elf64_Rela ++#if !defined(ELF64_ST_VISIBILITY) ++#define ELF64_ST_VISIBILITY(o) ((o)&0x3) ++#endif + #if !defined(ELF_ST_VISIBILITY) + #define ELF_ST_VISIBILITY ELF64_ST_VISIBILITY + #endif +@@ -60,6 +63,9 @@ + #define Elf_Sym Elf32_Sym + #define Elf_Rel Elf32_Rel + #define Elf_Rela Elf32_Rela ++#if !defined(ELF32_ST_VISIBILITY) ++#define ELF32_ST_VISIBILITY(o) ((o)&0x3) ++#endif + #if !defined(ELF_ST_VISIBILITY) + #define ELF_ST_VISIBILITY ELF32_ST_VISIBILITY + #endif /* ELF_ST_VISIBILITY */ diff --git a/overlays/patches/ghc/libc-memory-symbols-armv7a.patch b/overlays/patches/ghc/libc-memory-symbols-armv7a.patch new file mode 100644 index 0000000000..c705bdda8f --- /dev/null +++ b/overlays/patches/ghc/libc-memory-symbols-armv7a.patch @@ -0,0 +1,42 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 062159f..727fe74 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -340,6 +340,20 @@ int ghciInsertSymbolTable( + call this function again to trigger the duplicate error. */ + return 1; + } ++ else if(strncmp(key, "fprintf", 7) == 0 ++ || strncmp(key, "printf", 6) == 0 ++ || strncmp(key, "sprintf", 7) == 0 ++ || strncmp(key, "snprintf", 8) == 0 ++ || strncmp(key, "getauxval", 9) == 0 ++ || strncmp(key, "free", 4) == 0 ++ || strncmp(key, "malloc", 6) == 0 ++ || strncmp(key, "calloc", 6) == 0 ++ || strncmp(key, "realloc", 7) == 0 ++ || strncmp(key, "reallocarray", 12) == 0 ++ ) { ++ /* symbols we link aginst the libc we link ghc or iserv against */ ++ return 1; ++ } + + pathchar* archiveName = NULL; + debugBelch( +diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c +index 2acd634..b86b516 100644 +--- a/rts/RtsSymbols.c ++++ b/rts/RtsSymbols.c +@@ -1039,7 +1039,11 @@ + SymI_HasProto(printf) \ + SymI_HasProto(fprintf) \ + SymI_HasProto(sprintf) \ +- SymI_HasProto(snprintf) ++ SymI_HasProto(snprintf) \ ++ SymI_HasProto(free) \ ++ SymI_HasProto(malloc) \ ++ SymI_HasProto(calloc) \ ++ SymI_HasProto(realloc) + #else + #define RTS_STACK_PROTECTOR_SYMBOLS + #define RTS_LIBC_SYMBOLS \ No newline at end of file diff --git a/overlays/patches/ghc/libraries-prim-os-android-armv7a.patch b/overlays/patches/ghc/libraries-prim-os-android-armv7a.patch new file mode 100644 index 0000000000..23274bf737 --- /dev/null +++ b/overlays/patches/ghc/libraries-prim-os-android-armv7a.patch @@ -0,0 +1,13 @@ +diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal +index 2bd51c0..aeaeacc 100644 +--- a/libraries/ghc-prim/ghc-prim.cabal ++++ b/libraries/ghc-prim/ghc-prim.cabal +@@ -67,7 +67,7 @@ Library + -- on Windows. Required because of mingw32. + extra-libraries: user32, mingw32, mingwex + +- if os(linux) ++ if os(linux) || os(android) || os(linux-android) + -- we need libm, but for musl and other's we might need libc, as libm + -- is just an empty shell. + extra-libraries: c, m diff --git a/overlays/patches/iserv-proxy-interpreter-9.3-android.patch b/overlays/patches/iserv-proxy-interpreter-9.3-android.patch index 12f3dda3fe..380698c571 100644 --- a/overlays/patches/iserv-proxy-interpreter-9.3-android.patch +++ b/overlays/patches/iserv-proxy-interpreter-9.3-android.patch @@ -3,7 +3,8 @@ new file mode 100644 index 0000000..d447895 --- /dev/null +++ b/cbits/symbols.c -@@ -0,0 +1,318 @@ +@@ -0,0 +1,327 @@ ++#define BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD +#include +#include +#include @@ -68,6 +69,9 @@ index 0000000..d447895 +extern void __subtf3(void); +extern void __trunctfdf2(void); + ++extern void flock(void); ++extern void times(void); ++ +#define MISSING_FUN(f) void (f)(void) { printf("Unknown call to `%s'\n", #f); exit(1); } + +MISSING_FUN(c_format_unix_time) @@ -173,6 +177,7 @@ index 0000000..d447895 + SYM(stdout), + SYM(strftime), + SYM(utimes), ++ SYM(times), + SYM(setenv), + SYM(fpathconf), + SYM(exit), @@ -230,6 +235,7 @@ index 0000000..d447895 + SYM(openat),SYM(__open_2), + // string.h + SYM(strerror), ++ SYM(strerror_r), + SYM(strcmp), + SYM(memchr),SYM(strcpy),SYM(strchr),SYM(strncpy),SYM(strrchr), + SYM(strcat),SYM(strncmp),SYM(strdup), @@ -266,6 +272,7 @@ index 0000000..d447895 + SYM(fprintf), + SYM(vfprintf), + SYM(fopen), SYM(fclose), ++ SYM(flock), + SYM(getegid),SYM(getgid), + SYM(getpwent), + SYM(getgrent), @@ -283,6 +290,7 @@ index 0000000..d447895 + SYM(ferror), + SYM(fflush), + SYM(fgets),SYM(fputc),SYM(fputs), ++ SYM(puts), + SYM(fseek),SYM(ftell), + SYM(sscanf), + SYM(shutdown), @@ -316,6 +324,7 @@ index 0000000..d447895 + SYM(__multf3), + SYM(__subtf3), + SYM(__trunctfdf2), ++ SYM(getrusage), + { 0, 0, STRENGTH_NORMAL, 1 } /* sentinel */ +}; + @@ -324,14 +333,17 @@ index 0000000..d447895 +} \ No newline at end of file diff --git a/iserv-proxy.cabal b/iserv-proxy.cabal -index a0eeaeb..a146108 100644 +index 5f1449a..328b000 100644 --- a/iserv-proxy.cabal +++ b/iserv-proxy.cabal -@@ -103,6 +103,7 @@ Executable iserv-proxy +@@ -106,9 +106,7 @@ Executable iserv-proxy-interpreter -- We need to pass -fkeep-cafs to ensure that the interpreter retains CAFs -- Iserv and GHC do something similar. ghc-options: -fkeep-cafs +- -- no idea how to check for musl :-/ +- if os(linux) && arch(aarch64) +- c-sources: cbits/symbols.aarch64-musl.c + c-sources: cbits/symbols.c + Build-Depends: base >= 4 && < 5, iserv-proxy - diff --git a/overlays/patches/iserv-proxy-interpreter-9.3-android32.patch b/overlays/patches/iserv-proxy-interpreter-9.3-android32.patch index 7aeba03e07..46b20c378b 100644 --- a/overlays/patches/iserv-proxy-interpreter-9.3-android32.patch +++ b/overlays/patches/iserv-proxy-interpreter-9.3-android32.patch @@ -3,7 +3,7 @@ new file mode 100644 index 0000000..9974c73 --- /dev/null +++ b/cbits/symbols.c -@@ -0,0 +1,447 @@ +@@ -0,0 +1,456 @@ +#include +#include +#include @@ -167,6 +167,9 @@ index 0000000..9974c73 +extern void mmap64(void); +extern void mremap(void); +extern void readlink(void); ++extern void flock(void); ++extern void times(void); ++extern void getrusage(void); + +#define MISSING_FUN(f) void (f)(void) { printf("Unknown call to %s\n", #f); exit(1); } + @@ -237,6 +240,7 @@ index 0000000..9974c73 + SYM(raise), + SYM(strcmp), + SYM(strerror), ++ SYM(setenv), + SYM(unsetenv), + SYM(waitpid), + SYM(dup2), @@ -445,6 +449,11 @@ index 0000000..9974c73 + SYM(mmap64), + SYM(mremap), + SYM(readlink), ++ SYM(times), ++ SYM(strerror_r), ++ SYM(flock), ++ SYM(puts), ++ SYM(getrusage), + { 0, 0, STRENGTH_NORMAL, 1 } /* sentinel */ +}; + @@ -453,14 +462,17 @@ index 0000000..9974c73 +} \ No newline at end of file diff --git a/iserv-proxy.cabal b/iserv-proxy.cabal -index eca2047..51a125b 100644 +index 5f1449a..328b000 100644 --- a/iserv-proxy.cabal +++ b/iserv-proxy.cabal -@@ -104,6 +104,7 @@ Executable iserv-proxy-interpreter +@@ -106,9 +106,7 @@ Executable iserv-proxy-interpreter -- We need to pass -fkeep-cafs to ensure that the interpreter retains CAFs -- Iserv and GHC do something similar. ghc-options: -fkeep-cafs +- -- no idea how to check for musl :-/ +- if os(linux) && arch(aarch64) +- c-sources: cbits/symbols.aarch64-musl.c + c-sources: cbits/symbols.c + Build-Depends: base >= 4 && < 5, iserv-proxy - diff --git a/overlays/windows.nix b/overlays/windows.nix index 3df413b940..a1891268f3 100644 --- a/overlays/windows.nix +++ b/overlays/windows.nix @@ -50,7 +50,7 @@ final: prev: inherit (pkgs.pkgsBuildBuild) symlinkJoin; # iserv-proxy needs to come from the buildPackages, as it needs to run on the # build host. - inherit (final.haskell-nix.iserv-proxy-exes.${config.compiler.nix-name}) iserv-proxy iserv-proxy-interpreter; + inherit (final.haskell-nix.iserv-proxy-exes.${config.compiler.nix-name}) iserv-proxy iserv-proxy-interpreter iserv-proxy-interpreter-prof; } // { # we can perform testing of cross compiled test-suites by using wine. # Therefore let's enable doCrossCheck here! diff --git a/scripts/check-compiler-materialization/default.nix b/scripts/check-compiler-materialization/default.nix index 3cb71d0b1d..477474c028 100644 --- a/scripts/check-compiler-materialization/default.nix +++ b/scripts/check-compiler-materialization/default.nix @@ -19,32 +19,22 @@ in builtins.listToAttrs (builtins.concatMap (system: builtins.concatMap (compile # given GHC version are checked. { name = "${prefix}-extra"; value = (pkgs.haskell-nix.roots' compiler-nix-name).ghc-extra-projects-nix or {}; } { name = "${prefix}-boot"; value = pkgs.ghc-boot-packages-nix.${compiler-nix-name}; } - { name = "${prefix}-iserv"; value = pkgs.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy.project.plan-nix; } - { name = "${prefix}-iserv-int"; value = pkgs.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy-interpreter.project.plan-nix; } { name = "${prefix}-hello"; value = (pkgs.haskell-nix.tool compiler-nix-name "hello" {}).project.plan-nix; } ] ++ eval.lib.optionals (!__elem system ["aarch64-darwin" "aarch64-linux" "x86_64-darwin"]) [ { name = "${prefix}-windows"; value = (pkgsForWindows.pkgsCross.mingwW64.haskell-nix.roots' compiler-nix-name).ghc-extra-projects-nix or {}; } - { name = "${prefix}-iserv-windows"; value = pkgsForWindows.pkgsCross.mingwW64.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy.project.plan-nix; } - { name = "${prefix}-iserv-int-windows"; value = pkgsForWindows.pkgsCross.mingwW64.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy-interpreter.project.plan-nix; } { name = "${prefix}-hello-windows"; value = (pkgsForWindows.pkgsCross.mingwW64.haskell-nix.tool compiler-nix-name "hello" {}).project.plan-nix; } ] ++ eval.lib.optionals (system == "x86_64-linux") [ # In some cased you may need comment out one or more of these if the GHC version needed cannot be built. { name = "${prefix}-musl"; value = (pkgs.pkgsCross.musl64.haskell-nix.roots' compiler-nix-name).ghc-extra-projects-nix or {}; } - { name = "${prefix}-iserv-musl"; value = pkgs.pkgsCross.musl64.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy.project.plan-nix; } - { name = "${prefix}-iserv-int-musl"; value = pkgs.pkgsCross.musl64.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy-interpreter.project.plan-nix; } { name = "${prefix}-hello-musl"; value = (pkgs.pkgsCross.musl64.haskell-nix.tool compiler-nix-name "hello" {}).project.plan-nix; } ] ++ eval.lib.optionals (system == "x86_64-linux" && !__elem compiler-nix-name ["ghc901" "ghc921" "ghc941" "ghc942" "ghc943"]) [ { name = "${prefix}-arm"; value = (pkgs.pkgsCross.aarch64-multiplatform.haskell-nix.roots' compiler-nix-name).ghc-extra-projects-nix or {}; } - { name = "${prefix}-iserv-arm"; value = pkgs.pkgsCross.aarch64-multiplatform.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy.project.plan-nix; } - { name = "${prefix}-iserv-int-arm"; value = pkgs.pkgsCross.aarch64-multiplatform.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy-interpreter.project.plan-nix; } { name = "${prefix}-hello-arm"; value = (pkgs.pkgsCross.aarch64-multiplatform.haskell-nix.tool compiler-nix-name "hello" {}).project.plan-nix; } ] ++ eval.lib.optionals ( (system == "aarch64-linux" && !__elem compiler-nix-name ["ghc8107" "ghc901" "ghc902" "ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926" "ghc941" "ghc942" "ghc943"]) || (system == "x86_64-linux" && !__elem compiler-nix-name ["ghc8107" "ghc901" "ghc902" "ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926" "ghc941" "ghc942" "ghc943" "ghc944" "ghc945" "ghc947" "ghc961" "ghc962" "ghc963" "ghc964" "ghc965"])) [ { name = "${prefix}-arm-musl"; value = (pkgs.pkgsCross.aarch64-multiplatform-musl.haskell-nix.roots' compiler-nix-name).ghc-extra-projects-nix or {}; } - { name = "${prefix}-iserv-arm-musl"; value = pkgs.pkgsCross.aarch64-multiplatform-musl.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy.project.plan-nix; } - { name = "${prefix}-iserv-int-arm-musl"; value = pkgs.pkgsCross.aarch64-multiplatform-musl.haskell-nix.iserv-proxy-exes.${compiler-nix-name}.iserv-proxy-interpreter.project.plan-nix; } { name = "${prefix}-hello-arm-musl"; value = (pkgs.pkgsCross.aarch64-multiplatform-musl.haskell-nix.tool compiler-nix-name "hello" {}).project.plan-nix; } ] ++ eval.lib.optionals ( (system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc961" "ghc962" "ghc963" "ghc964" "ghc965" "ghc981" "ghc982" "ghc983" "ghc984" "ghc9101"]) diff --git a/test/annotations/default.nix b/test/annotations/default.nix index b41a6b1bd8..3082edbdd6 100644 --- a/test/annotations/default.nix +++ b/test/annotations/default.nix @@ -11,7 +11,9 @@ let in recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isGhcjs # Failed to lookup symbol: __aarch64_swp8_acq_rel - || (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64); + || (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64) + # unhandled ELF relocation(Rel) type 10 + || (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32); ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/cabal-simple-debug/default.nix b/test/cabal-simple-debug/default.nix index 9344f08a54..7b02425276 100644 --- a/test/cabal-simple-debug/default.nix +++ b/test/cabal-simple-debug/default.nix @@ -15,7 +15,7 @@ let in recurseIntoAttrs { # DWARF only works on linux with GHC 8.10.2 and newer # GHC 9.2.1 disabled because of https://github.com/input-output-hk/haskell.nix/issues/1332 - meta.disabled = __elem compiler-nix-name ["ghc865" "ghc884" "ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926" "ghc927"] + meta.disabled = __elem compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926" "ghc927"] || !stdenv.hostPlatform.isLinux || haskellLib.isCrossHost || stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isAarch64 || lib.hasSuffix "llvm" compiler-nix-name; ifdInputs = { diff --git a/test/cabal-simple-prof/default.nix b/test/cabal-simple-prof/default.nix index ac747f4887..4e7e4f93e1 100644 --- a/test/cabal-simple-prof/default.nix +++ b/test/cabal-simple-prof/default.nix @@ -25,6 +25,9 @@ let inherit modules; }; + exe = (project.getComponent "cabal-simple:exe:cabal-simple") + .override (lib.optionalAttrs stdenv.hostPlatform.isAndroid { setupBuildFlags = ["--ghc-option=-optl-static" ]; }); + in recurseIntoAttrs { # This test seeems to be broken on 8.6 and 8.8 and ghcjs meta.disabled = compiler-nix-name == "ghc865" || compiler-nix-name == "ghc884" || stdenv.hostPlatform.isGhcjs; @@ -35,7 +38,7 @@ in recurseIntoAttrs { name = "cabal-simple-prof-test"; buildCommand = '' - exe="${(project.getComponent "cabal-simple:exe:cabal-simple").exePath}" + exe="${exe.exePath}" size=$(command stat --format '%s' "$exe") printf "size of executable $exe is $size. \n" >& 2 @@ -45,7 +48,7 @@ in recurseIntoAttrs { # Curiosity: cross compilers prodcing profiling with `+RTS -p -h` lead to the following cryptic message: # cabal-simple: invalid heap profile option: -h* # Hence we pass `-hc`. - ${toString (project.getComponent "cabal-simple:exe:cabal-simple").config.testWrapper} $exe +RTS -p -hc + ${toString exe.config.testWrapper} $exe +RTS -p -hc touch $out ''; diff --git a/test/coverage/default.nix b/test/coverage/default.nix index 2c5329631a..70ea3d9618 100644 --- a/test/coverage/default.nix +++ b/test/coverage/default.nix @@ -26,7 +26,9 @@ let in recurseIntoAttrs ({ # Does not work on ghcjs because it needs zlib. - meta.disabled = stdenv.hostPlatform.isGhcjs; + meta.disabled = stdenv.hostPlatform.isGhcjs + # For some reason the `.tix` file is not created on armv7a android (not sure why) + || stdenv.hostPlatform.isAndroid && stdenv.hostPlatform.isAarch32; run = stdenv.mkDerivation { name = "coverage-test"; diff --git a/test/ghcjs-overlay/default.nix b/test/ghcjs-overlay/default.nix index 37ce2e06c7..0f3a874b1b 100644 --- a/test/ghcjs-overlay/default.nix +++ b/test/ghcjs-overlay/default.nix @@ -41,7 +41,6 @@ in recurseIntoAttrs { touch $out ''; meta.platforms = platforms.all; - meta.disabled = haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64; passthru = { inherit project; }; diff --git a/test/gi-gtk/default.nix b/test/gi-gtk/default.nix index 7365e1ae7f..cdab43a1bb 100644 --- a/test/gi-gtk/default.nix +++ b/test/gi-gtk/default.nix @@ -25,7 +25,9 @@ in recurseIntoAttrs rec { # error: incompatible pointer to integer conversion assigning to 'ffi_arg' (aka 'unsigned long') from 'HsPtr' (aka 'void *') [-Wint-conversion] || builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc928" "ghc948"] && stdenv.hostPlatform.isAarch64 # Cross compilation to aarch64 is also broken - || stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64; + || stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64 + # glu is marked ase broken for isAndroid + || stdenv.hostPlatform.isAndroid; ifdInputs = { inherit (project) plan-nix; diff --git a/test/haskell-language-server/cabal.nix b/test/haskell-language-server/cabal.nix index f2894dab3f..3d1e5c378b 100644 --- a/test/haskell-language-server/cabal.nix +++ b/test/haskell-language-server/cabal.nix @@ -1,10 +1,15 @@ -{ stdenv, testSrc, haskell-nix, compiler-nix-name, evalPackages, recurseIntoAttrs, buildPackages }: +{ lib, stdenv, testSrc, haskell-nix, compiler-nix-name, evalPackages, recurseIntoAttrs, buildPackages }: let project = haskell-nix.cabalProject' { inherit compiler-nix-name evalPackages; name = "haskell-language-server"; - src = haskell-nix.sources."hls-2.9"; + src = haskell-nix.sources.hls; configureArgs = "--disable-benchmarks --disable-tests"; # This makes cabalProject' more like the `tool` function + cabalProjectLocal = '' + if impl(ghc >=9.6.7) && impl(ghc <9.7) || impl(ghc >=9.8.3) + constraints: ghc-lib-parser >=9.8.4 + allow-older: ghc-lib-parser:filepath + ''; }; in recurseIntoAttrs { ifdInputs = { @@ -16,6 +21,5 @@ in recurseIntoAttrs { meta.disabled = stdenv.hostPlatform != stdenv.buildPlatform || __compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.0.1" < 0 - || __compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.11.0" >= 0 - || __elem compiler-nix-name ["ghc983" "ghc984"]; + || __compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.11.0" >= 0; } diff --git a/test/js-template-haskell/default.nix b/test/js-template-haskell/default.nix index c5663e8ad4..a21c64704d 100644 --- a/test/js-template-haskell/default.nix +++ b/test/js-template-haskell/default.nix @@ -23,12 +23,18 @@ in recurseIntoAttrs { inherit (project) plan-nix; }; - meta.disabled = stdenv.buildPlatform != stdenv.hostPlatform && stdenv.hostPlatform.isAarch64 - || builtins.elem compiler-nix-name ["ghc91320241204"]; + meta.disabled = builtins.elem compiler-nix-name ["ghc91320241204"] + # unhandled ELF relocation(Rel) type 10 + || (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32); build = packages.js-template-haskell.components.library; check = packages.js-template-haskell.checks.test; -} // optionalAttrs (!stdenv.hostPlatform.isGhcjs) { +} // optionalAttrs (!( + stdenv.hostPlatform.isGhcjs + || (stdenv.hostPlatform.isAarch64 + && stdenv.hostPlatform.isMusl + && compiler-nix-name == "ghc9101") + )) { build-profiled = packages.js-template-haskell.components.library.profiled; check-profiled = packages.js-template-haskell.checks.test.profiled; } diff --git a/test/modules.nix b/test/modules.nix index 83b100fcfc..abe19e0dcb 100644 --- a/test/modules.nix +++ b/test/modules.nix @@ -1,4 +1,10 @@ [{ # See https://github.com/haskell-cryptography/HsOpenSSL/issues/95 packages.HsOpenSSL.ghcOptions = ["-optc=-Wno-incompatible-pointer-types"]; -}] +} + +({pkgs, lib, ...}: lib.mkIf pkgs.stdenv.hostPlatform.isAndroid { + packages.libsodium.configureFlags = [ "--c2hs-option=--cppopts=-D_Null_unspecified=" ]; + packages.libsodium.components.library.hardeningDisable = ["fortify"]; +}) +] diff --git a/test/plugin/default.nix b/test/plugin/default.nix index a20d95964c..ae64225d96 100644 --- a/test/plugin/default.nix +++ b/test/plugin/default.nix @@ -24,6 +24,6 @@ in recurseIntoAttrs { || stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWindows - || (haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64); + || (haskellLib.isCrossHost && (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32)); build = packages.test.components.library; } diff --git a/test/shell-for/default.nix b/test/shell-for/default.nix index 966beba5b6..11bad7dbae 100644 --- a/test/shell-for/default.nix +++ b/test/shell-for/default.nix @@ -56,7 +56,7 @@ in recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWindows - || (haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64); + || (haskellLib.isCrossHost && (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32)); inherit env envPkga envDefault; run = stdenv.mkDerivation { name = "shell-for-test"; diff --git a/test/th-dlls/default.nix b/test/th-dlls/default.nix index 38366f462f..8e7f0b0a59 100644 --- a/test/th-dlls/default.nix +++ b/test/th-dlls/default.nix @@ -26,6 +26,8 @@ in recurseIntoAttrs { || (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64) # We have been unable to get windows cross compilation of th-orphans to work for GHC 8.10 using the latest nixpkgs || (compiler-nix-name == "ghc8107" && stdenv.hostPlatform.isWindows) + # unhandled ELF relocation(Rel) type 10 + || (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) ; ifdInputs = { @@ -37,7 +39,7 @@ in recurseIntoAttrs { build-ei = packages-ei.th-dlls.components.library; just-template-haskell-ei = packages-ei.th-dlls.components.exes.just-template-haskell; } // optionalAttrs - (!(builtins.elem compiler-nix-name ["ghc984" "ghc9121" "ghc912120241215" "ghc91320241230"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)) { + (!(builtins.elem compiler-nix-name ["ghc984" "ghc9121" "ghc912120241215" "ghc91320241230" "ghc912120250219"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)) { # On for aarch64 cross compile on GHC this test is fails sometimes for non profiled builds # (and always for the profiled builds). # This may be related to the memory allocation changes made in 9.8.4 that