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 4 commits into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

Fixes #3509

I don't think having ocaml-system in the list of default compiler is a good choice.
Most platforms actually won't work if you installed the ocaml package alone. They usually all require some sort of extra ocaml-compiler-libs to be complete and not end up in very confusing error messages for new users.

System compilers are also not tested in the CI for opam-repository as of today (see ocurrent/opam-repo-ci#327) and end up breaking packages from time to time.

Experienced developers can always use opam init -c ocaml-system if they really want a system compiler and ocaml-system can always be installed explicitly later if needed, but as a default for everyone it seems to brittle to me.

@rjbou
Copy link
Collaborator

rjbou commented Nov 25, 2024

Discussion on dev meeting: For a transition phase, we should detect presence of a system ocaml and display a hint for the command to run to have by default ocaml-system.
This change also affects default switch creation, not only init.

@kit-ty-kate
Copy link
Member Author

For a transition phase, we should detect presence of a system ocaml and display a hint for the command to run to have by default ocaml-system.

I'm not sure if we want that, reading such a message would be confusing to users. I would rather make it clear on the release note instead.

This change also affects default switch creation, not only init.

I'm not sure to understand what you mean. As far as i know opam init is the only subcommand affected

@kit-ty-kate kit-ty-kate requested a review from rjbou February 9, 2025 14:03
@rjbou rjbou force-pushed the no-default-ocaml-system branch from 0ea4264 to e002d57 Compare February 19, 2025 17:59
Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

I've added a commit to label the test to show their purpose, and a commit that contains a proposal to modify the tests :

  • I:3: show the defaut, so it is updated to show base compiler selection
  • I:4: added to show the behaviour of system compiler explicit selection

@@ -110,21 +110,23 @@ Done.
### rm -rf ${OPAMROOT}
### <opamrc>
eval-variables: [ sys-ocaml-version ["echo" "4.07.0"] "new system compiler" ]
### opam init --no-setup --bypass-checks default REPO/ --config opamrc | grep -v Cygwin
### opam init --no-setup --bypass-checks default REPO/ --config opamrc -c ocaml-system | grep -v Cygwin
Copy link
Collaborator

Choose a reason for hiding this comment

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

The purpose of the test is to show the default chosen compiler, so there is no need to add ocaml-system compiler in cli. A new test should be added to show the behaviour when choosing ocaml-system

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure to understand. This goes against what you asked for on your last review: #6307 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I forgot that i proposed that months ago. Looking deeper this time for a proper review I think it is better to keep the idea of the test (it is now labeled: what should be the default choice and how opam should behave), and add another for ensuring that ocaml-system is well installed when requested, and how (invariant, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not use system switch by default
2 participants