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

pkg: allow pkg for release builds #11378

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

gridbugs
Copy link
Collaborator

Fixes #11375

@rgrinberg do you remember why "--ignore-lock-dir" was added to the arguments passed by "--release"? Is it now safe to remove?

Signed-off-by: Stephen Sherratt <[email protected]>
@Leonidas-from-XIV
Copy link
Collaborator

Shouldn't --ignore-lock-dir be added to the options of -p instead? Since we want to avoid OPAM triggering dune pkg.

@rgrinberg
Copy link
Member

-p triggers --release. So yes, this is the reason. Opam release builds should ignore lock directories

@gridbugs
Copy link
Collaborator Author

@rgrinberg would there be any harm in moving --ignore-lock-dir to -p. People coming from rust will probably run dune build --release under the (false) belief that it will build their project with more optimization and less debugging, as that's what a "release profile" means in that ecosystem. It will reduce adoption friction if --release doesn't ignore the lockdir.

@rgrinberg
Copy link
Member

Grepping through the opam repository shows me there's a handful of packages that use --release instead of -p. If you'd like to devise a plan to switch them, then sure I don't object.

@gridbugs
Copy link
Collaborator Author

Looks like there's only 5 or so packages whose latest version uses --release in their opam file. I've checked and each package has its opam file checked in to VCS. None of these packages have lockdirs in any of their existing source archives, so we just need to make sure that new releases of these packages change to -p, at least if they start checking in their lockdir. I think we should announce that using --release in opam files is deprecated, make the change to dune moving --ignore-lock-dir to -p, and submit PRs to update the opam files checked into the current projects.

@Leonidas-from-XIV
Copy link
Collaborator

We could already switch the existing releases to -p via a PR to opam-repository, unless there is something specific that prevents them from using --release in favor of -p. This needs to be done anyway, otherwise a new Dune version that enables package mgmt in --release would fail to build the old packages (or add an upper bound on Dune for these packages, but this is generally something we should try to avoid).

@rgrinberg
Copy link
Member

Looks like there's only 5 or so packages whose latest version uses --release in their opam file. I've checked and each package has its opam file checked in to VCS. None of these packages have lockdirs in any of their existing source archives, so we just need to make sure that new releases of these packages change to -p, at least if they start checking in their lockdir. I think we should announce that using --release in opam files is deprecated, make the change to dune moving --ignore-lock-dir to -p, and submit PRs to update the opam files checked into the current projects.

Given the small number of packages in question, I think you should add a step to create an issue in the respective bug trackers telling people they need to switch.

You could also add a new flag (--release-without-lockdir?) that has the old behavior for ease of transition.

@gridbugs
Copy link
Collaborator Author

gridbugs commented Jan 29, 2025

I think you should add a step to create an issue in the respective bug trackers

I was thinking I'd just send a PR that fixes the issue directly, though raising an issue would be less work.

You could also add a new flag (--release-without-lockdir?) that has the old behavior for ease of transition.

Why not just let people use --release --ignore-lockdir? It would presumably have the same effect and not require adding an additional flag. The issue with either of these solutions is it will require projects to update their lower bound for dune to 3.18 (assuming that's the first version where --release does not imply --ignore-lockdir).

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.

Dune does not download dependencies in release profile
4 participants