-
Notifications
You must be signed in to change notification settings - Fork 35
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
How to make "b.opam
depends on external foo
package which depends on a.opam
" work?
#111
Comments
Does this strategy work with regular opam? I would think you’d have the same problem with that setup. In other words I don’t think this would be a opam-nix specific issue. That said,your best bet is probably to have dune building a, b, and foo together. You can check out foo inside your a+b tree and optionally set it as a vendored directory or have foo in a sibling directory and use a dune-workspace file in the common parent to set the workspace root so dune sees a, b, and foo together. |
I think another solution would be to filter out the |
@greedy yes it does: as much as I dislike this setup, this is the current setup we have on some of our projects, and devs who use
The problem is that it changes the setup for non-nix users. A key benefit of using
@balsoft if I correctly understood your suggestion: the problem is that we would like to have a single nix shell to build all packages. With your suggestion, for nix shells, we would need to have 2 nix shells (or a flag parameter to decide which shell we want to land in), right? For now we use a combination of |
Not necessarily
I think I'm proposing the inverse: to override the |
I tried b = b.overrideAttrs (oa: { src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.difference ./. ./a; }; }); Notice this diff with what you suggested, otherwise I had an error that - oa.filesets.difference
+ lib.fileset.difference In any case it doesn't work, I have the same error as in the original issue:
|
Ah, you may also want to add your original override final: prev: {
a = prev.a.overrideAttrs
(a: {
src = builtins.fetchGit ./.;
doCheck = false;
});
} |
Describe the bug
We have a repo with 2 packages
a
andb
, whereb
depends transitively ona
via an intermediary packagefoo
.We don't manage to provide a Nix shell with
opam.nix
.To Reproduce
bar
, have 2 opam files:a.opam
b.opam
which depends onfoo
foo
, have 1 opam filefoo.opam
which depends ona
opam-nix
to provide a Nix shell in repobar
for botha
andb
I tried to add this overlay:
This makes the Nix shell succeed to evaluate, however
dune build
fails with something likeExpected behavior
Some way to get a nix-shell for both
a
andb
The text was updated successfully, but these errors were encountered: