Open kozross opened 2 years ago
You don't need to add it to sources.json
, you do need to add the sha256
line in cabal.project
(for haskell.nix
). You might also have an issue if the sha you're asking for isn't on the master branch?
(This project needs a CONTRIBUTING.md
)
You may also need to teach haskell.nix
about the pkg-config dependency mapping, like this, but for the secp256k1
library: https://github.com/input-output-hk/haskell.nix/pull/1295
@michaelpj I've updated my branch, but I'm still seeing the same issue. I'm also not sure how to determine what should go in the sha256
section of cabal.project
.
Note that the sha256
field should be commented, as in the other source-repository-package stanzas.
You should be able to do the usual TOFU dance: Nix will tell you if it doesn't match. Also what Nick said.
@michaelpj @nc6 Commenting the sha256
field worked; this definitely needs documenting for contributors, as I've literally never seen this before.
You may also need to teach
haskell.nix
about the pkg-config dependency mapping, like this, but for thesecp256k1
library: input-output-hk/haskell.nix#1295
How would I do this? There's no equivalent file here.
https://input-output-hk.github.io/haskell.nix/tutorials/pkg-map.html
In the short term you can put in a nixpkgs overlay providing libsecp256k1 = secp256k1
. Ultimately I think it'll need a PR to haskell.nix
so that downstream users have an easy time too.
Oh, ignore me, it's already there, so that should be fine.
@michaelpj I now get this error on a build attempt, so clearly something isn't there:
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: secp256k1-haskell (user goal)
[__0] rejecting: secp256k1-haskell-0.6.0 (conflict: pkg-config package
libsecp256k1-any, not found in the pkg-config database)
[__0] rejecting: secp256k1-haskell-0.5.0, secp256k1-haskell-0.4.0,
secp256k1-haskell-0.3.1, secp256k1-haskell-0.3.0, secp256k1-haskell-0.2.5,
secp256k1-haskell-0.2.4, secp256k1-haskell-0.2.3, secp256k1-haskell-0.2.2,
secp256k1-haskell-0.2.1, secp256k1-haskell-0.2.0, secp256k1-haskell-0.1.8,
secp256k1-haskell-0.1.7, secp256k1-haskell-0.1.6, secp256k1-haskell-0.1.5,
secp256k1-haskell-0.1.4, secp256k1-haskell-0.1.3, secp256k1-haskell-0.1.2,
secp256k1-haskell-0.1.1, secp256k1-haskell-0.1.0 (constraint from user target
requires ==0.6.0)
[__0] fail (backjumping, conflict set: secp256k1-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: secp256k1-haskell
I think it's easier than you think. I just added the dep to cardano-crypto-class
(it's on hackage!) and it seems to work fine: https://github.com/input-output-hk/cardano-base/tree/koz/secp-256k1
So you never needed to do the source-repository-package
thing, I think.
Good to know, thanks!
For this task here. I'm trying to add a dependency on
secp256k1-haskell
, which (to my best understanding), I've done here. However, when I try to spin up anix-shell
, I get this: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?