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

Emulate AssignProjectConfiguration behavior in graph construction #8625

Merged
merged 5 commits into from
Apr 25, 2023

Conversation

dfederm
Copy link
Contributor

@dfederm dfederm commented Apr 3, 2023

Summary

The for sln-based builds, the AssignProjectConfiguration task ends up using the Configuration and Platform defined in the sln rather than passing through the global properties from the referencing project or attempting to do dynamic platform negotiation. This change adds equivalent functionality to graph construction.

A concrete scenario this fixes for graph-based builds using an sln file is that most csproj define the "x86" platform while most vcxproj define "Win32". Previously for a graph build, if the csproj referenced the vcxproj, the platform passed to vcxproj would be x86, not Win32. Even worse, the vcxproj would be an entry point anyway, so it would double-build with both x86 AND Win32, which leads to race conditions.

Customer Impact

Microsoft-internal customer using sln-based builds will be able to opt-into graph builds

Regression?

No

Testing

Manual validation in the customer repo, as well as added unit tests

Risk

Low. Graph builds are a less-used feature, and this adds parity to what non-graph builds and VS-based builds do. It's unlikely that any behavioral change would be impactful due to those other scenarios presumably working for customers who may be using graph builds.

projectReferenceItem,
requesterInstance.GlobalPropertiesDictionary,
// Only allow reuse in scenarios where we will not mutate the collection.
// TODO: Should these mutations be moved to globalPropertiesModifiers in the future?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I'm not planning on addressing this TODO in this PR. Dynamic platform resolution already deviated from this pattern, so a future PR should fix both of these.

@dfederm dfederm force-pushed the graph-reference-sln-config branch from 058f67c to cc4fd19 Compare April 3, 2023 21:20
@rainersigwald rainersigwald self-requested a review April 12, 2023 15:23
@dfederm dfederm changed the base branch from main to vs17.6 April 24, 2023 18:31
@ghost
Copy link

ghost commented Apr 24, 2023

Hello! I noticed that you're targeting one of our servicing branches. Please consider updating the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants