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

feature: empty alias #11556

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

feature: empty alias #11556

wants to merge 1 commit into from

Conversation

Alizter
Copy link
Collaborator

@Alizter Alizter commented Mar 22, 2025

This grants #4161.

We add an @empty alias allowing the user to build nothing. We also add a check so that user defined rules are not added to the empty alias.

I don't know if we want to or need to be more strict on the checks. For instance, we can bypass the simple rules and add things to the empty alias, but it seems pointless to check for this all the time.

  • changelog

This grants ocaml#4161.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter requested a review from rgrinberg March 22, 2025 17:05
2 | (alias empty)
3 | (action
4 | (echo "I shouldn't be added!")))
Error: User-defined rules cannot be added to the 'empty' alias
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: make this error message more in line with other similar errors

@Alizter
Copy link
Collaborator Author

Alizter commented Mar 23, 2025

OK so there is a weird constraint here. I've restricted user-defined rules from adding things to the empty alias however a cram test, like we have in the repo, called empty.t will then fail when it generates the empty alias.

This is why the CI is failing because we are failing on this restriction after bootstrapping.

@rgrinberg @snowleopard the idea that users should be restricted from adding rules in the empty alias seems like a good one, but how can we ensure it doesn't restrict people creating cram tests with those names?

@rgrinberg
Copy link
Member

rgrinberg commented Mar 27, 2025

Maybe you can change the test specific aliases to just be the full filename of the test starting from the next version of dune? You can still keep the old names as well, but just warn about empty.t

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.

2 participants