-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Support laxer isolation mode -isolate:Message
#8249
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
Support laxer isolation mode -isolate:Message
#8249
Conversation
|
Discussed offline with @Forgind and @dfederm:
|
9363748 to
1ae9802
Compare
…4386) (#8257) Fixes #4386 Context Any cache entries from projects excluded from isolation constraints should be excluded from the output results cache file. Changes Made Only the cache entry with the smallest configuration ID (that of the project to be built in isolation) should be serialized into the output results cache file. As described in #4386, this prevents the case where dependency projects pass down the same cache entry obtained through skipping/violating isolation constraints to a dependent project, creating duplicate input cache entries. Testing Added a UT. Notes Addressing this issue since it came up frequently when testing #8249.
1ae9802 to
ec3de5f
Compare
163fda9 to
6e6e971
Compare
6e6e971 to
0f2e915
Compare
rainersigwald
left a comment
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'm very confused by the Targets list and would like clarity on that before digging back in.
0f2e915 to
5dbca2a
Compare
rainersigwald
left a comment
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.
Overall LGTM but some comments to clarify the fairly complicated flow and tests here would be highly appreciated.
…ojects' result caches
bf03174 to
c6df3fb
Compare
c6df3fb to
7fb580d
Compare
…#8330) Fixes #4252 Context This PR extracts the relevant logic from the closed #5297, which adds support for the SkipNonexistentTargets metadatum on the ProjectReferenceTargets item: <ProjectReferenceTargets Include='<some-target>' Targets='<some-target1>;<some-target2>' SkipNonexistentTargets='<boolean>'> If SkipNonexistentTargets is true, then any targets in Targets are skipped if they're nonexistent. SkipNonexistentTargets cannot be added to ProjectReferenceTargets items whose Targets contain .default or .projectReferenceTargetsOrDefaultTargets, which represent the default targets and targets specified on the ProjectReference item (with fallback to default targets if none are specified), respectively. Changes Made GetTargetLists filters out skippable nonexistent targets on referenced projects. Determining whether a target is skippable required storing the defined project targets in BuildResults to ensure that corresponding BuildRequestConfigurations on the build manager node have set project targets if the build manager node created a configuration based on a request from an external node but hadn't received a result (since the project may not have been loaded locally and thus the project targets would be unknown). Added SkipNonexistentTargets='true' to GetTargetFrameworks since in the non-graph case it is added to the relevant MSBuild task. Testing UTs and manual testing with /graph and /graph /isolate (the latter run without restore being called due to #6856) on the erroring repos I saw when testing #8249. Notes Addressing this since it came up when testing #8249.
Update documentation given the merge of #8249, #8257, and #8330. --------- Co-authored-by: Rainer Sigwald <[email protected]>
Context
Support a laxer isolation mode
-isolate:MessageUponIsolationViolation(or its short form-isolate:Message) for builds unable to adhere to the restrictive isolation mode-isolate:True, piggybacking on the existingskipStaticGraphIsolationConstraintsflag. Isolation violations are logged as messages.Changes
-isolateswitch:MessageUponIsolationViolation(short formMessage).TargetResults for top-level targets are serialized into the output cache. This is to mitigate the chances of isolation-violating dependency targets relying on state potentially mutated by cached dependency targets. (E.g., the definition of a property.) As such, it is still possible for a dependent project to have a config entry C in its override caches and still need to obtainBuildResults from C in isolation violation, requiring placing them in the override result cache instead of the current cache to maintain the invariant of no overlap configs across the override and current caches.IsolateProjectsgetter/setter for API backwards compat.