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

Update target config after init macros #11985

Merged
merged 2 commits into from
Feb 10, 2025
Merged

Conversation

kLabz
Copy link
Contributor

@kLabz kLabz commented Feb 6, 2025

One example that does go wrong is setting -D js-unflatten during init macros: generation will follow this define, but reserved names will be computed with js flatten.

@kLabz kLabz added this to the 5.0 preview 1 milestone Feb 6, 2025
@kLabz
Copy link
Contributor Author

kLabz commented Feb 6, 2025

@Simn can you think of things that could potentially go wrong when doing that, so that I can check if it's ok?

@kLabz kLabz removed the test-needed label Feb 6, 2025
@kLabz
Copy link
Contributor Author

kLabz commented Feb 6, 2025

Also could be a candidate for a potential 4.3.x release.

@Simn
Copy link
Member

Simn commented Feb 10, 2025

I think this is fine, but I'm unsure if there really should be 3 calls to update_platform_config. Could you check if we still need the one in compiler.ml with this change? There's a comment there saying "make sure to adapt all flags changes defined after platform" but I don't really know what that means, so maybe some clarification would be good here.

@kLabz
Copy link
Contributor Author

kLabz commented Feb 10, 2025

It doesn't seem like we have tests for this, so it's a bit hard to tell.

However, we do expose platform config to init macros through Compiler.getConfiguration(), so this would likely have an impact, meaning that as far as macros are concerned, all of these calls are necessary to provide correct data?

Also, what I saw when looking at this is that after_target_init callback is being called after the update_platform_config call you mentioned, meaning any changes in init macros wouldn't be considered there; maybe that's ok? (though projects that have defines added during init macros will have a different signature in there) Anyway, that isn't related to this PR.

@Simn Simn merged commit 0ee1a66 into development Feb 10, 2025
115 checks passed
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