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

Build even when broken symlinks are present #1944

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

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?

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