-
Notifications
You must be signed in to change notification settings - Fork 746
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
[doc] Bazel artifacts cause Hugo local preview to hang #12322
Comments
Okay, I fixed this locally by removing a bunch of files and directories I found in
Then I ran:
I'm especially suspicious of |
Okay, looks like this is related to bazel. Worryingly, I can get back into a broken state by just running a bazel command, for instance:
Afterwards,
Curious if others can reproduce this? Maybe we need to tell Hugo to ignore these bazel artifacts -- perhaps it's hanging because it's trying to process them somehow. I'm reopening the issue, since it looks like this is more than a one-time problem and I want to find a better fix than having to manually clear bazel artifacts every time I preview documentation. |
More debug log: The opentitan/site/docs/config.toml Line 49 in 689a36a
Adding specific bazel-bin , bazel-out , and bazel-opentitan rules doesn't seem to work either.
Preventing bazel from creating symlinks does seem to work. If I |
There's a new directory .bin that isn't ignored yet afaik |
I also experienced this, hugo appears to get flaky after a build. |
Unfortunately, ignoring it doesn't seem to have an effect. 😞 The |
For testing I've blocked the |
I suspect it won't help but I've sent a PR to update hugo to the latest version in case it is useful: #12326 |
Thanks, I was wondering about that! But unfortunately your suspicion is correct; it doesn't fix the problem. |
Is bazel making any bazel-* directories anywhere but the repository root? I scoped the exclusion relatively narrowly for hugo. |
I'm fairly certain by now that:
There's something deeper going on with Hugo here that I don't fully understand, but I think it's something along the lines of "a step where Hugo lists all the files from the content root, following symlinks, and doesn't ignore the stuff in For some reason I can't seem to disable watching in order to confirm that suspicion, though, even by adding |
I think the server configuration used by --preview might now watch by default and that I'm able to override it at the commandline. Can you change util/build_docs.py to run as if
was used to execute it? That command appears to keep it from getting stuck. |
That works, awesome! Thanks @drewmacrae ! It's kind of nice to have the pages automatically update when previewing, but I think it's less painful to restart the server than it is to remove or unlink build artifacts. (I suppose we could have |
Minimally reproduced the bug and reported it to Hugo as gohugoio/hugo#9838 |
I've got master checked out at
c6b2b7
. When I runutil/build_docs.py
, everything is fine and the site builds. But when I run with the--preview
option, the site builds and then Hugo just hangs, taking up a large percentage of my CPU and never actually locally serving the pages. I don't get any printout beyond theBuilt in 2336 ms
message that the non-preview invocation ends on.Interestingly, when I do a fresh clone and check out the same commit, the preview functionality works just fine and serves pages from
localhost:1313
as expected. But no attempt to clean the local directory (e.g.rm -rf build
, or passing--ignoreCache
to Hugo) has worked thus far.In the process of trying to debug this problem, I also found that if I try to checkout a previous commit and run
util/build_docs.py
, with or without the--preview
option, the documentation completely fails to build with a separate error: Hugo complains it can't find a file that exists onmaster
but not in the previous commit (e.g. the recently addedbaselisk.sh
). That error looks like:And it's not just git-tracked files -- renaming local, untracked files and directories instead of checking out previous commits causes the same error as above. Again, the problem persists even if I completely remove
build
directory and pass--ignoreCache
. This may be a totally separate problem, but it seems to me like both have something to do with Hugo not really properly ignoring non-source files (given that the documentation preview works in a fresh clone).I'd be grateful if someone recognizes this problem and can suggest a fix -- I'm currently just trying to debug it myself, and mostly created this issue to record the process in case someone else runs into the same problem later.
The text was updated successfully, but these errors were encountered: