Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Or [use Nix](https://nixos.org/nix/download.html) to get a shell with the `clash
nix develop .

# Start a dev shell with a specific GHC version
nix develop .#ghc961
nix develop .#ghc9101
```

You will need a modern version of nix with support for the new-style `nix`
Expand Down
22 changes: 0 additions & 22 deletions clash-cores/clash-cores.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ flag haddock
default: False
manual: True

flag nix
description:
Are we building this package from nix
default: False
manual: True

-- TODO: Remove this workaround. See:
--
-- https://github.com/clash-lang/clash-compiler/pull/2665#issuecomment-1939044550
Expand Down Expand Up @@ -83,22 +77,6 @@ common basic-config
if flag(haddock)
ghc-options:
-fdefer-type-errors
elif flag(nix)
-- It's absolutely grimy, but if we don't specify the `-package` flags here
-- then when nix eventually calls `./Setup register` on the package it will
-- still pass the `-fplugin` options to GHC and fail to create the package
-- registation file needed to finish the `installPhase`.
--
-- These flags are something we NEVER want to manually specify in a normal
-- build, since correctly configuring this kind of thing should be solely
-- left to cabal as a build tool.
ghc-options:
-package ghc-typelits-extra
-fplugin GHC.TypeLits.Extra.Solver
-package ghc-typelits-knownnat
-fplugin GHC.TypeLits.Normalise
-package ghc-typelits-natnormalise
-fplugin GHC.TypeLits.KnownNat.Solver
else
ghc-options:
-fplugin GHC.TypeLits.Extra.Solver
Expand Down
42 changes: 21 additions & 21 deletions flake.lock

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

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
# The versions of GHC that we want to be able to build / develop against
# within the nix environment. Since nix is lazy, only derivations for
# versions of GHC which are used are actually evaluated.
ghcVersions = [ "ghc902" "ghc962" ];
ghcVersions = [ "ghc964" "ghc982" "ghc9101" ];

# We pick a single version of GHC to use by default within nix. This is
# probably cleaner than always having N copies of each package / app and
# being forced to refer to them by their GHC version.
defaultGhcVersion = "ghc962";
defaultGhcVersion = "ghc9101";

# Overlays are not per-system, so let's only compute them once.
# For each version of GHC we produce a `pkgs.clashPackages-ghcVER`, e.g.
Expand Down
33 changes: 0 additions & 33 deletions nix/overlay-ghc902.nix

This file was deleted.

71 changes: 71 additions & 0 deletions nix/overlay-ghc910.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{ pkgs }:
final: prev:
let
inherit (pkgs.haskell.lib) dontCheck doJailbreak markUnbroken;
in
{
# Use an older version than the default in nixpkgs. Since rewrite-inspector
# is basically abandonware it catches fire with brick 1.0+.
brick = doJailbreak prev.brick_0_70_1;

# brick 0.70.1 requires vty < 6.0.
vty = doJailbreak (prev.callHackage "vty" "5.39" { });

# Relies on older versions of some libraries.
hint = doJailbreak prev.hint;

# Marked as broken in nixpkgs, since it specifies much older dependencies
# than the defaults in nixpkgs.
rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);

# Requires some old versions of libraries, but still works.
derive-storable-plugin = doJailbreak prev.derive-storable-plugin;

# Marken as broken, but compiles anyway.
hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata);

# Fails on GHC 9.10 with:
# library/Text/Regex/PCRE/Heavy.hs:123: failure in expression `head $ scan [re|\s*entry (\d+) (\w+)\s*&?|] (" entry 1 hello &entry 2 hi" :: String)'
# expected: (" entry 1 hello &",["1","hello"])
# but got: <interactive>:55:1: warning: [GHC-63394] [-Wx-partial]
# ^
# In the use of ‘head’
# (imported from Prelude.Compat, but defined in GHC.Internal.List):
# "This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"."
# (" entry 1 hello &",["1","hello"])

pcre-heavy = dontCheck prev.pcre-heavy;

# Relies on older versions of text.
string-random = doJailbreak prev.string-random;

# We need the newest version from nixpkgs for these packages.
singletons-base = prev.singletons-base_3_4;

microstache = prev.microstache_1_0_3;

th-desugar = prev.th-desugar_1_17;

# We need a new tasty-flaky. The one from Hackage doesn't build for some weird
# reason..
tasty-flaky = prev.callCabal2nix "tasty-flaky" (pkgs.fetchFromGitHub {
owner = "LaurentRDC";
repo = "tasty-flaky";
rev = "fc31a9d622c1eb60030a50152258a9bef785e365";
sha256 = "sha256-irLM3aVMxpBgsM72ArulMXcoLY2glalVkG//Lrj2JBI=";
}) {};

tasty = prev.tasty_1_5;

singletons-th = prev.singletons-th_3_4;

# nixpkgs doesn't include revision 1, changing dependency on template-haskell.
string-interpolate = pkgs.haskell.lib.compose.overrideCabal (drv: {
revision = "1";
editedCabalFile = "sha256-oh0tR+LDFcVzQnm4kSrmhAU+P7wdai536d72Cvhzipg=";
}) (prev.callHackageDirect {
pkg = "string-interpolate";
ver = "0.3.4.0";
sha256 = "sha256-KA8P6cc6N7pZ9/ay3edcEGx4vpKtp+EY7tn8U1NrbG8=";
} { });
}
35 changes: 21 additions & 14 deletions nix/overlay-ghc962.nix → nix/overlay-ghc96.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{ pkgs }:
final: prev:
let
inherit (pkgs.haskell.lib) doJailbreak dontCheck markUnbroken;
inherit (pkgs.haskell.lib) doJailbreak markUnbroken dontCheck;
in
{
# Use an older version than the default in nixpkgs. Since rewrite-inspector
# is basically abandonware it catches fire with brick 1.0+.
brick = doJailbreak prev.brick_0_70_1;

# brick 0.70.1 requires vty < 6.0.
vty = prev.callHackage "vty" "5.39" { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this

  vty = prev.callHackage "vty" "5.39" { };

in ghc96 but

  vty = doJailbreak (prev.callHackage "vty" "5.39" { });

in ghc98?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ghc98 has a different set of packages (since the compiler is newer) and in this set of packages for ghc98 certain packages (deepseq) has the wrong version, however it still compiles fine. That is why the jailbreak is required in ghc98 and not in ghc62 (where deepseq has the right version).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay!


# Marked as broken in nixpkgs, since it needs a newer hashable than the
# .cabal file currently uploaded to hackage.
concurrent-supply = doJailbreak (markUnbroken prev.concurrent-supply);

# Use a branch with changes to support GHC 9.6.1.
hint =
Expand All @@ -25,28 +31,18 @@ in
# than the defaults in nixpkgs.
rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);

# We want a version that matches with singletons-th, but the tests in here
# are also a bit flaky since GHC 9.6 isn't officially supported.
singletons-base = dontCheck prev.singletons-base_3_2;

# Use a newer version than the default in nixpkgs.
singletons-th = prev.singletons-th_3_2;

# Needs a newer text than the .cabal file currently uploaded to hackage.
string-qq = doJailbreak prev.string-qq;

# Needs a newer version than the default in nixpkgs.
th-desugar = prev.th-desugar_1_15;

# Needs a newer base than the .cabal file currently uploaded to hackage.
vector-binary-instances = doJailbreak prev.vector-binary-instances;

# Use an older version than the default in nixpkgs.
th-abstraction = prev.th-abstraction_0_5_0_0;

# type-errors 0.2.0.2 is bounded on doctest >=0.16.0.1 && <0.22
doctest = prev.callHackage "doctest" "0.21.1" { };

# Marken as broken, but compiles anyway.
hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata);

# We need a new tasty-flaky. The one from Hackage doesn't build for some weird
# reason..
tasty-flaky = prev.callCabal2nix "tasty-flaky" (pkgs.fetchFromGitHub {
Expand All @@ -55,4 +51,15 @@ in
rev = "fc31a9d622c1eb60030a50152258a9bef785e365";
sha256 = "sha256-irLM3aVMxpBgsM72ArulMXcoLY2glalVkG//Lrj2JBI=";
}) {};

# This version of tasty isn't available in the nix ghc96 package set
tasty = prev.callHackageDirect {
pkg = "tasty";
ver = "1.5.3";
sha256 = "sha256-Ogd8J4aHNeL+xmcRWuJeGBNaePyLs5yo1IoMzvWrVPY=";
} {};

# The tests (not the package itself!) require a tasty <1.5, which won't work as we pull in
# tasty 1.5.3. Solution: don't test!
time-compat = dontCheck prev.time-compat;
}
43 changes: 43 additions & 0 deletions nix/overlay-ghc98.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ pkgs }:
final: prev:
let
inherit (pkgs.haskell.lib) doJailbreak markUnbroken dontCheck;
in
{
# Use an older version than the default in nixpkgs. Since rewrite-inspector
# is basically abandonware it catches fire with brick 1.0+.
brick = doJailbreak prev.brick_0_70_1;

# brick 0.70.1 requires vty < 6.0.
vty = doJailbreak (prev.callHackage "vty" "5.39" { });

# Marked as broken in nixpkgs, since it specifies much older dependencies
# than the defaults in nixpkgs.
rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);

# Requires some old versions of libraries, but still works.
derive-storable-plugin = doJailbreak prev.derive-storable-plugin;

# Marken as broken, but compiles anyway.
hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata);

# We need a new tasty-flaky. The one from Hackage doesn't build for some weird
# reason..
tasty-flaky = prev.callCabal2nix "tasty-flaky" (pkgs.fetchFromGitHub {
owner = "LaurentRDC";
repo = "tasty-flaky";
rev = "fc31a9d622c1eb60030a50152258a9bef785e365";
sha256 = "sha256-irLM3aVMxpBgsM72ArulMXcoLY2glalVkG//Lrj2JBI=";
}) {};

# This version of tasty isn't available in the nix ghc98 package set
tasty = prev.callHackageDirect {
pkg = "tasty";
ver = "1.5.3";
sha256 = "sha256-Ogd8J4aHNeL+xmcRWuJeGBNaePyLs5yo1IoMzvWrVPY=";
} {};

# The tests (not the package itself!) require a tasty <1.5, which won't work as we pull in
# tasty 1.5.3. Solution: don't test!
time-compat = dontCheck prev.time-compat;
}
Loading
Loading