-
Notifications
You must be signed in to change notification settings - Fork 413
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
[RFC] replace action
field of alias
stanza by alias
field in rule
stanza
#2681
Comments
First, I want to say that "dependency of the alias" sounds ambiguous to me because alias has two kinds of dependencies and we should try to clarify that terminology. Consider a rule like this:
Let's call the set of files whose changes cause the rebuild of "x" an "expansion" of the alias foo. (similar to expansion of a variable, as @rgrinberg suggested) Where @diml mentions dependencies of the alias above he clearly means the expansion of the alias. The second idea of dependencies is the set of actions that contribute to the build result (transitively or directly) when you ask dune to build an alias. I like to call those "dependencies", but for clarity here let's call them "transitive dependencies" (for avoidance of doubt, transitive deps are not obtained by transitively closing over expansions). When the rule is assigned to the alias it should absolutely become the "transitive dependency" of the alias, but I'm much less convinced that its targets should become a part of alias "expansion". In fact I would expect the rule to contribute nothing at all to the alias expansion. In the meeting we also discussed that the idea of alias expansions should be eventually deprecated in favor of variables. I like that idea and if we're moving that way I think it makes sense to avoid adding more things to the expansions. Other than that, I very much support the idea and on top of simplifying aliases (which is a win already) it makes a common idiom shorter. Instead of writing
you just write:
One implementation detail that could be annoying is to add support for rules with an empty set of targets. Maybe it's not too difficult though. |
I thought more about this and I agree that we shouldn't add the targets to the expansion of the alias. So happy to drop that part. Regarding rules with an empty set of targets, we can do something similar to what we do now for aliases with actions, i.e. replace |
That sounds like it should work. |
This looks like a good idea. A small thing that would be useful as well is to make sure that |
Just to understand better, can you show me an example of such a rule? |
Such rules are not currently supported. The idea is that they will replace the
We would instead write:
|
I'm not particularly excited about the idea of removing things from the |
My issue is not with the |
(but this is more or less orthogonal to the issue at hand, so let's discuss this elsewhere) |
While working on this I found that we the current |
Removed from the 2.0.0 milestone, it feels like a too big change at this point. |
Ah well it’s essentially done at this point. Anyway, I won’t press as I can’t see a reason why it can’t ship in 2.1
…On Oct 28, 2019, 10:08 PM +0900, Jérémie Dimino ***@***.***>, wrote:
Removed from the 2.0.0 milestone, it feels like a too big change at this point.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I still need the 2nd part of this issue: deprecate the action field for the alias stanza. Do we need to add an intermediate deprecation message somewhere? Or is it sufficient that we simply disallow |
Whether we disallow or deprecate the action field, the replacement needs to be fully ready. In particular, we need the If we do all this for 2.0.0, then we can effectively disallow I'm just a bit worried that this looks like a big change close to release time. But apart from that I have no objection. |
Whether we disallow or deprecate the action field, the replacement needs to be fully ready. In particular, we need the package field for rules.
I must have forgot mention this in the PR but I ended up doing this already. The rule stanza covers all the use cases in master. I can port the alias uses with action in dune itself to show this
…On Nov 4, 2019, 8:12 PM +0900, Jérémie Dimino ***@***.***>, wrote:
Whether we disallow or deprecate the action field, the replacement needs to be fully ready. In particular, we need the package field for rules.
If we do all this for 2.0.0, then we can effectively disallow action for >= 2.0. Otherwise, it needs to be only deprecated and we'll get rid of the action field in alias in 3.0.
I'm just a bit worried that this looks like a big change close to release time. But apart from that I have no objection.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ok, no objection to doing the switch now and disallowing the |
See this pr: #2846 |
This is now complete |
Right now, when one writes:
It's not entirely clear whether
x
is a dependency of the action or the alias. In particular, Dune and Jenga (inside Jane Street) accidentally made two different choices which indicates that the semantic is not obvious. In Jenga,x
is a dependency of the action but not the alias, and in Dunex
is a dependency of both.Additionally, it always a bit annoying when the action produces something as aliases are not supposed to have targets.
To clarify all this, I propose the following change in the 2.x version of the language:
action
field from the alias stanzaalias
field to therule
stanzaadding
(alias foo)
to a rule would basically add the targets as dependency of the alias, even if the rule has no targets.The text was updated successfully, but these errors were encountered: