You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dune init's --public can take names with dashes in them.
Actual Behavior
An error explaining only characters [a-zA-Z0-9_] are allowed.
Reproduction
$ dune init lib mirage_pair --public mirage-pair
dune: option '--public': invalid component name `mirage-pair' Library names must be non-empty and composed only of the following characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.Usage: dune init library [OPTION]… NAME [PATH]Try 'dune init library --help' or 'dune --help' for more information.
Specifications
Version of dune (output of dune --version): 3.6.1
Version of ocaml (output of ocamlc --version) 4.14.0
Operating system (distribution and version): debian 11.6
Activity
Alizter commentedon Feb 17, 2023
Does putting it in quotations work?
reynir commentedon Feb 17, 2023
Sorry how do you mean?
Alizter commentedon Feb 17, 2023
I mean
reynir commentedon Feb 17, 2023
No, that does the same.
reynir commentedon Feb 17, 2023
The relevant code is here:
dune/bin/init.ml
Lines 16 to 48 in d3d628f
The problem is the same converter for library names is used for the public library name. It uses
Lib_name.Localdune/src/dune_rules/lib_name.ml
Lines 17 to 19 in d3d628f
I'm unsure if there's existing code that can be used for the public name or how to go forward on this.
Add test for ocaml#7108
Add test for ocaml#7108
PizieDust commentedon Jun 6, 2023
currently having this issue too
test(init): add repro for ocaml#7108
test(init): add repro for #7108 (#8320)
fix(init): parse --public as a package name
fix(init): parse --public as a package name
fix(init): parse --public as a package name
fix(init): parse --public as a public name
fix(init): parse --public as a public name
fix(init): parse --public as a public name
fix(init): parse --public as a public name
fix(init): parse --public as a public name (#8603)
[new release] dune (15 packages) (3.11.0~alpha1)
[new release] dune (15 packages) (3.11.0)
[new release] dune (15 packages) (3.11.0)