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

Fix relative paths for renderer commands. #1418

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Dec 31, 2020

Custom renderers that explicitly set the command to a relative path was using the wrong base path. On Windows, it was relative to the current directory, and on Unix it was relative to the renderer output directory (see rust-lang/rust#37868 for this unfortunate behavior). Neither are correct, they should be relative to the book root. This changes it so that it is relative to the book root, and has a legacy warning for the old behavior of relative to the output directory. This uses absolute paths to avoid problems with current_dir().

@ehuss
Copy link
Contributor Author

ehuss commented Dec 31, 2020

Note to self: The preprocessor custom command is relative to the current directory, but it should be relative to the book root. Unfortunately the Preprocessor::supports_renderer API does not pass in a context to get the book root, so I don't think it is fixable without a breaking API change. Will file an issue later about this.

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.

1 participant