Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport TUF security bugfix to 3.6 #9457

Closed

Conversation

andreabedini
Copy link
Collaborator

cherry-picks dcfdc9c

closes: #9451

@Mikolaj Mikolaj removed their request for review November 17, 2023 09:06
@andreabedini andreabedini force-pushed the backport/tuf-security/3.6 branch from 0f207d6 to 6f2b3b3 Compare November 18, 2023 05:10
@andreabedini
Copy link
Collaborator Author

I had to restrict the bound of hackage-security to get this to work.

hackage-security-0.6.2.0 added a dependency on Cabal-syntax, which is incompatible with Cabal-3.6.

@hasufell
Copy link
Member

I had to restrict the bound of hackage-security to get this to work.

hackage-security-0.6.2.0 added a dependency on Cabal-syntax, which is incompatible with Cabal-3.6.

It's not, you can use this patch:

From 9a04c42a76883f141bc4589a2d26b28c63cde10c Mon Sep 17 00:00:00 2001
From: Julian Ospald <[email protected]>
Date: Thu, 16 Nov 2023 21:00:26 +0800
Subject: [PATCH 1/5] Fix build with newer GHC

---
 cabal-install/src/Distribution/Client/Win32SelfUpgrade.hs | 2 +-
 cabal.project.release                                     | 3 +++
 cabal.project.validate                                    | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/cabal-install/src/Distribution/Client/Win32SelfUpgrade.hs b/cabal-install/src/Distribution/Client/Win32SelfUpgrade.hs
index 0d9a9effe..c220d9e92 100644
--- a/cabal-install/src/Distribution/Client/Win32SelfUpgrade.hs
+++ b/cabal-install/src/Distribution/Client/Win32SelfUpgrade.hs
@@ -140,7 +140,7 @@ deleteOldExeFile verbosity oldPID tmpPath = do
      ++ show oldPID ++ " at path " ++ tmpPath
 
   log $ "getting handle of parent process " ++ show oldPID
-  oldPHANDLE <- Win32.openProcess Win32.sYNCHORNIZE False (fromIntegral oldPID)
+  oldPHANDLE <- Win32.openProcess Win32.sYNCHRONIZE False (fromIntegral oldPID)
 
   log $ "synchronising with parent"
   event <- openEvent syncEventName
diff --git a/cabal.project.release b/cabal.project.release
index 4fda782ae..8a5f856a3 100644
--- a/cabal.project.release
+++ b/cabal.project.release
@@ -3,3 +3,6 @@ packages: cabal-install/
 tests: False
 benchmarks: False
 optimization: True
+constraints: Cabal-syntax < 3.7,
+             Win32 >= 2.8
+allow-newer: base
diff --git a/cabal.project.validate b/cabal.project.validate
index 25f29243d..33b28876f 100644
--- a/cabal.project.validate
+++ b/cabal.project.validate
@@ -17,6 +17,8 @@ tests: True
 -- avoiding extra dependencies
 constraints: rere -rere-cfg
 constraints: these -assoc
+constraints: Cabal-syntax < 3.7,
+             Win32 >= 2.8
 
 write-ghc-environment-files: never
 
-- 
2.41.0

@andreabedini
Copy link
Collaborator Author

@hasufell

It's not, you can use this patch:

Sorry you need to be more explicit with me. Do you mean you want to allow cabal-install-3.6 to build against a newer Cabal than 3.6? I am not opposed to that but I think it can be discussed separately.

I don't understand what you are suggesting, the patch above changes a call to Win32.sYNCHRONIZE, how is this related to hackage-security?

If I am not mistaken cabal-install-3.6.2.0 has been unbuildable since hackage-security-0.6.2.0 came out so that is an urgent concern (we should do a revision on hackage too).

@hasufell
Copy link
Member

Sorry you need to be more explicit with me.

This fixes it:

constraints: Cabal-syntax < 3.7

Cabal-syntax-3.6 is a dummy package:

Version 3.6 (unlike the following versions) is a dummy package that prevents module name clases between Cabal and Cabal-syntax if used together with a Cabal flag as described below.

The Win32 thing was needed to fix builds on windows for me.

@andreabedini
Copy link
Collaborator Author

@hasufell that a project configuration setting, it is not part of the package metadata.

@hasufell
Copy link
Member

@hasufell that a project configuration setting, it is not part of the package metadata.

You can put it in the package metadata.

@andreabedini andreabedini force-pushed the backport/tuf-security/3.6 branch from a19f942 to 9911bf2 Compare November 23, 2023 02:16
hackage-security-0.6.2.0 added a dependency on Cabal-syntax, which is
incompatible with the verion of Cabal we use here.
@andreabedini andreabedini force-pushed the backport/tuf-security/3.6 branch from 9911bf2 to 299633b Compare December 1, 2023 07:11
@andreabedini andreabedini marked this pull request as draft December 9, 2023 23:57
@andreabedini
Copy link
Collaborator Author

I tried to get the CI to pass but I have given up :)

@ulysses4ever
Copy link
Collaborator

ulysses4ever commented Dec 21, 2023

What's the plan for this? I'm not sure it's the best application of our scarce resources to patch the old releases.

@Kleidukos
Copy link
Member

@andreabedini Let's leave 3.6 to be patched by downstream if they wish so, it would be better to focus on delivering 3.10.3.0

@andreabedini
Copy link
Collaborator Author

@andreabedini Let's leave 3.6 to be patched by downstream if they wish so, it would be better to focus on delivering 3.10.3.0

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants