Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

sin-ack
Copy link
Contributor

@sin-ack sin-ack commented Mar 17, 2025

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.

@sin-ack sin-ack requested a review from purkhusid as a code owner March 17, 2025 08:39
@sin-ack sin-ack force-pushed the framework-preprocessor-defines branch from 03cc678 to 97dd37a Compare March 17, 2025 08:56
@sin-ack
Copy link
Contributor Author

sin-ack commented Mar 17, 2025

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.

@purkhusid
Copy link
Collaborator

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.

# BFS to recursively find all frameworks that are compatible with the target framework
compatible_frameworks = []
unvisited_frameworks = [tfm]
for _ in range(2147483647):
Copy link
Collaborator

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.

Copy link
Contributor Author

@sin-ack sin-ack Mar 17, 2025

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.

Copy link
Collaborator

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:

def _collect_transitive():

Copy link
Contributor Author

@sin-ack sin-ack Mar 17, 2025

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.
@sin-ack sin-ack force-pushed the framework-preprocessor-defines branch from 97dd37a to b2d906d Compare March 17, 2025 13:04
@sin-ack sin-ack requested a review from purkhusid March 17, 2025 13:47
Copy link
Collaborator

@purkhusid purkhusid left a comment

Choose a reason for hiding this comment

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

🎉

@purkhusid purkhusid merged commit 1e33eb7 into bazel-contrib:master Mar 17, 2025
1 check failed
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