Skip to content

Fix item update evaluation when path contains parenthesis and add test coverage - #11293

Merged
YuliiaKovalova merged 3 commits into
dotnet:mainfrom
YuliiaKovalova:dev/ykovalova/fix_item_manipulations
Jan 31, 2025
Merged

YuliiaKovalova merged 3 commits into
dotnet:mainfrom
YuliiaKovalova:dev/ykovalova/fix_item_manipulations

Conversation

@YuliiaKovalova

Copy link
Copy Markdown
Member

Fixes #11237

Context

Currently we put a non-normalized path in the dictionary
msbuild/src/Build/Evaluation/LazyItemEvaluator.cs

and later attempt to pull from it a normalized version
msbuild/src/Build/Evaluation/LazyItemEvaluator.cs

In runtime it looks like this when path contains parenthesis:
we put C:\msbuild\msbuild_yk\msbuild\artifacts\bin\bootstrap\core\CheckSignApk%28\Microsoft.NETCore.App
we pull C:\msbuild\msbuild_yk\msbuild\artifacts\bin\bootstrap\core\CheckSignApk(\Microsoft.NETCore.App

Changes Made

adjust operation of adding to the dictionary and pulling values from it.

Testing

UI + manual

@Forgind Forgind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a promising start, but it isn't a complete fix. This only affects item update, and as I mentioned later in the issue, this bug also applies to include. I manually tested the include-only version with your changes just now, and it still doesn't work.

@YuliiaKovalova

Copy link
Copy Markdown
Member Author

@Forgind interesting, I am checking your example and it seems to be fine now:
{5444C4FE-D4B8-45E6-946E-8AC969356EED}
Could you please check on my screenshot if I miss anything?

Comment thread src/Build.UnitTests/Evaluation/Evaluator_Tests.cs Outdated

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm confused by the fact that the lookup is now somethime searched by normalized and sometimes (removal) not-normalized path - if that can be cleared out as not concern - I'm ready to sign off.

If that's possibly a concern - it'd be great to see a number of executions (plus e.g. Stopwatch accumulated time for normalizations calls) of that line for e.g. OrchardCore - to see if we should just normalize and move on, or if we need to rething the datastructure

Comment thread src/Build.UnitTests/Evaluation/Evaluator_Tests.cs
Comment thread src/Build/Evaluation/LazyItemEvaluator.cs
Comment thread src/Build.UnitTests/Evaluation/Evaluator_Tests.cs
Comment thread src/Build/Evaluation/LazyItemEvaluator.cs
@YuliiaKovalova
YuliiaKovalova merged commit 0d310de into dotnet:main Jan 31, 2025
@rmarinho

Copy link
Copy Markdown
Member

This fix is only on preview2 right?

@YuliiaKovalova

Copy link
Copy Markdown
Member Author

This fix is only on preview2 right?

yes, it's correct.

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.

.NET 10: odd <ItemGroup> behavior if directory that has parenthesis

6 participants