From 357bbf0bfeb24d18cd090aa136b43fbf65b74e75 Mon Sep 17 00:00:00 2001
From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com>
Date: Mon, 24 Jun 2024 21:07:32 +0000
Subject: [PATCH] Disable arch-native flag when building releases that we
 distribute (#10142) (#10144)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Disable arch-native flag when building releases that we distribute

* Use the constraints stanza

* Also disable the flag in cabal.validate.project

(cherry picked from commit 9bb4f58e1d508cb087910a81c0482e0186073a71)

Co-authored-by: Hécate <Kleidukos@users.noreply.github.com>
---
 cabal.release.project  | 3 +++
 cabal.validate.project | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/cabal.release.project b/cabal.release.project
index 5ce38e721a..ffd7c18adc 100644
--- a/cabal.release.project
+++ b/cabal.release.project
@@ -2,4 +2,7 @@ import: project-cabal/pkgs/cabal.config
 import: project-cabal/pkgs/install.config
 import: project-cabal/pkgs/tests.config
 
+constraints:
+  hashable -arch-native
+
 index-state: hackage.haskell.org 2024-06-17T00:00:01Z
diff --git a/cabal.validate.project b/cabal.validate.project
index 52c7841110..2e3084cccf 100644
--- a/cabal.validate.project
+++ b/cabal.validate.project
@@ -7,3 +7,8 @@ tests: True
 write-ghc-environment-files: never
 program-options
   ghc-options: -Werror
+
+-- This project file is used to distribute the cabal-head binary,
+-- as such we cannot enable "-march=native".
+constraints:
+  hashable -arch-native
-- 
GitLab