IntersectMBO / IntersectMBO/cardano-base

Unclear how to add new dependencies

Open
#251 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
105
Forks
54
Avg merge
9d 2h
Merged PRs (30d)
4

Description

For [this task here](https://github.com/input-output-hk/plutus/issues/4233#issuecomment-976718634). I'm trying to add a dependency on `secp256k1-haskell`, which (to my best understanding), I've done [here](https://github.com/mlabs-haskell/cardano-base/tree/koz/secp-256k1). However, when I try to spin up a `nix-shell`, I get this:

```
[koz@Sebastian cardano-base]$ nix-shell --show-trace
trace: Using IOHK default nixpkgs
trace: To make project.plan-nix for haskell-project a fixed-output derivation but not materialized, set `plan-sha256` to the output of the 'calculateMaterializedSha' script in 'passthru'.
trace: To materialize project.plan-nix for haskell-project entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
trace: WARNING: No sha256 found for source-repository-package https://github.com/haskoin/secp256k1-haskell 885d0953d5a0fb08be181a80f3643b0135b04bcb download may fail in restricted mode (hydra)
fatal: couldn't find remote ref refs/heads/885d0953d5a0fb08be181a80f3643b0135b04bcb
error: program 'git' failed with exit code 128

… while fetching the input 'git+https://github.com/haskoin/secp256k1-haskell?ref=885d0953d5a0fb08be181a80f3643b0135b04bcb'

… while evaluating the attribute 'buildCommand' of the derivation 'hash-path'

at /nix/store/g9r92jfark3sngrh57nnbbpjx6nbkfjg-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:7:

6| stdenv.mkDerivation ({
7| name = lib.strings.sanitizeDerivationName name;
| ^
8| inherit buildCommand;

… while evaluating 'hashPath'

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/call-cabal-project-to-nix.nix:171:14:

170|
171| hashPath = path:
| ^
172| builtins.readFile (pkgs.runCommand "hash-path" { preferLocalBuild = true; }

… from call site

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/call-cabal-project-to-nix.nix:185:56:

184| in __trace "WARNING: No sha256 found for source-repository-package ${repoData.url} ${repoData.ref} download may fail in restricted mode (hydra)"
185| (__trace "Consider adding `--sha256: ${hashPath drv}` to the ${cabalProjectFileName} file or passing in a lookupSha256 argument"
| ^
186| drv);

… while evaluating the attribute 'buildCommand' of the derivation 'source-repository-package'

at /nix/store/g9r92jfark3sngrh57nnbbpjx6nbkfjg-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:7:

6| stdenv.mkDerivation ({
7| name = lib.strings.sanitizeDerivationName name;
| ^
8| inherit buildCommand;

… while evaluating anonymous lambda

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/call-cabal-project-to-nix.nix:236:46:

235| # Add replacement `source-repository-package` blocks pointing to the minimal git repos
236| ( pkgs.lib.strings.concatMapStrings (f: ''
| ^
237| echo "source-repository-package" >> ./cabal.project

… from call site

… while evaluating 'concatMapStrings'

at /nix/store/g9r92jfark3sngrh57nnbbpjx6nbkfjg-nixpkgs-src/lib/strings.nix:53:25:

52| */
53| concatMapStrings = f: list: concatStrings (map f list);
| ^
54|

… from call site

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/call-cabal-project-to-nix.nix:236:11:

235| # Add replacement `source-repository-package` blocks pointing to the minimal git repos
236| ( pkgs.lib.strings.concatMapStrings (f: ''
| ^
237| echo "source-repository-package" >> ./cabal.project

… while evaluating 'optionalString'

at /nix/store/g9r92jfark3sngrh57nnbbpjx6nbkfjg-nixpkgs-src/lib/strings.nix:202:5:

201| # String to return if condition is true
202| string: if cond then string else "";
| ^
203|

… from call site

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/call-cabal-project-to-nix.nix:230:9:

229| '' +
230| pkgs.lib.optionalString (builtins.length sourceReposEval != 0) (''
| ^
231| chmod +w -R ./cabal.project

… while evaluating the attribute 'makeFixedProjectFile'

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/call-cabal-project-to-nix.nix:227:7:

226| sourceRepos = sourceReposBuild;
227| makeFixedProjectFile = ''
| ^
228| cp -f ${otherText} ./cabal.project

… while evaluating the attribute 'buildCommand' of the derivation 'haskell-project-plan-to-nix-pkgs'

at /nix/store/g9r92jfark3sngrh57nnbbpjx6nbkfjg-nixpkgs-src/pkgs/build-support/trivial-builders.nix:7:7:

6| stdenv.mkDerivation ({
7| name = lib.strings.sanitizeDerivationName name;
| ^
8| inherit buildCommand;

… while evaluating anonymous lambda

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/lib/import-and-filter-project.nix:5:1:

4| { pkgs, haskellLib }:
5| { projectNix, sourceRepos, src }:
| ^
6| let

… from call site

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/overlays/haskell.nix:488:27:

487| callProjectResults = callCabalProjectToNix args;
488| plan-pkgs = importAndFilterProject {
| ^
489| inherit (callProjectResults) projectNix sourceRepos src;

… while evaluating the attribute 'hsPkgs'

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/overlays/haskell.nix:510:43:

509| project = addProjectAndPackageAttrs rec {
510| inherit (pkg-set.config) hsPkgs;
| ^
511| inherit pkg-set;

… while evaluating the attribute 'hsPkgs'

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/overlays/haskell.nix:533:15:

532| # Haskell packages
533| hsPkgs = final.lib.mapAttrs (packageName: package':
| ^
534| if package' == null

… while evaluating 'cabalProject'

at /nix/store/5zvkchh00rdd0g89cgky4h29p4d4q8c6-haskell.nix-src/overlays/haskell.nix:752:24:

751|
752| cabalProject = args: let p = cabalProject' args;
| ^
753| in p.hsPkgs // p;

… from call site

at /home/koz/mlabs/cardano-base/nix/haskell.nix:23:12:

22| # https://input-output-hk.github.io/haskell.nix/user-guide/projects/
23| pkgSet = haskell-nix.cabalProject {
| ^
24| inherit src;

… while evaluating anonymous lambda

at /home/koz/mlabs/cardano-base/nix/haskell.nix:4:1:

3| ############################################################################
4| { lib
| ^
5| , stdenv

… from call site

at /home/koz/mlabs/cardano-base/nix/pkgs.nix:3:32:

2| pkgs: _: with pkgs; {
3| cardanoBaseHaskellPackages = import ./haskell.nix {
| ^
4| inherit config

… while evaluating anonymous lambda

at /home/koz/mlabs/cardano-base/shell.nix:2:1:

1| # This file is used by nix-shell.
2| { config ? {}
| ^
3| , sourcesOverride ? {}

… from call site
```

It isn't clear to me how new dependencies are to be added - the URL that is specified by `--show-detail` definitely exists, and the commit is live. What have I missed?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.