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

#59749 move TrimEnd after path normalization #59753

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dlosch
Copy link

@dlosch dlosch commented Jan 7, 2025

Invocation of dotnet-getdocument.dll tool from Microsoft.Extensions.ApiDescription.Server.targets may result in trailing backslash and broken build on Windows

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)

Description

Value of OpenApiDocumentsDirectory must be trimmed of trailing backslash on Windows after path normalization.
OpenApiDocumentsDirectory = ../foo/ -> Path.GetFullPath (on Windows) -> <rooted Path>\foo\

Move TrimEnd('\') to after path normalization, as a Linux style directory separator would not be trimmed, translated to windows style backslash by the path normalization done by GetFullPath if build runs on Windows. Resulting value in _DotNetGetDocumentOutputPath would still have trailing backslash and break the command line (on Windows).

There seem to be some changes to this in past commits, moving the TrimEnd around. Looks like a regression.

Fixes #59749 (in this specific format)

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Jan 7, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 7, 2025
Copy link
Contributor

Thanks for your PR, @dlosch. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
1 participant