Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into armv7a
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Dec 18, 2024
2 parents 134d69a + 618d266 commit 827008f
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 26 deletions.
12 changes: 6 additions & 6 deletions flake.lock

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

30 changes: 11 additions & 19 deletions lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }:
{ pkgs, cacert, index-state-hashes, haskellLib }:
{ name ? src.name or null # optional name for better error messages
, src
, materialized-dir ? ../materialized
Expand All @@ -14,7 +14,6 @@
, cabalProjectFreeze ? null
, caller ? "callCabalProjectToNix" # Name of the calling function for better warning messages
, compilerSelection ? p: p.haskell-nix.compiler
, ghc ? null # Deprecated in favour of `compiler-nix-name`
, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
# `--enable-tests --enable-benchmarks` are included by default.
Expand Down Expand Up @@ -74,29 +73,22 @@ let
nix-tools = if args.nix-tools or null != null
then args.nix-tools
else evalPackages.haskell-nix.nix-tools-unchecked;
forName = pkgs.lib.optionalString (name != null) (" for " + name);

nameAndSuffix = suffix: if name == null then suffix else name + "-" + suffix;

ghc' =
if ghcOverride != null
then ghcOverride
else
if ghc != null
then __trace ("WARNING: A `ghc` argument was passed" + forName
+ " this has been deprecated in favour of `compiler-nix-name`. "
+ "Using `ghc` will break cross compilation setups, as haskell.nix cannot "
+ "pick the correct `ghc` package from the respective buildPackages. "
+ "For example, use `compiler-nix-name = \"ghc865\";` for GHC 8.6.5.") ghc
else
# Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
# call to this file. And thus `pkgs` here is the proper `buildPackages`
# set and we do not need, nor should pick the compiler from another level
# of `buildPackages`, lest we want to get confusing errors about the Win32
# package.
#
# > The option `packages.Win32.package.identifier.name' is used but not defined.
#
(compilerSelection pkgs)."${compiler-nix-name}";
# Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
# call to this file. And thus `pkgs` here is the proper `buildPackages`
# set and we do not need, nor should pick the compiler from another level
# of `buildPackages`, lest we want to get confusing errors about the Win32
# package.
#
# > The option `packages.Win32.package.identifier.name' is used but not defined.
#
(compilerSelection pkgs)."${compiler-nix-name}";

in let
ghc = if ghc' ? latestVersion
Expand Down
3 changes: 3 additions & 0 deletions overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ in {

# Fix issue loading windows dll using `.dll.a` file
++ onWindows (fromUntil "9.4" "9.14" ./patches/ghc/ghc-9.10-windows-dll-dependent-symbol-type-fix.patch)

# See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13709
++ fromUntil "9.8.4" "9.8.5" ./patches/ghc/ghc-9.8.4-remove-unused-containers-h-include13709.diff
;
in ({
ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc {
Expand Down
2 changes: 1 addition & 1 deletion overlays/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ final: prev: {
index-state-hashes = import indexStateHashesPath;
inherit (final.buildPackages.haskell-nix) haskellLib;
pkgs = final.buildPackages.pkgs;
inherit (final.buildPackages.pkgs) runCommand cacert;
inherit (final.buildPackages.pkgs) cacert;
};

# Loads a plan and filters the package directories using cleanSourceWith
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
diff --git a/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py b/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
index 6d97bda61c3037cecbe5f7fad42115927aa1a787..90b52076f37089e9bce8c1a55d49f757a6d178ff 100755
--- a/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
+++ b/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
@@ -36,6 +36,7 @@ import os
import yaml
import gitlab
from urllib.request import urlopen
+from urllib.parse import urlparse
import hashlib
import sys
import json
@@ -80,7 +81,7 @@ source_artifact = Artifact('source-tarball'
test_artifact = Artifact('source-tarball'
, 'ghc-{version}-testsuite.tar.xz'
, 'ghc-{version}-testsuite.tar.xz'
- , 'ghc-{version}' )
+ , 'ghc-{version}/testsuite' )

def debian(arch, n):
return linux_platform(arch, "{arch}-linux-deb{n}".format(arch=arch, n=n))
@@ -156,13 +157,18 @@ def mk_one_metadata(release_mode, version, job_map, artifact):
eprint(f"Bindist URL: {url}")
eprint(f"Download URL: {final_url}")

- #Download and hash from the release pipeline, this must not change anyway during upload.
+ # Download and hash from the release pipeline, this must not change anyway during upload.
h = download_and_hash(url)

res = { "dlUri": final_url
, "dlSubdir": artifact.subdir.format(version=version)
- , "dlOutput": artifact.output_name.format(version=version)
, "dlHash" : h }
+
+ # Only add dlOutput if it is inconsistent with the filename inferred from the URL
+ output = artifact.output_name.format(version=version)
+ if Path(urlparse(final_url).path).name != output:
+ res["dlOutput"] = output
+
eprint(res)
return res

diff --git a/compiler/GHC/Data/Word64Map.hs b/compiler/GHC/Data/Word64Map.hs
index 3893313b5e9e79748f7595ecc1cb03c6536fa54f..b5034ca9f528d77c5571f4bd771edc5e6184d8c5 100644
--- a/compiler/GHC/Data/Word64Map.hs
+++ b/compiler/GHC/Data/Word64Map.hs
@@ -8,7 +8,6 @@
{-# LANGUAGE MonoLocalBinds #-}
#endif

-#include "containers.h"

-----------------------------------------------------------------------------
-- |
diff --git a/compiler/GHC/Data/Word64Map/Internal.hs b/compiler/GHC/Data/Word64Map/Internal.hs
index 6e60b7f5464aba8f4971ab876ccc698c2415b997..9dd92fb9efdd4b9f402cc595ca1e326bd60803dd 100644
--- a/compiler/GHC/Data/Word64Map/Internal.hs
+++ b/compiler/GHC/Data/Word64Map/Internal.hs
@@ -14,7 +14,6 @@
{-# OPTIONS_HADDOCK not-home #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

-#include "containers.h"

-----------------------------------------------------------------------------
-- |
diff --git a/compiler/GHC/Data/Word64Map/Lazy.hs b/compiler/GHC/Data/Word64Map/Lazy.hs
index 0df84842e2a7ce2c6aacb91c404b8a8f3f5c512e..0c09f62937f4115f50cced65f0ba3c35090c2f7b 100644
--- a/compiler/GHC/Data/Word64Map/Lazy.hs
+++ b/compiler/GHC/Data/Word64Map/Lazy.hs
@@ -3,7 +3,6 @@
{-# LANGUAGE Safe #-}
#endif

-#include "containers.h"

-----------------------------------------------------------------------------
-- |
diff --git a/compiler/GHC/Data/Word64Map/Strict.hs b/compiler/GHC/Data/Word64Map/Strict.hs
index 4de68d7f7c39560fffd7c5935042446311054574..ab7c1471fba741ab070f3ee47a0e13ccd7b615d1 100644
--- a/compiler/GHC/Data/Word64Map/Strict.hs
+++ b/compiler/GHC/Data/Word64Map/Strict.hs
@@ -4,8 +4,6 @@
{-# LANGUAGE Trustworthy #-}
#endif

-#include "containers.h"
-
-----------------------------------------------------------------------------
-- |
-- Module : Data.Word64Map.Strict
diff --git a/compiler/GHC/Data/Word64Map/Strict/Internal.hs b/compiler/GHC/Data/Word64Map/Strict/Internal.hs
index 1605565c9fd7a527fac61dbf162ce0a805f4f920..d998e6b6a9778e4aa3750d01b8b38a7a3eb6f104 100644
--- a/compiler/GHC/Data/Word64Map/Strict/Internal.hs
+++ b/compiler/GHC/Data/Word64Map/Strict/Internal.hs
@@ -4,8 +4,6 @@

{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

-#include "containers.h"
-
-----------------------------------------------------------------------------
-- |
-- Module : Data.Word64Map.Strict.Internal
diff --git a/compiler/GHC/Data/Word64Set.hs b/compiler/GHC/Data/Word64Set.hs
index 81cfcbd4efbab00fc203a5da905c0c0ccd9abb11..3c5c047d948e339de596d0fc729ae0534a229b7a 100644
--- a/compiler/GHC/Data/Word64Set.hs
+++ b/compiler/GHC/Data/Word64Set.hs
@@ -3,8 +3,6 @@
{-# LANGUAGE Safe #-}
#endif

-#include "containers.h"
-
-----------------------------------------------------------------------------
-- |
-- Module : Data.Word64Set
diff --git a/compiler/GHC/Data/Word64Set/Internal.hs b/compiler/GHC/Data/Word64Set/Internal.hs
index b2df095adfb1f363ed0fdfebc1516c5b699b8106..569c312840a4bd8cadefb05a0e29210eef75d2c5 100644
--- a/compiler/GHC/Data/Word64Set/Internal.hs
+++ b/compiler/GHC/Data/Word64Set/Internal.hs
@@ -12,8 +12,6 @@

{-# OPTIONS_HADDOCK not-home #-}

-#include "containers.h"
-
-----------------------------------------------------------------------------
-- |
-- Module : Data.Word64Set.Internal
diff --git a/compiler/GHC/Utils/Containers/Internal/BitUtil.hs b/compiler/GHC/Utils/Containers/Internal/BitUtil.hs
index b7484cfc2e07b00b717e64f507aed0779c39f649..3d938b64e434ccdd4de7fbb0aa6c1651d911ee27 100644
--- a/compiler/GHC/Utils/Containers/Internal/BitUtil.hs
+++ b/compiler/GHC/Utils/Containers/Internal/BitUtil.hs
@@ -6,8 +6,6 @@
{-# LANGUAGE Safe #-}
#endif

-#include "containers.h"
-
-----------------------------------------------------------------------------
-- |
-- Module : Utils.Containers.Internal.BitUtil
diff --git a/compiler/GHC/Utils/Containers/Internal/StrictPair.hs b/compiler/GHC/Utils/Containers/Internal/StrictPair.hs
index 65d3780ef071f2b9fc2f4b3ff5502314f6426abd..9a2cf89ca20588c7ecd919072d328673f7888828 100644
--- a/compiler/GHC/Utils/Containers/Internal/StrictPair.hs
+++ b/compiler/GHC/Utils/Containers/Internal/StrictPair.hs
@@ -3,8 +3,6 @@
{-# LANGUAGE Safe #-}
#endif

-#include "containers.h"
-
-- | A strict pair

module GHC.Utils.Containers.Internal.StrictPair (StrictPair(..), toPair) where
5 changes: 5 additions & 0 deletions test/th-dlls/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ in recurseIntoAttrs {
meta.disabled = stdenv.hostPlatform.isGhcjs
# On aarch64 this test also breaks form musl builds (including cross compiles on x86_64-linux)
|| (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl)
# On for aarch64 cross compile on GHC 9.8.4 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
# replace the pool allocator patches we used in earlier versions.
|| (compiler-nix-name == "ghc984" && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)
# Failed to lookup symbol: __aarch64_swp8_acq_rel
|| (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
Expand Down

0 comments on commit 827008f

Please sign in to comment.