Repository navigation
Prevent build-tool resource name collisions - #4315
Open
siegfriedpammer wants to merge 1 commit into
Open
siegfriedpammer wants to merge 1 commit into
siegfriedpammer wants to merge 1 commit into
Conversation
siegfriedpammer
force-pushed
the
fix/project-export-build-files
branch
2 times, most recently
from
November 7, 2026 10:17
305f57d to
16df3ab
Compare
dgrunwald
reviewed
Nov 8, 2026
| { | ||
| // Keep exported resources from being treated as build inputs merely because of their names. | ||
| if (IsReadByBuildTools(fileName)) | ||
| fileName = AppendInertExtension(fileName); |
Member
There was a problem hiding this comment.
Why only for resources?
IMHO this should go into SanitizeFileName to ensure it applies to all files we write.
dgrunwald
reviewed
Nov 8, 2026
| string[] segments = fileName.Split(Path.DirectorySeparatorChar); | ||
| if (segments.Length > 1 && segments[0].TrimEnd('.').Equals("obj", StringComparison.OrdinalIgnoreCase)) | ||
| return true; | ||
| string name = segments[segments.Length - 1].TrimEnd('.'); |
Member
There was a problem hiding this comment.
The .TrimEnd('.') is questionable here -- isn't this redundant because CleanUpName already removed trailing dots? If our input did not run through CleanUpName, then trimming dots would not be sufficient.
siegfriedpammer
force-pushed
the
fix/project-export-build-files
branch
2 times, most recently
from
November 8, 2026 12:40
6a832bf to
2997eef
Compare
dgrunwald
reviewed
Nov 8, 2026
| { | ||
| try | ||
| { | ||
| fileName = fileName.Normalize(NormalizationForm.FormKC); |
Member
There was a problem hiding this comment.
Why normalize here?
CleanUpName does similar checks; if normalization is necessary in this function then shouldn't it also be necessary over there?
siegfriedpammer
force-pushed
the
fix/project-export-build-files
branch
from
November 8, 2026 14:15
2997eef to
c2babea
Compare
Project exports write assembly-controlled resource names beside the generated project. Names such as Directory.Build.props can therefore become implicit MSBuild inputs when the export is opened. Keep the original LogicalName for rebuild fidelity while giving risky files an inert on-disk extension. Assisted-by: OpenCode:gpt-5.6-luna:OpenCode
siegfriedpammer
force-pushed
the
fix/project-export-build-files
branch
from
November 8, 2026 14:46
c2babea to
94ffd82
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.binto risky on-disk names while preserving the original resource name throughLogicalName..resourcesentries through the shared filename reservation path.Verification
OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test --project ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj --filter "FullyQualifiedName~WholeProjectDecompilerTests" --report-trxpasses: 22/22.Assisted-by: OpenCode:gpt-5.6-luna:OpenCode