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

Add a cross process build lock and use it in the archetype content builder #9048

Closed
bep opened this issue Oct 16, 2021 · 2 comments
Closed
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Oct 16, 2021

I'm doing some testing with the archetype feature in Hugo with the server running:

server --navigateToChanged

For single files, this works OK. But for bundles, not so much -- esp. with images:

ERROR 2021/10/16 13:36:26 Failed to render pages: render of "home" failed: execute of template failed: template: index.html:15:6: executing "main" at <partial "home-page-sections/showcase.html" .>: error calling partial: "/Users/bep/dev/go/gohugoio/hugoDocs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/showcase.html:27:19": execute of template failed: template: partials/home-page-sections/showcase.html:27:19: executing "home_showcase_item" at <.Fill>: error calling Fill: image "/Users/bep/dev/go/gohugoio/hugoDocs/content/en/showcase/your-site3/featured.png": fill : failed to open image for decode: open /Users/bep/dev/go/gohugoio/hugoDocs/content/en/showcase/your-site3/featured.png: no such file or directory

The above will eventually succeed (on next change or something), but that does not look ... great.

@bep bep added the Bug label Oct 16, 2021
@bep bep added this to the v0.89 milestone Oct 16, 2021
@bep bep self-assigned this Oct 16, 2021
@bep
Copy link
Member Author

bep commented Oct 16, 2021

We could (should?) probably use this https://github.com/rogpeppe/go-internal/blob/master/lockedfile/lockedfile.go --- for /content? That should fix it and I don't see any big performance penalty.

/cc @jmooring

@bep bep changed the title Add locking or similar to handle watching/rebuilds of in flight (copying) files Add a way to pause the file watcher from the outside Oct 17, 2021
@bep bep changed the title Add a way to pause the file watcher from the outside Add a cross process build lock and use it in the archetype content builder Oct 17, 2021
bep added a commit to bep/hugo that referenced this issue Oct 17, 2021
@bep bep closed this as completed in ba35e69 Oct 18, 2021
jwflory added a commit to unicef/inventory that referenced this issue Nov 2, 2021
This commit adds the `.hugo_build.lock` files to the `.gitignore`. This
file is automatically created since Hugo v0.89.0, see notes below:

> Hugo now writes an empty file named `.hugo_build.lock` to the root of
> the project when building (also when doing `hugo new mypost.md` and
> other commands that requires a build). We recommend you just leave
> this file alone. Put it in `.gitignore` or similar if you don't want
> the file in your source repository.

ref: gohugoio/hugo#9048

Signed-off-by: Justin W. Flory (he/him) [UNICEF Innovation] <jflory@unicef.org>
jwflory added a commit to unicef/drone-4sdgtoolkit that referenced this issue Nov 2, 2021
This commit adds the `.hugo_build.lock` files to the `.gitignore`. This
file is automatically created since Hugo v0.89.0, see notes below:

> Hugo now writes an empty file named `.hugo_build.lock` to the root of
> the project when building (also when doing `hugo new mypost.md` and
> other commands that requires a build). We recommend you just leave
> this file alone. Put it in `.gitignore` or similar if you don't want
> the file in your source repository.

ref: gohugoio/hugo#9048

Signed-off-by: Justin W. Flory (he/him) [UNICEF Innovation] <jflory@unicef.org>
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant