Skip to content
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

Silent glob expansion failure on **.ext #11011

Open
rainersigwald opened this issue Nov 20, 2024 · 0 comments
Open

Silent glob expansion failure on **.ext #11011

rainersigwald opened this issue Nov 20, 2024 · 0 comments
Labels
Priority:2 Work that is important, but not critical for the release triaged

Comments

@rainersigwald
Copy link
Member

Issue Description

When a recursive-directory glob ** is used directly with an extension, like **.cs instead of **\*.cs, it can silently fail to expand.

Steps to Reproduce

<Project>
  <ItemGroup>
    <I Include="**.proj" />
  </ItemGroup>

  <Target Name="Printer">
    <Message Importance="High" Text="I: @(I)" />
  </Target>
</Project>

In a file named GlobDoesNotExpand.proj

Expected Behavior

msbuild .\GlobDoesNotExpand.proj -v:m
MSBuild version 17.13.0-preview-24563-01+c49eee220 for .NET Framework

  OnlyDirectoryGlob: GlobDoesNotExpand.proj
  DirectoryAndFile: GlobDoesNotExpand.proj

Actual Behavior

msbuild .\GlobDoesNotExpand.proj -v:m
MSBuild version 17.13.0-preview-24563-01+c49eee220 for .NET Framework

  OnlyDirectoryGlob: **.proj
  DirectoryAndFile: GlobDoesNotExpand.proj

Analysis

This can be hard to find because it looks like the C# compiler will accept ..\OtherDirectory\**.cs on the command line and expand it. A Microsoft internal team hit it due to a failure in SourceLink's GetUntrackedFiles task, which didn't expand the glob itself (and shouldn't be expected to IMO).

Versions & Configurations

No response

@maridematte maridematte added Priority:2 Work that is important, but not critical for the release triaged labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

2 participants