Skip to content

fix: make ignored rules fallback - #8706

Merged
emillon merged 4 commits into
ocaml:mainfrom
emillon:fix-8703
Sep 21, 2023
Merged

emillon merged 4 commits into
ocaml:mainfrom
emillon:fix-8703

Conversation

@emillon

@emillon emillon commented Sep 19, 2023

Copy link
Copy Markdown
Collaborator

Fixes #8703

This is a lighter change than the original in #8518.

@emillon
emillon requested a review from rgrinberg September 19, 2023 13:48
Fixes ocaml#8703

This is a lighter change than the original in ocaml#8518.

Signed-off-by: Etienne Millon <[email protected]>
@emillon

emillon commented Sep 20, 2023

Copy link
Copy Markdown
Collaborator Author

I had a look at how we could extend that mechanism (turning to fallback instead of removing them) to user-provided rules but I'm not sure how it would work in practice.

Did you mean something like the following?

  • if dune-lang < 3.5, ignore "strictly promote" rules, interpret promote-until-clean as intended
  • if dune-lang >= 3.5 but < 3.11, ignore all promote rules
  • if dune-lang >= 3.11, turn all promote rules into fallback rules

@rgrinberg

Copy link
Copy Markdown
Member

To be clear, making --ignore-promoted-rules depend on the version in the dune-project is a mistake. This option should work for all rules (internal and user defined) across all versions of the dune language.

@emillon

emillon commented Sep 20, 2023

Copy link
Copy Markdown
Collaborator Author

Ok. We can remove that version check. It's likely to surface some issues in some projects, though. What do we do for 3.11? Is the fix in this PR enough, and we'll remove the version check for user rules in 3.12?

@rgrinberg

Copy link
Copy Markdown
Member

It's likely to surface some issues in some projects, though. What do we do for 3.11? Is the fix in this PR enough, and we'll remove the version check for user rules in 3.12?

I'd just do it in one go. It becomes hard to keep a map in your head of how things work between different versions of dune if we split a logical change in chunks like that.

Tbh, if this change is so painful to include in 3.11, you could always revert it in that branch and we could keep it in main until we decide to make another release.

@emillon

emillon commented Sep 20, 2023

Copy link
Copy Markdown
Collaborator Author

OK. The next round of testing will reveal what breaks. I'll do the other change in a separate PR to ease reverting.

@emillon

emillon commented Sep 21, 2023

Copy link
Copy Markdown
Collaborator Author

Other fix is in #8721

@emillon
emillon merged commit b326c30 into ocaml:main Sep 21, 2023
emillon added a commit to emillon/opam-repository that referenced this pull request Sep 21, 2023
CHANGES:

- Turn internal promote rules into fallback rules when
  `--ignore-promoted-rules` is set (ocaml/dune#8518, ocaml/dune#8706, fix ocaml/dune#8417, fix ocaml/dune#8703,
  @rgrinberg, @emillon)

- Make copy sandbox support directory targets. (ocaml/dune#8705, fixes ocaml/dune#7724, @emillon)
emillon added a commit to emillon/dune that referenced this pull request Sep 21, 2023
Signed-off-by: Etienne Millon <[email protected]>
Some rule.targets
let rule = make_rule t ?mode ?loc ~dir build in
let+ () = Rules.Produce.rule rule in
Some rule.targets

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function no longer needs to return option

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rgrinberg added a commit to rgrinberg/jbuilder that referenced this pull request Sep 21, 2023
rgrinberg added a commit to rgrinberg/jbuilder that referenced this pull request Sep 21, 2023
This reverts commit b326c30.

Signed-off-by: Rudi Grinberg <[email protected]>
rgrinberg added a commit to rgrinberg/jbuilder that referenced this pull request Sep 21, 2023
This reverts commit b326c30.

Signed-off-by: Rudi Grinberg <[email protected]>
rgrinberg added a commit that referenced this pull request Sep 21, 2023
* refactor: simplify left over type signature

Signed-off-by: Rudi Grinberg <[email protected]>

* Revert "refactor: simplify left over type signature"

This reverts commit ec929ce.

Signed-off-by: Rudi Grinberg <[email protected]>

* Revert "fix: make ignored rules fallback (#8706)"

This reverts commit b326c30.

Signed-off-by: Rudi Grinberg <[email protected]>

* Revert "fix: --ignore-promoted-rules should work on internal rules (#8518)"

This reverts commit 853490b.

Signed-off-by: Rudi Grinberg <[email protected]>

* test: promote

Signed-off-by: Rudi Grinberg <[email protected]>

---------

Signed-off-by: Rudi Grinberg <[email protected]>
@Alizter Alizter added this to the 3.11.0 milestone Jul 9, 2026
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.

missing opam file causes build failure

3 participants