-
-
Notifications
You must be signed in to change notification settings - Fork 89
Implement NET*_OR_GREATER preprocessor defines #478
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
Implement NET*_OR_GREATER preprocessor defines #478
Conversation
03cc678
to
97dd37a
Compare
I'm not quite sure why Windows tests specifically are failing, given that the change shouldn't touch anything related to the tests in question. I unfortunately do not have a Windows machine to test on. |
I think the failures are flakes. I've experienced some issues with this test on Windows before. Let's ignore them for now. I can take a look once this has been merged. |
dotnet/private/common.bzl
Outdated
# BFS to recursively find all frameworks that are compatible with the target framework | ||
compatible_frameworks = [] | ||
unvisited_frameworks = [tfm] | ||
for _ in range(2147483647): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we find a better way to do this? Not sure what the perf impact during analysis will be if you have a very large repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, well, it's either this or DFS, which will be equally unbounded. We could however pre-compute the defines and then just reference them like with FRAMEWORK_COMPATIBILITY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can reuse this function here:
rules_dotnet/dotnet/private/common.bzl
Line 18 in 51e5e03
def _collect_transitive(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that we have TRANSITIVE_FRAMEWORK_COMPATIBILITY and used that instead.
We recursively go through FRAMEWORK_COMPATIBILITY to obtain all of the TFMs we are compatible with and expose them as defines.
97dd37a
to
b2d906d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
We recursively go through FRAMEWORK_COMPATIBILITY to obtain all of the TFMs we are compatible with and expose them as defines.
.NET Core and .NET Standard flags have been tested. .NET Framework can't be tested because of #477.