Repository navigation
Skip missing static files instead of aborting the build - #4211
official-burak wants to merge 2 commits into
Conversation
b1bbf18 to
e5dcc9b
Compare
Dangling symlinks and files that vanish after discovery currently raise FileNotFoundError from copy_file and crash mkdocs build/serve. Warn and continue so a broken media link cannot take down the whole site.
e5dcc9b to
e2ea187
Compare
pathspec 1.x keeps leading whitespace (git-compatible). The user-guide fixture was indented like Python source, so *_unpublished.md never matched and CI aborted on Python versions that install pathspec>=1.
|
The static-copy change is unrelated. CI installs Pushed 67ac6c3: |
|
Follow-up:
Those are hatch/native-dep install failures, not the static-copy change. |
|
CI note, in case it saves triage time: the three red cells are environmental, not caused by this diff. The two |
agammann
left a comment
There was a problem hiding this comment.
utils.copy_file can raise FileNotFoundError for the destination as well as the source. If the output directory disappears after it is created, this handler reports that the source is missing and silently continues, even though the source file is intact. Could the catch check self.abs_src_path and re-raise when it still exists, with a destination-side failure test? That would keep the intended skip limited to vanished source files. I reviewed the diff; I did not run tests locally.
Fixes #4048.
File.copy_filecurrently letsshutil.copyfileraiseFileNotFoundErrorfor a dangling symlink or a source that disappeared after discovery. That abortsmkdocs build/mkdocs serveeven withstrict: false.This catches the missing source, logs a warning, and continues.
is_modified()also treats an unreadable source as modified so a dirty rebuild takes the same warning path instead of crashing onos.path.getmtime.Tests cover a dangling symlink, a deleted source file, and a dirty rebuild that already has a destination copy.