msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

[Bug]: including files with `**\*.SomeExtension` may not be expanded in some cases

Open Youssef1313 opened this issue 1 year ago • 9 comments

Issue Description

See https://github.com/unoplatform/uno.templates/issues/354

In csproj, we simply have <PRIResource Include="**\*.resw" />

Then, we run a target that adds these to AdditionalFiles as follows:

https://github.com/unoplatform/uno/blob/1c635068111de02977090c8379206a4caac40b3d/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props#L359

We end up with:

2>C:\Users\XXX.nuget\packages\uno.winui\5.0.0-dev.3568\buildTransitive\Uno.UI.SourceGenerators.props(366,66): error MSB4184: The expression "[System.IO.Path]::GetFullPath(*.resw)" cannot be evaluated. Illegal characters in path.

Steps to Reproduce

Not consistent, but detailed above.

Expected Behavior

**\*.resw should be expanded properly.

Actual Behavior

Error

Analysis

No response

Versions & Configurations

No response

Youssef1313 avatar Oct 20 '23 13:10 Youssef1313

To add to this issue, here's the location where we include this item group. It's located inside an Otherwise block, if that's relevant.

jeromelaban avatar Oct 20 '23 13:10 jeromelaban

Very likely to be #406. @nickrandolph are there any files under the project directory with paths longer than MAX_PATH (260 characters)? The intermittency might be because they appear under obj\ or bin\, maybe?

rainersigwald avatar Oct 20 '23 13:10 rainersigwald

That's interesting, so properly excluding default bin/obj folders may be of help, thanks for the insights!

jeromelaban avatar Oct 20 '23 13:10 jeromelaban

@jeromelaban please tell us if the suggestion from @rainersigwald does not work for you.

AR-May avatar Oct 24 '23 14:10 AR-May

@AR-May we've not been able to validate that it's still happening, but we'll be able to soon, we'll let you know! Thanks for the follow-up.

jeromelaban avatar Oct 25 '23 00:10 jeromelaban

This issue is marked as stale because feedback has been requested for 30 days with no response. Please respond within 14 days or this issue will be closed due to inactivity.

ghost avatar Nov 25 '23 00:11 ghost

@AR-May so far it's not been havening anymore, so we can close this issue. We'll comment further if it ever happens again, thanks!

jeromelaban avatar Nov 27 '23 13:11 jeromelaban

@rainersigwald We're still seeing it. We are also excluding bin/obj:

https://github.com/unoplatform/uno/blob/03700e28c0ae658605a3dba9143e62ca420f8134/src/Uno.Sdk/targets/Uno.DefaultItems.targets#L38-L39

Youssef1313 avatar Apr 04 '24 06:04 Youssef1313

Team triage: this issue is currently blocked by #9609. We need to improve logging to be able to investigate.

AR-May avatar Apr 23 '24 15:04 AR-May