Skip to content

Conversation

maowen
Copy link

@maowen maowen commented Dec 5, 2022

Better resolution to #1396.

The previous resolution to #1396 (#1399) provides better context when reporting the error but didn't resolve the issue because the mdBok build still fails if there is a broken symlink in the book source tree.

I have need for the mdBook builds to succeed even when broken symlinks are present (e.g. symlinks in source code tree that will be used to create a installable package).

This MR gracefully ignores symlinks that are broken and provides a helpful info! level log message. A unit test was added to verify the new behavior.

@maowen
Copy link
Author

maowen commented Jan 3, 2023

Would someone be willing to give me feedback on this PR? This solves a problem that I am having with mdBook and I'd like to get it merged if appropriate.

@ehuss
Copy link
Contributor

ehuss commented Jan 3, 2023

I'm concerned about broken symlinks leading to a broken build or broken links. Would something like ignoring those paths (#1908) work for you?

@ehuss
Copy link
Contributor

ehuss commented Mar 4, 2023

@rustbot author

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Mar 4, 2023
@xscottxbrownx
Copy link

@maowen

I've run into an issue where I create a valid symlink (or so it seems, as it creates the file in the folder I told it to - shows up in green, meaning it's new - and hovering on it says it is a Symbolic Link)

but when trying to run mdbook serve it errors and has a weird path...

Command shows blue on left, meaning it worked:
Screenshot 2023-04-05 at 2 58 11 PM

New file made, says it's a Symbolic Link:
Screenshot 2023-04-05 at 3 07 46 PM

Try to run mdbook serve and looks like it's trying to use path as if . is a folder:
Screenshot 2023-04-05 at 2 55 26 PM

So, I deleted the symlink with unlink. Then, I attempted the command ln -s ./setup/languages.md miscellaneous/languages/md which resulted in the exact same thing.

Thoughts or ideas?

@rustbot
Copy link
Collaborator

rustbot commented Apr 30, 2025

☔ The latest upstream changes (possibly #2681) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants