Skip to content

Writing foo.1.2.3 as a package dependency should give a nice error and a hint #9270

@Alizter

Description

@Alizter

In opam the convention is to write foo.1.2.3 for a package version. For new users, it is not obvious that this doesn't work in Dune immediately. They may try something like this in dune-project:

(lang dune 3.13)
(package
 (name invalid)
 (depends foo.1.2.3))

Currently we raise an ugly uncaught exception when runnning dune pkg lock:

  Error: exception Failure("Invalid character in package name \"foo.1.2.3\"")

the reproduction case is in #9269. We should instead raise a nice user message with a hint with something like:

Hint: replace "foo.1.2.3" with "(foo (= 1.2.3))".

We don't even validate the package name at all when running dune build. The reproduction case can be found in #9271.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions