uno icon indicating copy to clipboard operation
uno copied to clipboard

`The value "/**/*" of the "Include" attribute in element <ItemGroup> in file .nuget\packages\uno.sdk\5.2.161\targets\Uno.SingleProject.Desktop.targets`

Open xperiandri opened this issue 1 year ago • 8 comments

Current behavior

Build error with:

The value "/**/*" of the "Include" attribute in element <ItemGroup> in 
file ".nuget\packages\uno.sdk\5.2.161\targets\Uno.SingleProject.Desktop.targets (33,25)" is a wildcard 
that results in enumerating all files on the drive, which was likely not intended. Check that referenced 
properties are always defined and that the project and current working directory are not at the drive root.

Expected behavior

Restore works

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

Go to Uno.SingleProject.Desktop.targets file and modify lines https://github.com/unoplatform/uno/blob/57abfeaad51a495fa7512a19eec407bf77cd0739/src/Uno.Sdk/targets/Uno.SingleProject.Desktop.targets#L33-L34

to remove the forward slashes

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

5.2.161

Affected platforms

Skia (WPF), Skia (Linux X11), Skia (macOS), Skia (Linux Framebuffer), Skia (GTK)

IDE

Visual Studio 2022

IDE version

17.10.3

Relevant plugins

No response

Anything else we need to know?

https://github.com/unoplatform/uno/blob/57abfeaad51a495fa7512a19eec407bf77cd0739/src/Uno.Sdk/targets/Uno.SingleProject.Desktop.targets#L33-L34 look wrong as

https://github.com/unoplatform/uno/blob/57abfeaad51a495fa7512a19eec407bf77cd0739/src/Uno.Sdk/targets/Uno.Common.targets#L53 already contains a slash

xperiandri avatar Jun 25 '24 17:06 xperiandri

Thanks for the report. Can you provide a repro?

jeromelaban avatar Jun 25 '24 17:06 jeromelaban

Unless I give you my production solution I have no idea how to reproduce it. But, even so, the leading slash in those MSBuild properties is definitely wrong. As if the variable becomes "" it will do very wrong things

xperiandri avatar Jun 25 '24 18:06 xperiandri

Why would DesktopProjectFolder be empty? Are you changing its value explicitly?

jeromelaban avatar Jun 25 '24 18:06 jeromelaban

Hypothetically. I just deducting why MS never prepened paths with slash but append variables

xperiandri avatar Jun 25 '24 19:06 xperiandri

Really I don't know how this error appeared but it had…

xperiandri avatar Jun 25 '24 19:06 xperiandri

If the path is empty, this will cause all sorts of other issues, such as including all files from the root of the project, which is not the intent of that line. If you can provide a binlog of the issue, it will still help.

jeromelaban avatar Jun 25 '24 19:06 jeromelaban

Here it is desktop.zip

xperiandri avatar Jun 25 '24 20:06 xperiandri

Thanks. This is a very curious behavior and feels very familiar to https://github.com/dotnet/msbuild/issues/9351. Could you try moving your project to a very small path and see if it reproduces?

jeromelaban avatar Jun 25 '24 21:06 jeromelaban