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

Log glob failures #11211

Merged
merged 7 commits into from
Jan 6, 2025
Merged

Conversation

JanProvaznik
Copy link
Member

@JanProvaznik JanProvaznik commented Jan 2, 2025

Fixes #9609

Context

Logging when glob expansions fail is useful for debugging.
Log it quietly (as a message with low priority).

Changes Made

FileMatcher.GetFiles returns a message if an exception occurs when matching files, it's callers log it.

Testing

Covered by existing tests.
Failures which would be logged are rare.
Tested manually triggering an exception in the critical section and the message displays in binlog:
image

Notes

Figuring out how to log is a bit tricky with some of the code being in static, some in singleton contexts and there are multiple logging mechanisms.

@JanProvaznik JanProvaznik marked this pull request as ready for review January 3, 2025 09:57
@YuliiaKovalova
Copy link
Member

It looks good, I have several nit comments and a point for discussion for the tuple usage.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

src/Build/Utilities/EngineFileUtilities.cs Show resolved Hide resolved
src/Shared/FileMatcher.cs Show resolved Hide resolved
src/Shared/FileMatcher.cs Show resolved Hide resolved
src/Shared/FileMatcher.cs Show resolved Hide resolved
src/Tasks/CreateItem.cs Show resolved Hide resolved
@JanProvaznik JanProvaznik merged commit 8d395fd into dotnet:main Jan 6, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log when glob expansion fails and falls back to literal
4 participants