Skip to content

Conversation

@ElectreAAS
Copy link
Collaborator

@ElectreAAS ElectreAAS commented Oct 29, 2024

This PR sports 2 commits, the first one being a less-committed approach to the situation, the second a more complete one. just the one commit that makes the flag enabled by default.

There seems to be sentiment around the dune team (cc @Leonidas-from-XIV @rgrinberg @gridbugs in particular) that:

  1. The 'toolchains' feature is stable and tested enough to "ascend" to an official feature of Dune.
  2. The problem that it solves (the compiler being non-relocatable) is going to stay relevant for a while.

Thus, I propose that we get rid of promote the feature flag.
Note that this is a BREAKING change for users who use ./configure --toolchains disabled obviously, but also ./configure --toolchains enabled as the flag will no longer get recognized.
Not a breaking change anymore, I just changed the default.

@ElectreAAS
Copy link
Collaborator Author

cc @maiste I think the binary release would need to be updated if this is merged.

Copy link
Collaborator

@maiste maiste left a comment

Choose a reason for hiding this comment

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

Indeed! To prevent this from happening, could you also update the /flake.nix file and remove the flag, please? 😄 Nothing to do on the binary-distribution side.

@ElectreAAS
Copy link
Collaborator Author

could you also update the /flake.nix file and remove the flag, please?

Done!

@rgrinberg
Copy link
Member

Instead of removing it, you could also just flip the default. Not sure if we'd like to keep this mode, but we don't have to delete it right away

Copy link
Collaborator

@maiste maiste left a comment

Choose a reason for hiding this comment

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

Depending on if you prefer to go with @rgrinberg solution or not. But otherwise, LGTM.

let is_compiler name =
let module Package_name = Dune_pkg.Package_name in
let compiler_package_names =
(* TODO don't hardcode these names here *)
Copy link
Member

Choose a reason for hiding this comment

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

You could probably check this by looking at the compiler value in the list of flags: (in the opam file).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, that would be cleaner. However I can't find a way to transmute a Dune_lang.Package_name.t into a Dune_pkg.Opam_file.t = OpamParserTypes.FullPos.opamfile, which would allow looking into the flags

As this is not related to the core of this PR, I'll leave the TODO for now

Copy link
Collaborator

Choose a reason for hiding this comment

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

What you're trying is not possible. A Package_name.t is just the name of a package (basically a fancy way to say string); to get an Opam_file.t you'd need to load an opam repository, look up a Package_name.t and a Package_version.t into a specific OPAM file and then check its flags there.

I also vaguely recall that there was some issue about determining the packages affected from the compiler flag, but I don't recall the details anymore.

@ElectreAAS ElectreAAS force-pushed the promote-feature-flag branch from b29f3c6 to 28fbd42 Compare October 31, 2024 12:50
Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
@ElectreAAS ElectreAAS force-pushed the promote-feature-flag branch from 28fbd42 to bcbff43 Compare October 31, 2024 16:53
@ElectreAAS
Copy link
Collaborator Author

ElectreAAS commented Oct 31, 2024

I ended up with only the soft approach: make it enabled by default but not delete it entirely.
If in the future we feel this is unnecessary, we can always remove it

Also this is rebased on main now

@rgrinberg rgrinberg merged commit 93a1653 into ocaml:main Oct 31, 2024
@ElectreAAS ElectreAAS deleted the promote-feature-flag branch November 4, 2024 08:00
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.

6 participants