dotnet / dotnet/arcade

Fix Microsoft.DotNet.Build.Tasks.Packaging adding duplicate / to extensionless PackageFiles

Open
#2,998 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

https://github.com/dotnet/arcade/blob/c379ca997a3baf98e7e974c420d18997113eb345/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.targets#L479-L485

This code adds a `/` even if one already exists, causing paths like `tools//crossgen`.

This is a problem when some `PackageFile`s are generated via `**` where `RecursiveDir` needs to be preserved, like in Core-Setup where I have a workaround:

```xml
<_ToolsToPackage Include="$(_runtimePackageDir)tools/**/*.*"/>

$(_runtimePackageId)

$([System.String]::new('tools/%(RecursiveDir)').TrimEnd('/'))
true

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.