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

Remove ocaml-system from the list of default compilers used during opam init #6307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -20,6 +20,7 @@ users)

## Init
* [BUG] Fix the detection of `ZDOTDIR` when using `zsh` [#6299 @acasta-yhliu - fix #6281]
* Remove `ocaml-system` from the list of default compilers [#6307 @kit-ty-kate - fix #3509]

## Config report

Expand Down
8 changes: 2 additions & 6 deletions src/client/opamInitDefaults.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ let repository_url = {
}

let default_compiler =
OpamFormula.ors [
OpamFormula.Atom (OpamPackage.Name.of_string "ocaml-system",
OpamFormula.Empty);
OpamFormula.Atom (OpamPackage.Name.of_string "ocaml-base-compiler",
OpamFormula.Empty);
]
OpamFormula.Atom (OpamPackage.Name.of_string "ocaml-base-compiler",
OpamFormula.Empty)

let default_invariant =
OpamFormula.Atom
Expand Down
27 changes: 7 additions & 20 deletions tests/reftests/init.test
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,23 @@ Configuring from ${BASEDIR}/opamrc and then from built-in defaults.
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised

<><> Creating initial switch 'default' (invariant ["ocaml" {>= "4.05.0"}] - initially with ocaml-system)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test needs to be fixed with the new behaviour (add -c ocaml-system), and another one added for the change.

<><> Creating initial switch 'default' (invariant ["ocaml" {>= "4.05.0"}] - initially with ocaml-base-compiler)

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml" {>= "4.05.0"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed ocaml-system.4.07.0
-> installed ocaml.4.07.0
-> installed ocaml-base-compiler.4.10.0
-> installed ocaml.4.10.0
Done.
### opam switch invariant
["ocaml" {>= "4.05.0"}]
### opam upgrade
Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).
However, you may "opam upgrade" these packages explicitly at these versions (e.g. "opam upgrade ocaml.4.10.0"), which will ask permission to downgrade or uninstall the conflicting packages.
Already up-to-date.
Nothing to do.
### opam upgrade ocaml
The following actions will be performed:
=== remove 1 package
- remove ocaml-system 4.07.0 [conflicts with ocaml-base-compiler]
=== upgrade 1 package
- upgrade ocaml 4.07.0 to 4.10.0
=== install 1 package
- install ocaml-base-compiler 4.10.0 [required by ocaml]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed ocaml.4.07.0
-> removed ocaml-system.4.07.0
-> installed ocaml-base-compiler.4.10.0
-> installed ocaml.4.10.0
Done.
Already up-to-date.
Nothing to do.
### : Init with config file :
### :: default setup ::
### rm -rf $OPAMROOT
Expand All @@ -155,7 +142,7 @@ No configuration file found, using built-in defaults.
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised
### opam-cat $OPAMROOT/config | 'opam-root-version: "${OPAMROOTVERSION}"' -> 'opam-root-version: current' | grep -v sys-pkg-manager-cmd | grep -v global-variables | grep -v eval-variables:
default-compiler: ["ocaml-system" "ocaml-base-compiler"]
default-compiler: ["ocaml-base-compiler"]
default-invariant: ["ocaml" {>= "4.05.0"}]
depext: true
depext-cannot-install: false
Expand Down
Loading