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

Use compiler toolchains when building packages #10478

Merged
merged 3 commits into from
May 7, 2024

Conversation

gridbugs
Copy link
Collaborator

@gridbugs gridbugs commented May 2, 2024

After this change dune will use compiler toolchains when building packages rather than using a compiler from an opam package or the system. This allows dune to build projects on systems where ocaml is not installed, and avoids the relocation issues affecting the compiler package. If the necessary toolchain to build a project is not installed, dune will download, build, and install it before proceeding to build the project.

Download, build, and install the necessary toolchains when building
packages that depend on versions of ocaml supported by the toolchains
feature.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
This prevents dune from attempting to download or build packages
containing compilers whose versions are supported by dune toolchains.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
This forces the dependency solver to choose a compatible version of
the ocaml compiler.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

Looks good

Edit: The tests can probably either be ignored for now or "fixed" to specify 4.14 as version.

@@ -733,6 +733,9 @@ let solve_lock_dir
~pins:pinned_packages
~constraints
=
(* Make sure that the solution contains a version of the compiler
that's compatible with dune toolchains. *)
let constraints = Toolchain.Compiler_package.constraint_ :: constraints in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Smart :-)

(However I am worried that the error message, if the user happens to run into an incompatible compiler will be impossible to understand)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

haha yep for sure, we can tidy this up before merging the toolchains branch into main

@gridbugs gridbugs merged commit ba44785 into ocaml:toolchains May 7, 2024
25 of 27 checks passed
@gridbugs gridbugs deleted the use-toolchains2 branch May 7, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants