Skip to content

dune init project is broken due to project/workspace root detection #4960

@shonfeder

Description

@shonfeder

Expected Behavior

dune init proj foo should initialize a new project in the directory foo.

Actual Behavior

$ dune init proj foo
Error: I cannot find the root of the current workspace/project.
If you would like to create a new dune project, you can type:

    dune init project NAME

Otherwise, please make sure to run dune inside an existing project or
workspace. For more information about how dune identifies the root of the
current workspace/project, please refer to
https://dune.readthedocs.io/en/stable/usage.html#finding-the-root

A workaround is

$ touch dune-project
$ dune init proj foo

but, obviously, this is broken behavior.

Reproduction

I don't know how we can test this in our current CI/cram set up, since those all exist within a dune project.

Specifications

  • Version of dune (output of dune --version): 3.0+alpha-867-gf22e56c
  • Version of ocaml (output of ocamlc --version): version 4.11.1
  • Operating system (distribution and version): Ubuntu 21.04

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions