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

Switch the default version when undefined from ~dev to dev #4949

Merged
merged 3 commits into from
Dec 10, 2021

Conversation

kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented Dec 7, 2021

Makes it easier to mix pin packages and packages from the repository without having to set the version again when encountering an issue.

When you take the development version of something you expect more often to be ahead of the latest release rather than the opposite.

Issue encountered by @bikallem

src/client/opamPinCommand.mli Outdated Show resolved Hide resolved
@bikallem
Copy link

bikallem commented Dec 7, 2021

Not sure if the issue belongs to this PR, but here is another issue:
I did opam pin . --with-version 0.6.1 on root dir of repo/branch https://github.com/bikallem/resto/tree/no-lwt-4.12.0%2Bdomains. However, it seems opam pin doesn't respect the dependencies of opam packages. That is resto should be pinned/installed first and then resto-lwt and so on and so forth. However, this doesn't seem to be happening, I get the following error on my first try with the `opam pin . --with-version 0.6.1' command,

#=== ERROR while compiling resto-lwt.0.6.1 ====================================#
# context     2.1.1 | linux/x86_64 | ocaml-variants.4.12.0+domains | pinned(git+file:///home/bikal/ocamllabs/resto#no-lwt-4.12.0+domains#2b60417c)
# path        ~/.opam/4.12.0+domains/.opam-switch/build/resto-lwt.0.6.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p resto-lwt -j 47
# exit-code   1
# env-file    ~/.opam/log/resto-lwt-133343-63c2fb.env
# output-file ~/.opam/log/resto-lwt-133343-63c2fb.out
### output ###
# File "src/dune", line 11, characters 12-17:
# 11 |  (libraries resto lwt lwt.unix cohttp-lwt cohttp-lwt-unix conduit-lwt-unix))
#                  ^^^^^
# Error: Library "resto" not found.
# Hint: try:
#   dune external-lib-deps --missing --no-config --root . --ignore-promoted-rules --default-target @install --always-show-command-line --promote-install-files --release --only-packages resto-lwt -p resto-lwt --profile release -j 47 @install

I need to execute opam pin . --with-version 0.6.1 several times for the packages to be pinned correctly. Each time the error is because dependent packages are not pinned first. Could this be addressed too in this PR or is this a separate issue altogether?

Note: I haven't tested this PR yet. The error description above is with stock opam 2.1.1

@kit-ty-kate
Copy link
Member Author

That is resto should be pinned/installed first and then resto-lwt and so on and so forth.

@bikallem I’m not seeing the dependency to resto in your resto-lwt package anywhere

@kit-ty-kate kit-ty-kate added this to PR in progress in Opam 2.2.0 via automation Dec 7, 2021
@kit-ty-kate kit-ty-kate moved this from PR in progress to PR to review in Opam 2.2.0 Dec 7, 2021
@rjbou rjbou added this to the 2.2.0~alpha milestone Dec 7, 2021
@kit-ty-kate kit-ty-kate merged commit 3d58d5c into ocaml:master Dec 10, 2021
Opam 2.2.0 automation moved this from PR to review to Done Dec 10, 2021
@kit-ty-kate kit-ty-kate deleted the pin-dev branch December 10, 2021 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Opam 2.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants