Skip to content

How to make "b.opam depends on external foo package which depends on a.opam" work? #111

Open
@sir4ur0n

Description

@sir4ur0n

Describe the bug
We have a repo with 2 packages a and b, where b depends transitively on a via an intermediary package foo.
We don't manage to provide a Nix shell with opam.nix.

To Reproduce

  • in repo bar, have 2 opam files:
    • a.opam
    • b.opam which depends on foo
  • in repo foo, have 1 opam file foo.opam which depends on a
  • use opam-nix to provide a Nix shell in repo bar for both a and b

I tried to add this overlay:

final: prev: {
      a = prev.a.overrideAttrs
        (a: {
          src = builtins.fetchGit ./.;
          doCheck = false;
        });
    }

This makes the Nix shell succeed to evaluate, however dune build fails with something like

Error: Conflict between the following libraries:
- "a" in _build/default/a/lib
- "a" in
  /nix/store/q1c4vacvhql0vc3ry9gvr3xjnqrzml2f-a-0.19.6/lib/ocaml/5.2.0/site-lib/a
  -> required by library "foo" in
     /nix/store/1i05pbq3j8swqz5s9pxhkzs4yf03dlqd-foo-1.1.6/lib/ocaml/5.2.0/site-lib/foo
  -> required by library "b" in
     _build/default/b/lib
-> required by _build/default/b/tests/b.exe
-> required by alias b/tests/all
-> required by alias b/default
-> required by alias default in dune:20

Expected behavior
Some way to get a nix-shell for both a and b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions