-
Notifications
You must be signed in to change notification settings - Fork 241
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
Interop between two haskell.nix repositories #750
Comments
To be clear, the workflow you want is:
First of all, the two instances of A might be built in different ways by
However, even if that's all fine, ultimately I think Nix will think they are different because they get their source in different ways. That is, your local one will bottom out in So the summary is that a local copy of A is quite different from a source-dep on A, unfortunately. I would expect that you get cache hits for A's dependencies, though. |
Thank you @michaelpj, I understand. |
Ah I see. This is actually a long-standing cabal bug: haskell/cabal#5586 (apparently recently closed, so maybe it'll be better in the next version) |
Hi again :)
Not sure it is related. I admit, I may have a completely wrong understanding of how Let's forget about
|
The upshot of that cabal bug is that cabal does not treat it as if it came from Hackage. Cabal treats it as if it was another local package in your project. And we follow cabal. (In fact, in a
The Haskell.nix Way is to ask: how would you do this with cabal? And the easiest way to do it with cabal is... There is another alternative that might get you what you want, which is to use an internal hackage. I believe you can even use those with Now, if I understand you rightly, you don't care that your package won't build with cabal, and you want to hack together a setup that will only work in Nix. I think this is best avoided, but you're an adult ;) I'm not totally sure, but I think you might be able to do that with |
Ah, I get you now. This is gold, thank you! |
I think we got to the bottom of this. |
Hi,
First, thank you very much for creating this library!
We have been using
haskell.nix
for https://github.com/hasktorch/hasktorch for some time now, and it has improved our productivity quite a bit!I've got a basic question, though, and I can't seem to figure it out.
Suppose I have two repositories with two cabal projects,
A
andB
, whereB
depends onA
.Both projects are already using
haskell.nix
and pretty much follow thecardano-skeleton
example (in particular, the two projects areA
, https://github.com/hasktorch/hasktorch, andB
, https://github.com/hasktorch/hasktorch-skeleton).In order to fulfil the dependency in
B
, I've addedA
to the source-repository section of thecabal.project
file inB
(e.g., https://github.com/hasktorch/hasktorch-skeleton/blob/master/cabal.project).Now, when I start a
nix-shell
in B,cabal
will have to buildA
fully before being able to do any work forB
. My questions is:How can I make it such that the build of
A
is part of building thenix-shell
environment, and how I can benefit fromA
'scachix
cache when launching the shell?I've looked around in https://github.com/input-output-hk if I can find any example of that, but to no avail.
Thanks,
Torsten
The text was updated successfully, but these errors were encountered: