Skip to content

Commit

Permalink
ghc-head: Fixes for new base and Cabal
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Jan 7, 2017
1 parent 133ba5f commit 71fc7f9
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pkgs/development/haskell-modules/configuration-ghc-head.nix
Expand Up @@ -86,4 +86,11 @@ self: super: {
# Won't work with LLVM 3.5.
llvm-general = markBrokenVersion "3.4.5.3" super.llvm-general;

# A bunch of jailbreaks due to 'base' bump
old-locale = doJailbreak super.old-locale;
primitive = doJailbreak super.primitive;
test-framework = doJailbreak super.test-framework;
atomic-primops = doJailbreak (appendPatch super.atomic-primops ./patches/atomic-primops-Cabal-1.25.patch);
hashable = doJailbreak super.hashable;
stm = doJailbreak super.stm;
}
4 changes: 2 additions & 2 deletions pkgs/development/haskell-modules/hackage-packages.nix
Expand Up @@ -106695,8 +106695,8 @@ self: {
({ mkDerivation, base, Cabal }:
mkDerivation {
pname = "jailbreak-cabal";
version = "1.3.1";
sha256 = "610d8dbd04281eee3d5da05c9eef45bfd1a1ddca20dfe54f283e15ddf6d5c235";
version = "1.3.2";

This comment has been minimized.

Copy link
@peti

peti Jan 7, 2017

Member

What are you doing???? Please don't edit this file directly. You know it's auto-generated. Please don't mess with this file without coordinating with me first.

This comment has been minimized.

Copy link
@shlevy

shlevy Jan 8, 2017

Author Member

What does it matter? I just needed a single update and knew it would be kept the same when you next did your hackage update.

This comment has been minimized.

Copy link
@shlevy

shlevy Jan 8, 2017

Author Member

Also, your workflow is still not documented anywhere as far as I can see. Last time I tried to reproduce it hackage2nix errored out after a long delay.

This comment has been minimized.

Copy link
@peti

peti Jan 8, 2017

Member

What does it matter?

It matters because your change caused merge conflicts in the haskell-updates branch, which breaks the automatic process. In other words, you're causing extra work for me. It also matters because you've caused re-builds of all jailbroken packages and their dependencies which are unnecessary, because ...

I just needed a single update and knew it would be kept the same when you next did your hackage update.

You think you know that, but in fact you are wrong. We follow LTS Haskell, and jailbreak-cabal won't be updated until LTS Haskell updates it. I've overridden the newer version only for the HEAD package set.

What you do know is that I am the author of jailbreak-cabal, you know that I published that update on Hackage, and you know that I regularly update the Haskell package set in Nixpkgs. So IMHO a reasonable person would assume that I will take care of updating jailbreak-cabal in Nixpkgs, too, and such a person would not jump in and interfere with my plans without asking me first.

This comment has been minimized.

Copy link
@shlevy

shlevy Jan 8, 2017

Author Member

Where is all this documented? It's not in the nixpkgs manual, or anywhere else as far as I can see. Am I allowed to merge things from the haskell-updates branch myself? How do I do that properly? It's not in the nixpkgs manual, or anywhere else as far as I can see. You can't expect people to follow your process if you don't share what it is in an easily accessible place.

In fact, my first thought was just to update jailbreak-cabal for HEAD only, but I thought that since that file is manually maintained it would take a while for someone to update it and it might cause head to be pinned to an old version eventually.

I've said this before, and I'll say it again until it's no longer an issue: You don't get to insist on your idiosyncratic setup being respected if you won't provide a way for people to get things done besides "just wait and hope @peti fixes it". We have developer documentation, if you're not OK with the normal nixpkgs update process being applied to these files then document how else we can do it.

This comment has been minimized.

Copy link
@shlevy

shlevy Jan 8, 2017

Author Member

And, for what it's worth, I had no idea this would interfere with your plans. If I had, I would have checked with you. But I thought, reasonably IMO, that as an automated file that holds the latest haskell packages my change would be idempotent. I don't know the details of your process, and I didn't know that it's no longer the latest haskell packages, but I had no good way to find that out or even know there was something important I was missing.

sha256 = "1x2h54sx4ycik34q8f9g698xc2b7fai18918cd08qx7w7ny8nai1";
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base Cabal ];
Expand Down
@@ -0,0 +1,37 @@
diff --git a/Setup.hs b/Setup.hs
index ddf5a02..7ad1f26 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,4 +1,4 @@
-
+{-# LANGUAGE CPP #-}
import Control.Monad (when)
import Language.Haskell.TH
import Distribution.Simple (defaultMainWithHooks, simpleUserHooks, UserHooks(postConf), Args)
@@ -6,14 +6,25 @@ import Distribution.Simple.Utils (cabalVersion)
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup (ConfigFlags)
import Distribution.Version (Version(..))
+#if MIN_VERSION_Cabal(1,25,0)
+import Distribution.Version (mkVersion)
+#endif
import Distribution.PackageDescription (PackageDescription)
import Debug.Trace

+#if MIN_VERSION_Cabal(1,25,0)
+versionBranch :: Version -> Version
+versionBranch = id
+#else
+mkVersion :: [Int] -> Version
+mkVersion vs = Version vs []
+#endif
+
-- I couldn't figure out a way to do this check from the cabal file, so we drop down
-- here to do it instead:
checkGoodVersion :: IO ()
checkGoodVersion =
- if cabalVersion >= Version [1,17,0] []
+ if cabalVersion >= mkVersion [1,17,0]
then putStrLn (" [Setup.hs] This version of Cabal is ok for profiling: "++show cabalVersion)
else error (" [Setup.hs] This package should not be used in profiling mode with cabal version "++
show (versionBranch cabalVersion)++" < 1.17.0\n"++

0 comments on commit 71fc7f9

Please sign in to comment.