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

Update remaining references to base packages #4623

Merged
merged 5 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ New option/command/subcommand are prefixed with ◈.
## Switch
* Don't exclude base packages from rebuilds (made some sense in opam 2.0
with base packages but doesn't make sense with 2.1 switch invariants) [#4569 @dra27]
* Don't refer to base packages in messages any more [#4623 @dra27 - fixes #4572]

## Pin
* Don't look for lock files for pin depends [#4511 @rjbou - fix #4505]
Expand Down
21 changes: 10 additions & 11 deletions src/client/opamClient.ml
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ let fixup t =
let t, result = match solution with
| Conflicts cs -> (* ouch... *)
OpamConsole.error
"It appears that the base packages for this switch are no longer \
available. Either fix their prerequisites or change them through \
'opam list --base' and 'opam switch set-base'.";
"It appears that the switch invariant is no longer satisfiable. \
Either fix the package prerequisites or change the invariant \
with 'opam switch set-invariant'.";
OpamConsole.errmsg "%s"
(OpamCudf.string_of_conflicts t.packages
(OpamSwitchState.unavailable_reason t) cs);
Expand Down Expand Up @@ -1126,16 +1126,15 @@ let install_t t ?ask ?(ignore_conflicts=false) ?(depext_only=false)
{ t with installed_roots =
OpamPackage.Set.add nv t.installed_roots }
| Some false ->
if OpamPackage.Set.mem nv t.compiler_packages then
(OpamConsole.note
"Package %s is part of the compiler base and can't be set \
as 'installed automatically'"
(OpamPackage.name_to_string nv);
t)
else if OpamPackage.Set.mem nv t.installed_roots then
if OpamPackage.Set.mem nv t.installed_roots then begin
if OpamPackage.Set.mem nv t.compiler_packages then
OpamConsole.note
"Package %s is part of the switch invariant and won't be uninstalled \
unless the invariant is updated."
(OpamPackage.name_to_string nv);
{ t with installed_roots =
OpamPackage.Set.remove nv t.installed_roots }
else
end else
(OpamConsole.note
"Package %s is already marked as 'installed automatically'."
(OpamPackage.Name.to_string nv.name);
Expand Down
4 changes: 2 additions & 2 deletions src/client/opamSwitchCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ let install_compiler ?(additional_installs=[]) ?(deps_only=false) t =
| Success s -> s
| Conflicts cs ->
OpamConsole.error
"Could not resolve base install for this switch:";
"Could not determine which packages to install for this switch:";
OpamConsole.errmsg "%s\n"
(OpamCudf.string_of_conflicts t.packages
(OpamSwitchState.unavailable_reason t) cs);
Expand All @@ -236,7 +236,7 @@ let install_compiler ?(additional_installs=[]) ?(deps_only=false) t =
s_downgrade=0; s_remove = 0 } -> ()
| stats ->
OpamConsole.error_and_exit `No_solution
"Inconsistent resolution of base package installs:\n%s"
"Inconsistent resolution of packages:\n%s"
(OpamSolver.string_of_stats stats)
in
let to_install_pkgs = OpamSolver.new_packages solution in
Expand Down
2 changes: 1 addition & 1 deletion tests/reftests/conflict-camlp4.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ f372039d

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["camlp4" "ocaml-system"]
[ERROR] Could not resolve base install for this switch:
[ERROR] Could not determine which packages to install for this switch:
* Incompatible packages:
- (invariant) -> camlp4
- (invariant) -> ocaml-system
Expand Down