dotnet / dotnet/msbuild

Silent glob expansion failure on `**.ext`

Open
#11,011 0 comments 0 reactions 0 assignees View on GitHub
Priority:2 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### 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

```xml







```

In a file named `GlobDoesNotExpand.proj`

### Expected Behavior

```sh-session
❯ 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

```sh-session
❯ 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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.