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

--working-dir option does not work when calling opam update #5294

Closed
voodoos opened this issue Sep 21, 2022 · 4 comments · Fixed by #5300
Closed

--working-dir option does not work when calling opam update #5294

voodoos opened this issue Sep 21, 2022 · 4 comments · Fixed by #5300
Labels
Projects
Milestone

Comments

@voodoos
Copy link

voodoos commented Sep 21, 2022

Similar to #3807

On opam 2.1.3 on macos I observe the following behavior when trying to update a switch with some package pinned from directories:

❯ opam update --working-dir
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><>  🐫 
[default] synchronised from https://opam.ocaml.org

<><> Synchronising development packages <><><><><><><><><><><><><><><><><><>  🐫 
[NOTE] Ignoring uncommitted changes in /Users/ulysse/tmp/dune (`--working-dir' not active).

I also observe unexpected behaviour when specifying the package to update:

❯ opam update dune
<><> Synchronising development packages <><><><><><><><><><><><><><><><><><>  🐫 
[NOTE] Ignoring uncommitted changes in /Users/ulysse/tmp/dune (`--working-dir' not active).
[dune.dev] synchronised (no changes)

❯ opam update --working-dir dune
<><> Synchronising development packages <><><><><><><><><><><><><><><><><><>  🐫 
Processing  1/1: [dune.dev: git]
[dune.dev] fetching sources failed: /Users/ulysse/tmp/dune/
@voodoos
Copy link
Author

voodoos commented Sep 21, 2022

After discussing offline with @rjbou it turned out that I was not using opam correctly: to re-install (upgrade) a pinned package from the latest uncommited changes one simply has to run opam upgrade --working-dir [pkgs] without the update step.

@voodoos voodoos closed this as completed Sep 21, 2022
@kit-ty-kate
Copy link
Member

If opam update --working-dir without arguments should not be used, it should be shown as an error somewhere

@kit-ty-kate kit-ty-kate reopened this Sep 21, 2022
@rjbou
Copy link
Collaborator

rjbou commented Sep 21, 2022

Yes, the message need to be updated for tis case to be more clear

@rjbou rjbou added the AREA: UI label Sep 21, 2022
@rjbou
Copy link
Collaborator

rjbou commented Sep 21, 2022

But using working-dir with no argument is not an error, it is a no-op.

@rjbou rjbou modified the milestones: 2.1.4, 2.2.0~alpha Oct 14, 2022
@rjbou rjbou added this to To do in Opam 2.2.0 via automation Oct 14, 2022
@rjbou rjbou moved this from To do to Done in Opam 2.2.0 Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Opam 2.2.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants