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

uninstall: do not fail if directories are non-empty #5543

Merged
merged 5 commits into from
Apr 5, 2022

Conversation

nojb
Copy link
Collaborator

@nojb nojb commented Apr 4, 2022

Fixes #5542

@nojb nojb force-pushed the uninstall_non_empty branch 5 times, most recently from 11b0042 to ee0218d Compare April 4, 2022 20:15
@nojb nojb requested a review from rgrinberg April 4, 2022 20:48

let try_remove_dir_if_empty dir = remove_dir_if_empty ~try_:true dir

let remove_dir_if_empty dir = remove_dir_if_empty ~try_:false dir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if these aliases that just partially apply try_ are useful for readability. A flag like on_non_empty:[Fail | Warn] instead of try_ and without the aliases would be shorter and just as readable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I pushed a commit in this direction. Do you mind taking another look? Thanks!

@nojb nojb force-pushed the uninstall_non_empty branch 2 times, most recently from 9fb5fdf to eae86a0 Compare April 5, 2022 06:49
Copy link
Member

@rgrinberg rgrinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Could you rebase and re-run the tests. I merged Gbury's test case.

nojb added 5 commits April 5, 2022 23:03
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
@nojb nojb force-pushed the uninstall_non_empty branch from eae86a0 to e08e5e5 Compare April 5, 2022 21:05
@nojb
Copy link
Collaborator Author

nojb commented Apr 5, 2022

Looks good. Could you rebase and re-run the tests. I merged Gbury's test case.

Done, thanks!

@nojb nojb merged commit b12a5cd into ocaml:main Apr 5, 2022
@nojb nojb deleted the uninstall_non_empty branch April 5, 2022 22:02
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Apr 15, 2022
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.1.0)

CHANGES:

- Add `sourcehut` as an option for defining project sources in dune-project
  files. For example, `(source (sourcehut user/repo))`. (ocaml/dune#5564, @rgrinberg)

- Add `dune coq top` command for running a Coq toplevel (ocaml/dune#5457, @rlepigre)

- Fix dune exec dumping database in wrong directory (ocaml/dune#5544, @bobot)

- Always output absolute paths for locations in RPC reported diagnostics
  (ocaml/dune#5539, @rgrinberg)

- Add `(deps <deps>)` in ctype field (ocaml/dune#5346, @bobot)

- Add `(include <file>)` constructor to dependency specifications. This can be
  used to introduce dynamic dependencies (ocaml/dune#5442, @anmonteiro)

- Ensure that `dune describe` computes a transitively closed set of
  libraries (ocaml/dune#5395, @esope)

- Add direct dependencies to $ dune describe output (ocaml/dune#5412, @esope)

- Show auto-detected concurrency on Windows too (ocaml/dune#5502, @MisterDA)

- Fix operations that remove folders with absolute path. This happens when
  using esy (ocaml/dune#5507, @EduardoRFS)

- Dune will not fail if some directories are non-empty when uninstalling.
  (ocaml/dune#5543, fixes ocaml/dune#5542, @nojb)

- `coqdep` now depends only on the filesystem layout of the .v files,
  and not on their contents (ocaml/dune#5547, helps with ocaml/dune#5100, @ejgallego)

- The mdx stanza 0.2 can now be used with `(implicit_transitive_deps false)`
  (ocaml/dune#5558, fixes ocaml/dune#5499, @emillon)

- Fix missing parenthesis in printing of corresponding terminal command for
  `(with-outputs-to )` (ocaml/dune#5551, fixes ocaml/dune#5546, @Alizter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dune errors when trying to remove non-empty man directory
2 participants