Skip to content

Commit

Permalink
[ADP-3226] Update indexState in haskell.nix (#4843)
Browse files Browse the repository at this point in the history
This pull request updates the `indexState` in our `haskell.nix`
configuration, with the intent to populate the Hoogle index for the
`cardano-wallet-agda` repository again.

This pull request also removes some cruft from our nix files.

### Issue Number

ADP-3226
  • Loading branch information
HeinrichApfelmus authored Dec 17, 2024
2 parents 77a93f8 + 6693055 commit b3a29cc
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 77 deletions.
1 change: 0 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ steps:
- linux-nix
steps:
- label: Nix Build (linux)
# Check whether regenerate.sh was applied when it had to be applied.
commands:
- nix build .#cardano-wallet
agents:
Expand Down
18 changes: 11 additions & 7 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
-- Updating this file
--
-- This file is the canonical source of dependencies.
-- To generate the Nix packages, use ./nix/regenerate.sh
--
-- -----------------------------------------------------------------------------
-- How to use with the nix shell
Expand Down Expand Up @@ -170,6 +169,7 @@ allow-newer:
async-timer:unliftio-core
, servant-openapi3:*
, katip:Win32
, ekg-wai:time

constraints:
base >= 4.18.2.0 && < 5
Expand All @@ -178,6 +178,13 @@ constraints:

, bech32 >= 1.1.7

-- Force newer version of `lobemo-backend-ekg` here,
-- because older versions depend on `snap-server`,
-- which in turns fails to link on linux musl
-- due to some missing `sendfile64` hack.
-- (We use linux musl to get statically linked binaries.)
, lobemo-backend-ekg >= 0.2.0.0

-- lower versions of katip won't build with the Win32-2.12.0.1
-- which is shipped with the ghc-9.2.8
, katip >= 0.8.7.4
Expand All @@ -186,10 +193,10 @@ constraints:
-- Cardano Node dependencies:
, io-classes >= 1.4
, io-classes -asserts

, cardano-ledger-api ==1.9.4.0

, ouroboros-network == 0.17.1.2
, cardano-ledger-api ^>= 1.9

, ouroboros-network ^>= 0.17


-- Related to: https://github.com/haskell/cabal/issues/8554
Expand Down Expand Up @@ -257,9 +264,6 @@ package cardano-wallet
package cardano-wallet-api
tests: True

package cardano-wallet-cli
tests: True

package cardano-wallet-launcher
tests: True

Expand Down
22 changes: 12 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@
inherit dockerImage;
inherit (config) dockerHubRepoName;
};
inherit (pkgs) checkCabalProject;
} // (lib.optionalAttrs buildPlatform.isLinux {
nixosTests = import ./nix/nixos/tests {
inherit pkgs;
Expand All @@ -436,15 +435,18 @@
};

ci.benchmarks =
packages.benchmarks.cardano-wallet-benchmarks //
packages.benchmarks.cardano-wallet-blackbox-benchmarks // {
all = pkgs.releaseTools.aggregate {
name = "cardano-wallet-benchmarks";
meta.description = "Build all benchmarks";
constituents =
lib.collect lib.isDerivation packages.benchmarks;
};
};
let
collectedBenchmarks =
lib.concatMapAttrs (_n: v: v) packages.benchmarks;
in
collectedBenchmarks // {
all = pkgs.releaseTools.aggregate {
name = "cardano-wallet-benchmarks";
meta.description = "Build all benchmarks";
constituents =
lib.collect lib.isDerivation collectedBenchmarks;
};
};
ci.artifacts = mkReleaseArtifacts walletProject // {
dockerImage = packages.dockerImage;
};
Expand Down
49 changes: 1 addition & 48 deletions nix/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
filter = lib.cleanSourceFilter;
};

indexState = "2024-08-08T00:00:00Z";
indexState = "2024-08-20T21:35:22Z";

localClusterConfigs = config.src + /lib/local-cluster/test/data/cluster-configs;

Expand Down Expand Up @@ -140,7 +140,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
curlFull
jq
yq
nixWrapped
mdbook
haskellPackages.fourmolu
haskellPackages.ghcid
Expand All @@ -164,10 +163,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
[
{
packages = lib.genAttrs projectPackages (name: {
# Mark package as local non-dep in the nix-shell.
# fixme: Haskell.nix should set it
package.isProject = true;

# Enable release flag (optimization and -Werror)
flags.release = true;

Expand All @@ -185,16 +180,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
{
reinstallableLibGhc = true;

# These are here to make `stackProject` vs `cabalProject` `nix-diff` cleaner
# TODO remove
packages.entropy.components.setup.doExactConfig = true;
packages.prettyprinter-configurable.components.setup.doExactConfig = true;
packages.pretty-simple.components.setup.doExactConfig = true;
packages.wai-logger.components.setup.doExactConfig = true;
packages.openapi3.components.setup.doExactConfig = true;
packages.servant-openapi3.components.setup.doExactConfig = true;
packages.system-filepath.components.setup.doExactConfig = true;

packages.cardano-wallet-unit.components.tests = {
unit.build-tools = cardanoNodeExes;
unit.preCheck = noCacheTestFailuresCookie + ''
Expand Down Expand Up @@ -286,26 +271,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
packages.cardano-wallet.components.exes.cardano-wallet.postInstall = optparseCompletionPostInstall + setGitRevPostInstall + rewriteLibsPostInstall + stripBinariesPostInstall;
})

({ config, ... }:
let
setGitRevPostInstall = setGitRevPostInstall' config.packages.cardano-node.src.rev;
in
{
# Add shell completions for tools.
packages.cardano-cli.components.exes.cardano-cli.postInstall = optparseCompletionPostInstall + setGitRevPostInstall;
packages.cardano-node.components.exes.cardano-node.postInstall = optparseCompletionPostInstall + setGitRevPostInstall;
packages.cardano-addresses-cli.components.exes.cardano-address.postInstall = optparseCompletionPostInstall;
packages.bech32.components.exes.bech32.postInstall = optparseCompletionPostInstall;
})

# Provide the git revision for cardano-addresses
({ config, ... }:
{
packages.cardano-addresses-cli.components.library.preBuild = ''
export GITREV=${config.hsPkgs.cardano-addresses-cli.src.rev}
'';
})

# Provide the swagger file in an environment variable for
# tests because it is located outside of the Cabal package
# source tree.
Expand All @@ -319,7 +284,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
# Use our forked libsodium from iohk-nix crypto overlay.
packages.plutus-tx.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.byron-spec-ledger.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.cardano-wallet-cli.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.cardano-crypto-praos.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.cardano-crypto-class.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 pkgs.libblst ] ];
})
Expand All @@ -331,13 +295,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
# does not require any messing with cabal files.
packages.katip.doExactConfig = true;

# split data output for ekg to reduce closure size
packages.ekg.components.library.enableSeparateDataOutput = true;

# Avoid this error on the windows build:
# Wrap.hsc:96:10: fatal error: regex.h: No such file or directory
packages.regex-posix.flags._regex-posix-clib = stdenv.hostPlatform.isWindows;

# Lets us put the pretty-simple tool in shell.nix.
packages.pretty-simple.flags.buildexe = true;
}
Expand Down Expand Up @@ -371,10 +328,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
packages.cardano-wallet-benchmarks.components.benchmarks.db = fullyStaticOptions;
packages.cardano-wallet-launcher.components.tests.unit = fullyStaticOptions;

# systemd can't be statically linked - disable lobemo-scribe-journal
packages.cardano-config.flags.systemd = false;
packages.cardano-node.flags.systemd = false;

# Haddock not working for cross builds and is not needed anyway
doHaddock = false;
}
Expand Down
3 changes: 2 additions & 1 deletion nix/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ lib
rec {
# Imports from nixpkgs.lib
inherit (lib) filterAttrsRecursive recursiveUpdate collect
optionalAttrs mapAttrs isDerivation fileset;
optionalAttrs mapAttrs isDerivation fileset
concatMapAttrs;

/* Convert versions string from Cabal (YYYY.M.D)
to git tag format (vYYYY-MM-DD).
Expand Down
13 changes: 7 additions & 6 deletions nix/overlays/common-lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ in {
cardanoWalletLib = {

# Retrieve the list of local project packages by
# filtering the set of *all* packages by their homepage.
projectPackageList = lib.attrNames (lib.filterAttrs
(_: p: p != null
&& haskellLib.isLocalPackage p.package
&& p.package.homepage == "https://github.com/cardano-foundation/cardano-wallet")
cardanoWalletHaskellProject.pkg-set.config.packages);
# using the haskell.nix selectProjectPackages function.
projectPackageList =
let
project = haskellLib.selectProjectPackages cardanoWalletHaskellProject.hsPkgs;
names = map (key: (builtins.getAttr key project).identifier.name) (builtins.attrNames project);
in
lib.lists.unique names;

};
}
2 changes: 1 addition & 1 deletion nix/project-package-list.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ "address-derivation-discovery" "cardano-api-extra" "cardano-balance-tx" "cardano-coin-selection" "cardano-numeric" "cardano-wallet" "cardano-wallet-api" "cardano-wallet-benchmarks" "cardano-wallet-blackbox-benchmarks" "cardano-wallet-integration" "cardano-wallet-launcher" "cardano-wallet-network-layer" "cardano-wallet-primitive" "cardano-wallet-read" "cardano-wallet-secrets" "cardano-wallet-test-utils" "cardano-wallet-unit" "customer-deposit-wallet" "delta-chain" "delta-store" "delta-table" "delta-types" "faucet" "local-cluster" "text-class" "wai-middleware-logging" ]
[ "address-derivation-discovery" "cardano-api-extra" "cardano-balance-tx" "cardano-coin-selection" "cardano-numeric" "cardano-wallet" "cardano-wallet-api" "cardano-wallet-application-extras" "cardano-wallet-benchmarks" "cardano-wallet-blackbox-benchmarks" "cardano-wallet-buildkite" "cardano-wallet-e2e" "cardano-wallet-exe" "cardano-wallet-integration" "cardano-wallet-launcher" "cardano-wallet-network-layer" "cardano-wallet-primitive" "cardano-wallet-secrets" "cardano-wallet-test-utils" "cardano-wallet-ui" "cardano-wallet-unit" "crypto-primitives" "customer-deposit-wallet" "delta-chain" "delta-store" "delta-table" "delta-types" "faucet" "iohk-monitoring-extra" "local-cluster" "std-gen-seed" "temporary-extra" "text-class" "wai-middleware-logging" ]
3 changes: 0 additions & 3 deletions nix/regenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -euo pipefail

cd $(dirname "$0")/..

# Regenerate --sha256 hashes in cabal.project
nix build .#checkCabalProject -o check-cabal-project.sh && ./check-cabal-project.sh

# Regenerate the list of the project packages:
nix eval .#pkgs.cardanoWalletLib.projectPackageList > nix/project-package-list.nix.new
mv nix/project-package-list.nix.new nix/project-package-list.nix

0 comments on commit b3a29cc

Please sign in to comment.