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

Pass TFM into Buildalyzer build #3185

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

slang25
Copy link

@slang25 slang25 commented Feb 6, 2025

See here: phmonte/Buildalyzer#297 (comment)
and #3181 for context.

Passing the TFM into Buildalyzer prevents all TFMs being built for a multitarget project.

@dupdob
Copy link
Member

dupdob commented Feb 6, 2025

Not sure of the link with issue #3181.
Specifying the TFM to Buildalyzer/MsBuild does result in forcing the TFM for every project, even if no configuration exist for said TFM.

We tried this in the past and it resulted in unexpected results when working on non trivial multitargeting project, such as library project targeting some netstandard version and test projects targeting some actual framework version.

At best, we could make this behavior an option, so user could reduce the initialization time when this is supported by the project, but It cannot be the default behavior.

@martincostello
Copy link

We tried this in the past and it resulted in unexpected results when working on non trivial multitargeting project, such as library project targeting some netstandard version and test projects targeting some actual framework version.

Yeah, I think this was #3038 as it caused issues with Polly.

@dupdob
Copy link
Member

dupdob commented Feb 6, 2025

yes. @martincostello 's comment gave me the opportunity to look again at my resolution table and fix an error there.

@slang25 slang25 marked this pull request as draft February 6, 2025 13:08
@slang25
Copy link
Author

slang25 commented Feb 6, 2025

Ah! Thanks @martincostello and @dupdob for the context. Yeah that makes total sense. I've plugged in the NuGet FrameworkReducer class, which provides a GetNearest(...) method, which I think is the exact sort of thing we need here.

I've tried to make it as graceful as possible, so if it comes back null it will just do what it did before. I'll have a look at adding some more tests cases, I have 1 unexpected result so far which I'll work on getting sorted, then this should be good for review again.

@dupdob
Copy link
Member

dupdob commented Feb 6, 2025

that was not my point. I am afraid this will not solve the issue mentioned in #3038: we do not know how framework selection work with project dependency resolution. Trying to force a framework for every single project will lead to undefined behvaviour.

What problem are you trying to solve here? you should open an issue so we can discuss how to achieve the desired outcome

@slang25
Copy link
Author

slang25 commented Feb 6, 2025

Sure I'll create an issue to explain

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.

3 participants