Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean needed when turning a directory into a file #6575

Closed
voodoos opened this issue Nov 25, 2022 · 1 comment · Fixed by #9327
Closed

Clean needed when turning a directory into a file #6575

voodoos opened this issue Nov 25, 2022 · 1 comment · Fixed by #9327
Labels

Comments

@voodoos
Copy link
Collaborator

voodoos commented Nov 25, 2022

Changing a directory test to a single-file test with the same name requires a dune clean:

Given a working directory cram test:
  $ mkdir sometest.t
  $ cat >sometest.t/run.t <<EOF
  >   $ echo "foobar"
  >   foobar
  > EOF

  $ dune build @sometest

We turn it into a single-file test:
  $ mv sometest.t sometest.t.bak
  $ mv sometest.t.bak/run.t sometest.t
  $ rm -r sometest.t.bak

FIXME: Dune should detect the change:
  $ dune build @sometest
  Error: _build/default/sometest.t: Is a directory
  -> required by _build/default/sometest.t
  -> required by alias sometest
  [1]

After a clean it works as expected:
  $ dune clean
  $ dune build @sometest

Specifications

  • Version of dune: main (3.6.0-85-gdd6f976)

  • Version of ocaml: 4.14

  • Operating system: Macos (M1)

  • Link to gist with verbose output (run dune with the --verbose flag):

voodoos added a commit to voodoos/dune that referenced this issue Nov 25, 2022
Signed-off-by: Ulysse Gérard <[email protected]>
@emillon
Copy link
Collaborator

emillon commented Nov 29, 2022

See also #3753 for a similar issue in the past.

@rgrinberg rgrinberg added the bug label Feb 23, 2023
rgrinberg pushed a commit that referenced this issue Feb 28, 2023
Signed-off-by: Ulysse Gérard <[email protected]>
jchavarri added a commit to jchavarri/dune that referenced this issue Nov 15, 2023
* main: (56 commits)
  feature: add terminal ui backend based on NoTTY (ocaml#6996)
  doc(coq): update documentation about coqdep
  fix(rules): don't descend into automatic subdirs infinitely (ocaml#7208)
  benchmark: add warm run (ocaml#7198)
  test: vendored and public libs (ocaml#7197)
  test: use sh in concurrent test (ocaml#7205)
  fix: custom log file path (ocaml#7200)
  test(melange): add test exercising ocaml#7104 (ocaml#7204)
  test(melange): add a test that introduces rules in the target dir (ocaml#7196)
  test: duplicate packages in vendor dir (ocaml#7194)
  melange: interpret `melc --where` as a list of `:`-separated paths (ocaml#7176)
  perf: add synthetic benchmark (ocaml#7189)
  Test case for bug report (ocaml#6725)
  Add test illustrating ocaml#6575 (ocaml#6576)
  chore: add rule streaming proposal (ocaml#7195)
  test(stdlib): merge wrapped/unwrapped tests
  test: move all stdlib tests
  fix: allow unwrapped libraries with `(stdlib ..)`
  test: demonstrate crash in modules.ml when `(stdlib .. )` used with `(wrapped false)`
  fix(install): respect display options (ocaml#7116)
  ...
emillon added a commit to emillon/dune that referenced this issue Nov 30, 2023
emillon added a commit to emillon/dune that referenced this issue Nov 30, 2023
emillon added a commit to emillon/dune that referenced this issue Dec 4, 2023
emillon added a commit to emillon/dune that referenced this issue Dec 14, 2023
emillon added a commit to emillon/dune that referenced this issue Dec 22, 2023
emillon added a commit to emillon/dune that referenced this issue Dec 22, 2023
emillon added a commit to emillon/dune that referenced this issue Jan 5, 2024
emillon added a commit to emillon/dune that referenced this issue Feb 6, 2024
emillon added a commit to emillon/dune that referenced this issue Feb 8, 2024
emillon added a commit that referenced this issue Feb 27, 2024
* fix(engine): remove old target even if it is a dir

Fixes #6575

Signed-off-by: Etienne Millon <[email protected]>

* Add changelog entry

Signed-off-by: Etienne Millon <[email protected]>

* Ignore EPERM on darwin

Signed-off-by: Etienne Millon <[email protected]>

* Extract Fpath.unlink_status

Signed-off-by: Etienne Millon <[email protected]>

* Change file to directory

Signed-off-by: Etienne Millon <[email protected]>

* Keep exceptions

Signed-off-by: Etienne Millon <[email protected]>

* Use a single constructor for exn

Signed-off-by: Etienne Millon <[email protected]>

* Log error

Signed-off-by: Etienne Millon <[email protected]>

* rename Fpath.unlink to Fpath.unlink_exn

Signed-off-by: Etienne Millon <[email protected]>

* rename Path.unlink to Path.unlink_exn

Signed-off-by: Etienne Millon <[email protected]>

* rename Fpath.unlink_status to Fpath.unlink

Signed-off-by: Etienne Millon <[email protected]>

* rename Path.unlink_status to Path.unlink

Signed-off-by: Etienne Millon <[email protected]>

* do not log error if file does not exist

Signed-off-by: Etienne Millon <[email protected]>

---------

Signed-off-by: Etienne Millon <[email protected]>
Leonidas-from-XIV pushed a commit to Leonidas-from-XIV/dune that referenced this issue Mar 4, 2024
* fix(engine): remove old target even if it is a dir

Fixes ocaml#6575

Signed-off-by: Etienne Millon <[email protected]>

* Add changelog entry

Signed-off-by: Etienne Millon <[email protected]>

* Ignore EPERM on darwin

Signed-off-by: Etienne Millon <[email protected]>

* Extract Fpath.unlink_status

Signed-off-by: Etienne Millon <[email protected]>

* Change file to directory

Signed-off-by: Etienne Millon <[email protected]>

* Keep exceptions

Signed-off-by: Etienne Millon <[email protected]>

* Use a single constructor for exn

Signed-off-by: Etienne Millon <[email protected]>

* Log error

Signed-off-by: Etienne Millon <[email protected]>

* rename Fpath.unlink to Fpath.unlink_exn

Signed-off-by: Etienne Millon <[email protected]>

* rename Path.unlink to Path.unlink_exn

Signed-off-by: Etienne Millon <[email protected]>

* rename Fpath.unlink_status to Fpath.unlink

Signed-off-by: Etienne Millon <[email protected]>

* rename Path.unlink_status to Path.unlink

Signed-off-by: Etienne Millon <[email protected]>

* do not log error if file does not exist

Signed-off-by: Etienne Millon <[email protected]>

---------

Signed-off-by: Etienne Millon <[email protected]>
Leonidas-from-XIV added a commit that referenced this issue Mar 5, 2024
* fix(engine): remove old target even if it is a dir

Fixes #6575



* Add changelog entry



* Ignore EPERM on darwin



* Extract Fpath.unlink_status



* Change file to directory



* Keep exceptions



* Use a single constructor for exn



* Log error



* rename Fpath.unlink to Fpath.unlink_exn



* rename Path.unlink to Path.unlink_exn



* rename Fpath.unlink_status to Fpath.unlink



* rename Path.unlink_status to Path.unlink



* do not log error if file does not exist



---------

Signed-off-by: Etienne Millon <[email protected]>
Co-authored-by: Etienne Millon <[email protected]>
Leonidas-from-XIV added a commit to Leonidas-from-XIV/opam-repository that referenced this issue Mar 11, 2024
CHANGES:

### Fixed

- When a directory is changed to a file, correctly remove it in subsequent
  `dune build` runs. (ocaml/dune#9327, fix ocaml/dune#6575, @emillon)

- Fix a problem with the doc-new target where transitive dependencies were
  missed during compile. This leads to missing expansions in the output docs.
  (ocaml/dune#9955, @jonludlam)

- coq: fix performance regression in coqdep unescaping (ocaml/dune#10115, fixes ocaml/dune#10088,
  @ejgallego, thanks to Dan Christensen for the report)

- coq: memoize coqdep parsing, this will reduce build times for Coq users, in
  particular for those with many .v files (ocaml/dune#10116, @ejgallego, see also ocaml/dune#10088)

- on Windows, use an unicode-aware version of `CreateProcess` to avoid crashes
  when paths contains non-ascii characters. (ocaml/dune#10212, fixes ocaml/dune#10180, @emillon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants