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

dune clean fail with DUNE_BUILD_DIR set to an absolute path #5377

Closed
Et7f3 opened this issue Jan 24, 2022 · 4 comments
Closed

dune clean fail with DUNE_BUILD_DIR set to an absolute path #5377

Et7f3 opened this issue Jan 24, 2022 · 4 comments

Comments

@Et7f3
Copy link
Contributor

Et7f3 commented Jan 24, 2022

Expected Behavior

dune clean succeed when DUNE_BUILD_DIR is set to an absolute path.

Actual Behavior

it doesn't

Reproduction

  • PR with a reproducing test: not yet
  1. open a folder with dune-project
  2. set DUNE_BUILD_DIR to $PWD/some/folders you should get a absolute path
  3. dune clean
% ../dune/./_esy/default/store/b/dune-f684ad2b/install/default/bin/dune.exe clean
�[1;31mInternal error, please report upstream including the contents of _build/log.�[0m
Description:
  ("Path.rm_rf called on external dir",
  { fn =
      "C:/Users/Et7f3/ppx_import/_esy/default/store/b/ppx__import-e1393642"
  })
Raised at Stdune__Code_error.raise in file "otherlibs/stdune/code_error.ml",
  line 11, characters 30-62
Called from Stdune__Fpath.rm_rf in file "otherlibs/stdune/fpath.ml", line
  131, characters 4-78
Called from Cmdliner_term.app.(fun) in file
  "vendor/cmdliner/src/cmdliner_term.ml", line 25, characters 19-24
Called from Cmdliner.Term.run in file "vendor/cmdliner/src/cmdliner.ml", line
  117, characters 32-39
Called from Cmdliner.Term.term_eval in file
  "vendor/cmdliner/src/cmdliner.ml", line 147, characters 18-36
Called from Cmdliner.Term.Group.eval in file
  "vendor/cmdliner/src/cmdliner.ml", line 367, characters 22-48
Called from Dune__exe__Main in file "bin/main.ml", line 90, characters 10-50

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases.
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.
[build ppx_import] % echo $DUNE_BUILD_DIR/
C:/Users/Et7f3/ppx_import/_esy/default/store/b/ppx__import-e1393642

% echo $DUNE_BUILD_DIR/
C:/Users/Et7f3/ppx_import/_esy/default/store/b/ppx__import-e1393642/
% echo $PWD
/cygdrive/c/Users/Et7f3/ppx_import

Specifications

  • Version of dune (output of dune --version): ef1ee9a
  • Version of ocaml (output of ocamlc --version) 4.13.1
  • Operating system (distribution and version): windows

Additional information

  • Link to gist with verbose output (run dune with the --verbose flag):
@bobot
Copy link
Collaborator

bobot commented Jan 24, 2022

Is it because the BUILD_DIR chosen is absolute or absolute and outside the source directory (i.e. outside the dune-project scope)?

@Et7f3
Copy link
Contributor Author

Et7f3 commented Jan 24, 2022

$PWD/dune-project exists so I don't understand the difference

@bobot
Copy link
Collaborator

bobot commented Jan 24, 2022

So the culprit is really the fact that an absolute path is used, please could you update the description and title to make that obvious?

@Et7f3 Et7f3 changed the title dune clean fail with DUNE_BUILD_DIR set dune clean fail with DUNE_BUILD_DIR set to an absolute path Jan 25, 2022
@rgrinberg rgrinberg added this to the 3.1.0 milestone Apr 22, 2022
@rgrinberg
Copy link
Member

Fixed by #5507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants