Skip to content

Update opam install command to correct flag #7340

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jderochervlk
Copy link
Contributor

I noticed while following the setup steps that one of the flags was no longer correct.

$ opam install . --deps-only --with-test --with-dev-setup -y

opam: unknown option `--with-dev-setup', did you mean `-w' ?
Usage: opam install [OPTION]... [PACKAGES]...
Try `opam install --help' or `opam --help' for more information.

From what I can tell that flag is no longer needed: ocaml/dune#10538

cknitt
cknitt previously approved these changes Mar 13, 2025
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Thanks!

@mediremi
Copy link
Contributor

Is it possible you're using opam version 2.1.x or below?

--with-dev-setup was introduced in opam v2.2.0, released July 2024: https://opam.ocaml.org/blog/opam-2-2-0/#Major-change-with-dev-setup

When I initially followed the setup steps, I ran into the same issue as you, but it turned out to be from using the version of opam from the Ubuntu 24.04 repos - currently v2.1.5

When I installed opam with bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)" to get v2.3.0, I no longer had this issue:

~ opam --version
2.3.0
                                                                                                                                     
~ opam install --help | grep with-dev
       --with-dev-setup
       OPAMWITHDEVSETUP see install option `--with-dev-setup'.

@cknitt
Copy link
Member

cknitt commented Mar 14, 2025

Ah right, it even says so in #6901 where this flag was introduced.

I guess this PR can be closed then?

@cknitt cknitt dismissed their stale review March 14, 2025 07:48

Dismissing review because the flag is valid in opam >= 2.2.0

@cknitt
Copy link
Member

cknitt commented Mar 23, 2025

--with-dev-setup was introduced in opam v2.2.0

And the contributing guide already says opam 2.2.0 is needed.
Should probably say ">= 2.2.0" - @jderochervlk would you like to update this PR to make that clearer in the contributing guide?

@cometkim
Copy link
Member

If you're using the devcontainer, it's a problem with the container which is installing opam via APT.

The latest version of OPAM in the Bookworm's registry is 2.1.2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants