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

upgrade nixpkgs to release-22.05 #76

Merged
merged 8 commits into from
May 30, 2022
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 .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: haskell/actions/setup@v1
with:
ghc-version: '8.10'
ghc-version: '9.0'
- name: Build
run: |
sudo apt-get update
Expand Down
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ packages: .
source-repository-package
type: git
location: https://github.com/dfinity-side-projects/winter
tag: e62722796e11760947a94285734e7bc29d72c389
tag: 530d5e395bb9919187d47d3966c4d526e668b62a

source-repository-package
type: git
location: https://github.com/nomeata/haskell-candid
tag: 1b0279928ac05ecabb0c913449b10c9559a0ec45
tag: bff9fcf23e6c60bb8cd7c1ac1ae3d39f6fc05ec0
131 changes: 68 additions & 63 deletions cabal.project.freeze

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

78 changes: 9 additions & 69 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,78 +23,19 @@ let universal-canister = (naersk.buildPackage rec {
'';
}); in


let haskellPackages = nixpkgs.haskellPackages.override {
overrides = self: super:
let generated = import nix/generated/all.nix self super; in
generated //
{
# the downgrade of cborg in nix/generated.nix makes cborgs test suite depend on
# older versions of stuff, so let’s ignore the test suite.
cborg = nixpkgs.haskell.lib.dontCheck generated.cborg;
# here more adjustments can be made if needed, e.g.
# crc = nixpkgs.haskell.lib.markUnbroken (nixpkgs.haskell.lib.dontCheck super.crc);
murmur3 = nixpkgs.haskell.lib.markUnbroken super.murmur3;
secp256k1-haskell = nixpkgs.haskell.lib.markUnbroken super.secp256k1-haskell_0_6_0;
haskoin-core = nixpkgs.haskell.lib.dontCheck super.haskoin-core;
};
}; in

let staticHaskellPackages = nixpkgs.pkgsStatic.haskell.packages.integer-simple.ghc8107.override {
# We override GHC such that TemplateHaskell doesn't require shared libraries
# which are not available in pkgsStatic.
# See: https://github.com/NixOS/nixpkgs/issues/61575#issuecomment-879403341
ghc = (nixpkgs.pkgsStatic.buildPackages.haskell.compiler.integer-simple.ghc8107.override {
enableRelocatedStaticLibs = true;
enableShared = false;
}).overrideAttrs (oldAttr: { preConfigure = ''
${oldAttr.preConfigure or ""}
echo "GhcLibHcOpts += -fPIC -fexternal-dynamic-refs" >> mk/build.mk
echo "GhcRtsHcOpts += -fPIC -fexternal-dynamic-refs" >> mk/build.mk
'';
});
overrides = self: super:
let haskellOverrides = self: super:
let generated = import nix/generated/all.nix self super; in
generated //
{
# the downgrade of cborg in nix/generated.nix makes cborgs test suite depend on
# older versions of stuff, so let’s ignore the test suite.
cborg = nixpkgs.haskell.lib.dontCheck (
nixpkgs.haskell.lib.appendConfigureFlag generated.cborg "-f-optimize-gmp"
);
haskoin-core = nixpkgs.haskell.lib.dontCheck (nixpkgs.haskell.lib.markUnbroken super.haskoin-core);
}; in

murmur3 = nixpkgs.haskell.lib.markUnbroken super.murmur3;

secp256k1-haskell =
nixpkgs.haskell.lib.addBuildTool
(nixpkgs.haskell.lib.markUnbroken super.secp256k1-haskell_0_6_0)
nixpkgs.pkg-config;

haskoin-core = nixpkgs.haskell.lib.dontCheck super.haskoin-core;

cryptonite = nixpkgs.haskell.lib.dontCheck (
nixpkgs.haskell.lib.appendConfigureFlag super.cryptonite "-f-integer-gmp"
);

# more test suites too slow withour integer-gmp
scientific = nixpkgs.haskell.lib.dontCheck super.scientific;
math-functions = nixpkgs.haskell.lib.dontCheck super.math-functions;
let haskellPackages = nixpkgs.haskellPackages.override {
overrides = haskellOverrides;
}; in

# We disable haddock to prevent the error:
#
# Haddock coverage:
# haddock: panic! (the 'impossible' happened)
# (GHC version 8.10.7:
# lookupGlobal
#
# Failed to load interface for ‘GHC.Integer.Type’
# Perhaps you haven't installed the "dyn" libraries for package ‘integer-simple-0.1.2.0’?
cmdargs = nixpkgs.haskell.lib.dontHaddock super.cmdargs;
file-embed = nixpkgs.haskell.lib.dontHaddock super.file-embed;
QuickCheck = nixpkgs.haskell.lib.dontHaddock super.QuickCheck;
candid = nixpkgs.haskell.lib.dontHaddock super.candid;
winter = nixpkgs.haskell.lib.dontHaddock generated.winter;
};
let staticHaskellPackages = nixpkgs.pkgsStatic.haskellPackages.override {
overrides = haskellOverrides;
}; in

let
Expand Down Expand Up @@ -203,8 +144,6 @@ rec {
inherit ic-hs-coverage;
inherit universal-canister;

haskoin-core = haskellPackages.haskoin-core;

ic-ref-test = nixpkgs.runCommandNoCC "ic-ref-test" {
nativeBuildInputs = [ ic-hs ];
} ''
Expand Down Expand Up @@ -328,6 +267,7 @@ rec {
buildInputs = [
nixpkgs.cabal-install
nixpkgs.ghcid
haskellPackages.haskell-language-server
];
};
}
Loading