Combine the intermediate path rather than prepending it - #202
Open
Smaug123 wants to merge 2 commits into
Open
Conversation
`IntermediateOutputPath` is relative to the project directory by default, but absolute under the SDK's `UseArtifactsOutput` (and under an explicit `BaseIntermediateOutputPath`). Prepending `$(MSBuildProjectDirectory)` then produced `<project>/<absolute path>`, so packing with that switch wrote the stripped readme into a `<project>/Users/...` tree under the source directory instead of into the configured artifacts directory; on Windows the same concatenation would be a malformed double-drive path. `Path.Combine` returns a rooted second argument unchanged, which is what is wanted in both modes. Verified by resolving the property both ways and by packing with the switch: the readme in the nupkg is byte-identical to the one on `main` minus its `<picture>` element, the icon is still present, and no stray directory appears in the source tree.
AGENTS.md asks for no comments discussing alternative counterfactual implementations. State why `Path.Combine` is the right call here instead.
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.
Follow-up to the readme-strip target:
IntermediateOutputPathis relative to the project directory by default, but absolute under the SDK'sUseArtifactsOutput(and under an explicitBaseIntermediateOutputPath). Prepending$(MSBuildProjectDirectory)then produces<project>/<absolute path>, sodotnet pack -p:UseArtifactsOutput=truewrote the stripped readme into a<project>/Users/...tree inside the source directory instead of into the configured artifacts directory. On Windows the same concatenation would be a malformed double-drive path.Path.Combinereturns a rooted second argument unchanged, which is the wanted behaviour in both modes.Verified in this repo: the property resolves under
obj/by default and underartifacts/obj/with the switch; packing with the switch produces a nupkg whose readme is byte-identical tomain's readme minus its<picture>element, still carries the icon, and leaves no stray directory in the source tree.Found by Codex reviewing the same target in
WoofWare.Incremental; the identical fix is going to every repo that carries it.