Skip to content

Commit

Permalink
the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Oct 22, 2024
1 parent 9dc96e1 commit 7f616a2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
22 changes: 22 additions & 0 deletions src/client/opamAuxCommands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,28 @@ let autopin_aux st ?quiet ?recurse ?subpath ?locked
let to_pin, atoms =
resolve_locals ?quiet ?recurse ?subpath ?locked atom_or_local_list
in
let atoms =
(* Ensure the atoms are set to their expected version *)
List.map (function
| name, None ->
begin match
List.find_opt
(fun {pin_name; _} -> OpamPackage.Name.equal pin_name name)
to_pin
with
| None -> (name, Some (`Eq, OpamPinCommand.default_version st name))
| Some {pin = {pin_file; _}; _} ->
let opam_file = OpamFile.OPAM.safe_read pin_file in
let v = match OpamFile.OPAM.version_opt opam_file with
| None -> OpamPinCommand.default_version st name
| Some v -> v
in
(name, Some (`Eq, v))
end
| (_, Some _) as atom -> atom
(* TODO: does autopin really need other forms of atoms than `Eq ? *)
) atoms
in
if to_pin = [] then
atoms, to_pin, OpamPackage.Set.empty, OpamPackage.Set.empty
else
Expand Down
20 changes: 11 additions & 9 deletions tests/reftests/6248.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ camlidl is now pinned to git+https://github.com/xavierleroy/camlidl.git#1c1e87e3
[apron.v0.9.15] synchronised (no changes)
apron is now pinned to git+https://github.com/antoinemine/apron.git#418a217c7a70dae3f422678f3aaba38ae374d91a (version v0.9.15)
The following actions will be faked:
=== install 72 packages
=== install 73 packages
- install angstrom 0.16.1 [required by uri]
- install arg-complete 0.1.0 [required by goblint]
- install astring 0.8.5 [required by fpath]
Expand Down Expand Up @@ -70,11 +70,12 @@ The following actions will be faked:
- install ocamlfind 1.9.6 [required by fpath, batteries, uuidm]
- install ordering 3.16.0 [required by dyn, stdune]
- install pp 1.2.0 [required by dune-private-libs]
- install ppx_blob 0.9.0 [required by goblint]
- install ppx_derivers 1.2.1 [required by ppx_deriving]
- install ppx_deriving 6.0.3 [required by goblint]
- install ppx_deriving_hash 0.1.2 [required by goblint]
- install ppx_deriving_yojson 3.9.0 [required by goblint]
- install ppxlib 0.33.0 [required by ppx_deriving_hash]
- install ppxlib 0.33.0 [required by goblint]
- install qcheck-core 0.22 [required by goblint]
- install rresult 0.7.0 [required by bos]
- install seq base [required by fileutils]
Expand Down Expand Up @@ -139,6 +140,7 @@ Faking installation of fileutils.0.6.4
Faking installation of integers.0.7.0
Faking installation of ctypes.0.23.0
Faking installation of ppxlib.0.33.0
Faking installation of ppx_blob.0.9.0
Faking installation of ppx_deriving.6.0.3
Faking installation of ppx_deriving_hash.0.1.2
Faking installation of sha.1.15.4
Expand Down Expand Up @@ -167,11 +169,11 @@ Done.
### opam install --check ./analyzer
All dependencies installed
### opam install --show --deps-only ./analyzer
The following actions would be performed:
=== install 1 package
- install ppx_blob 0.9.0 [required by goblint]
Nothing to do.
### opam install --show --check --locked ./analyzer
All dependencies installed
Missing dependencies:
angstrom apron base-bytes bigstringaf camlidl conf-findutils conf-gmp-paths conf-mpfr-paths cppo ctypes ez-conf-lib jsonrpc mlgmpidl num ocaml ocaml-compiler-libs ocaml-config ocaml-option-flambda ocaml-variants ocamlbuild ppx_deriving ppx_deriving_yojson ppxlib qcheck-core sexplib0 uuidm yojson
# Return code 1 #
### opam install --show --deps-only --locked ./analyzer
The following actions would be performed:
=== remove 3 packages
Expand All @@ -196,7 +198,7 @@ The following actions would be performed:
- downgrade sexplib0 v0.17.0 to v0.16.0 [required by goblint]
- downgrade uuidm 0.9.9 to 0.9.8 [required by goblint]
- downgrade yojson 2.2.2 to 2.2.1 [required by goblint]
=== recompile 42 packages
=== recompile 43 packages
- recompile arg-complete 0.1.0 [uses cppo, dune]
- recompile astring 0.8.5 [uses ocaml]
- recompile base-nnp base [uses base-domains]
Expand Down Expand Up @@ -227,6 +229,7 @@ The following actions would be performed:
- recompile ocamlfind 1.9.6 [uses ocaml]
- recompile ordering 3.16.0 [uses ocaml]
- recompile pp 1.2.0 [uses ocaml]
- recompile ppx_blob 0.9.0 [uses ocaml]
- recompile ppx_derivers 1.2.1 [uses ocaml]
- recompile ppx_deriving_hash 0.1.2 [uses dune]
- recompile rresult 0.7.0 [uses ocaml]
Expand All @@ -239,7 +242,7 @@ The following actions would be performed:
- recompile uri 4.4.0 [uses angstrom]
- recompile yaml 3.2.0 [uses ocaml]
- recompile zarith 1.14 [uses ocaml]
=== install 12 packages
=== install 11 packages
- install apron v0.9.15 (pinned) [required by goblint]
- install base-bytes base [required by goblint]
- install camlidl 1.12 (pinned) [required by goblint]
Expand All @@ -251,4 +254,3 @@ The following actions would be performed:
- install ocaml-option-flambda 1 [required by goblint]
- install ocaml-option-nnp 1 [required by base-nnp, ocaml-variants]
- install ocaml-variants 4.14.2+options [required by goblint]
- install ppx_blob 0.9.0 [required by goblint]

0 comments on commit 7f616a2

Please sign in to comment.