From 9bb4f58e1d508cb087910a81c0482e0186073a71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A9cate?= <Kleidukos@users.noreply.github.com>
Date: Mon, 24 Jun 2024 20:12:53 +0200
Subject: [PATCH] Disable arch-native flag when building releases that we
 distribute (#10142)

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

* Use the constraints stanza

* Also disable the flag in cabal.validate.project
---
 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