Skip to content

Conversation

@Leonidas-from-XIV
Copy link
Collaborator

I noticed that there is no test that checked the "package %S is already defined" message:

$ rg "package .* is already defined"
src/dune_lang/dune_project.ml
513:          "package %s is already defined in %S"
813:      [ Pp.textf "package %s is already defined" (Package.name p |> Package.Name.to_string)

src/dune_lang/pin_stanza.ml
32:      [ Pp.textf "package %S is already defined" (Package_name.to_string name) ]

test/blackbox-tests/test-cases/pkg/pin-stanza/duplicate-pins.t
46:  Error: package "dep_a" is already defined

test/blackbox-tests/test-cases/exclusive-package-dirs.t
19:  Error: package foo is already defined in "foo"

So I wrote a test. It works properly. Thus I was curious what happens if I declare a duplicate pin via a dependency. It gets ignored (which come to think of it, is probably the right thing to do). See the test.

Signed-off-by: Marek Kubica <marek@tarides.com>
@ElectreAAS
Copy link
Collaborator

There is a slight overlap between this test and override-single-workspace.t, but I think that's fine

@Leonidas-from-XIV Leonidas-from-XIV merged commit f0c50b7 into ocaml:main Jan 9, 2026
30 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the duplicate-pin-test branch January 9, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants