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: linkcheck plugin on *nix #704

Merged
merged 1 commit into from
Aug 8, 2024
Merged

fix: linkcheck plugin on *nix #704

merged 1 commit into from
Aug 8, 2024

Conversation

mistydemeo
Copy link
Contributor

On Linux and macOS, trying to run with the linkcheck plugin configured would error out with the following error:

Error: Unable to resolve the source directory

Caused by:
    No such file or directory (os error 2)
  × Couldn't build your mdbook at book
  ├─▶ Rendering failed
  ╰─▶ The "linkcheck" renderer failed

This turns out to have been caused by us passing a relative path to the book directory instead of an absolute path. The relative path was fine for the main rendering process, but not the linkcheck plugin.

It appears that we intentionally made the path relative before passing it in here, but I'm not clear on why. It makes more sense in some of the "watching paths" route, but this path clearly works better as an absolute path. If we're happy with going with the absolute path, it probably makes sense to just join book_path to root_path instead of going through paths::determine_path().

On Linux and macOS, trying to run with the linkcheck plugin configured would
error out with the following error:

```
Error: Unable to resolve the source directory

Caused by:
    No such file or directory (os error 2)
  × Couldn't build your mdbook at book
  ├─▶ Rendering failed
  ╰─▶ The "linkcheck" renderer failed
  ```

This turns out to have been caused by us passing a relative path to the
book directory instead of an absolute path. The relative path was fine for
the main rendering process, but not the linkcheck plugin.
@mistydemeo mistydemeo requested a review from Gankra August 6, 2024 21:03
@mistydemeo
Copy link
Contributor Author

Are you happy with this version, which searches for and relativizes the path before recanonicalizing it?

@mistydemeo mistydemeo marked this pull request as ready for review August 8, 2024 16:12
@mistydemeo mistydemeo merged commit 86b8b2b into main Aug 8, 2024
15 checks passed
@mistydemeo mistydemeo deleted the fix_linkcheck_unix branch August 8, 2024 16:12
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.

2 participants