-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Macro build order #11634
base: development
Are you sure you want to change the base?
Macro build order #11634
Conversation
Could it support explicit number, instead of just two fixed values? E.g. |
I think it'll already be hard enough to get Simon to accept it without precise values 😅 |
I don't like this. We're addressing a short-time problem by introducing a long-term one. Having just Early/Late won't provide enough control, and arbitrary numbers run the risk of creating some kind of arms race. Surely there has to be a more robust way of addressing build macro order problems... |
Some prior art is https://github.com/haxetink/tink_syntaxhub, it uses priority queue to order stuff, so things can specify their order relative to others. |
Compiler can't just guess what macro expects things to be ready when they run and what macro is meant to prepare things. Macros have been built with the previous build order (that was depending on your inheritance level) and now half of them are run in reverse order and things just break in ugly ways. We can't just break openfl + heaps/domkit/hxbit projects + likely other big libs/frameworks with unusable errors and no proper way to update code 😕 before(path)/after(path) could maybe work, though it's not clear how to apply it to build macros. I see two main places: the |
You keep trying to sell me the problem, and I keep telling you that this is not necessary: I acknowledge the problem, I just don't like this particular solution. I like the notion of involving paths, that would be more explicit. |
Where do you think makes more sense for it? On |
I can see both being useful. Some macros might by-design require other macros to run first, so for them it would be good to manage this themselves. However, users that combine macros might still want to be able to control their order. |
The problem I see there is if there's some incompatibility in the rules, but I guess that's already a problem with two build macros requiring to run before (or after) one another.. So we'll just have to error properly in such cases I suppose 🤔 |
Yes, this is essentially a dependency graph and we'll have to detect and report cycles. |
Yeah, error makes sense to me. And to
|
As an alternative to #11622, adds support for
@:buildOrder(Late)
and@:buildOrder(Early)
on build macros, letting those specify if what they're doing requires running before or after other build macros for current type.Added tests pass with 4.3.x but not with current nightlies (compilation error).
Also, windows CI is broken again for some reason...works again this morning 🤷Closes #11194