Repository navigation
[repo-assist] Fix exclude directive not suppressing build targets/props import (#3193) - #4368
Merged
dsyme merged 1 commit intoAug 27, 2026
Conversation
Closes #3193 Co-authored-by: Copilot <[email protected]>
dsyme
marked this pull request as ready for review
August 27, 2026 14:54
17 tasks
This was referenced Oct 5, 2026
This was referenced Oct 14, 2026
This was referenced Nov 11, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #3193
Root cause
InstallModel.filterExcludes(used byReferencesFile'sexclude <PackageName>directive) only filteredCompileLibFolders(assembly references). It never touchedTargetsFileFolders, which holds each package's.targets/.propsbuild files. As a result, usingexcludeon a transitive package stopped its assemblies from being referenced, but its MSBuild.targets/.propsfiles were still imported into the project — exactly the symptom reported in #3193 (custom build targets from an excluded package still landing in the project).Fix
Updated
filterExcludesinsrc/Paket.Core/PaketConfigFiles/InstallModel.fsto also filterTargetsFileFolders, matching the file name/path against the exclude patterns (matching bothMsBuildFile.Nameand.Pathfor robustness, since these are.targets/.propsfile names without extension).Trade-offs
Containscheck against both file name and path, consistent with howfilterExcludesalready matches assembly references — this could match more broadly than intended if a substring collides with an unrelated file, but this mirrors the existing behavior for compile references so it stays consistent.excludeinpaket.references; does not changeimport_targets: falsehandling, which was already correct.Test Status
should exclude targets files when filtering excludesintests/Paket.Tests/InstallModel/ProcessingSpecs.fs.dotnet build src/Paket.Core/Paket.Core.fsproj -f netstandard2.0succeeded (0 errors).dotnet test tests/Paket.Tests/Paket.Tests.fsproj -f net9 --filter "FullyQualifiedName~InstallModel.ProcessingSpecs"— 45/45 passed.Add this agentic workflow to your repo
To install this agentic workflow, run