Skip to content

Infinite loop in cycle checking #5771

@rgrinberg

Description

@rgrinberg

We can demonstrate the infinite loop with the following test:

  $ cat >dune-project <<EOF
  > (lang dune 3.1)
  > (package (name foo))
  > EOF

  $ mkdir d1
  $ cat >d1/dune <<EOF
  > (rule (with-stdout-to f (echo "foobar")))
  > (install
  >  (files f)
  >  (section bin))
  > EOF

  $ mkdir d2
  $ cat >d2/dune <<EOF
  > (rule
  >  (deps (package foo))
  >  (action (with-stdout-to g (echo "ggg"))))
  > (install
  >  (files g)
  >  (section bin))
  > EOF

  $ dune build foo.install
  > Error: Dependency cycle between:  
  >    _build/install/default/bin/g
  > -> alias .foo-files
  > -> _build/default/d2/g
  > -> _build/install/default/bin/g
  > -> required by _build/default/foo.install

It cannot be committed since it obviously doesn't terminate. I've manually added the output at the bottom that shows the cycle is indeed detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions