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

Skip server rebuilds for change sets that don't resolve to any file mount #12861

Open
jmooring opened this issue Sep 19, 2024 · 3 comments
Open

Comments

@jmooring
Copy link
Member

jmooring commented Sep 19, 2024

I'm not sure if this is a bug or an enhancement... or perhaps there's a good reason for the current behavior.

[[module.mounts]]
source = 'content'
target = 'content'
excludeFiles = ['posts/*']

With the above, when I edit content/posts/post-1.md ...

DEBUG Received System Events: [WRITE         "/home/jmooring/code/hugo-testing/content/posts/post-1.md" WRITE         "/home/jmooring/code/hugo-testing/content/posts/post-1.md"]

Change detected, rebuilding site (#5).
2024-09-19 10:43:59.783 -0700
DEBUG cachebuster: Matching "content/posts/post-1.md" with source "(postcss|tailwind)\\.config\\.js": no match
Source changed /posts/post-1.md
DEBUG 
INFO  build:  step process substep resolve page output change set changes 0 checked 0 matches 0 duration 104.933µs
INFO  build:  step process substep gc dynacache duration 338.639µs
INFO  build:  step process substep collect files 0 files_total 0 pages_total 0 resources_total 0 duration 460.679µs
INFO  build:  step process duration 1.727645ms
INFO  build:  step assemble duration 314.482µs
INFO  build:  step render substep pages site en outputFormat html duration 95.511µs
INFO  build:  step render substep pages site en outputFormat rss duration 92.611µs
INFO  build:  step render pages 0 content 0 duration 449.541µs
INFO  build:  step render deferred count 0 duration 4.045µs
INFO  build:  step postProcess duration 16.526µs
INFO  build:  duration 3.17658ms
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Total in 3 ms
INFO  livereload: build changed 0 files

I can see from the last line that no files have changed, which is good, but it seems like we shouldn't be doing the other stuff.

Tested with hugo v0.135.0-DEV-a619deec1827ea2d601a9b3708d1375c1eca3c5c+extended linux/amd64

@jmooring
Copy link
Member Author

jmooring commented Sep 19, 2024

Note that using the ignoreFiles setting in the root of the site configuration produces the desired results, but we've been recommending the use of mount exclusions instead.

@bep
Copy link
Member

bep commented Sep 19, 2024

The issue title here isn't correct. We do honor mount ignore files setting for all builds, meaning: We don't build them. We trigger a noop build when those files changes, which I guess is a difference between the global setting, but I would say that that is undocumented behaviour. We could and should probably skip builds for change sets that don't resolve to any files on the file system.

Note that using the ignoreFiles setting in the root of the site configuration produces the desired results

ignoreFiles only works for content files, which isn't my desired result.

@bep bep changed the title Server does not honor the ignoreFiles setting when mounting a directory Skip server rebuilds for change sets that don't resolve to any file mount Sep 19, 2024
@bep bep modified the milestones: v0.135.0, Unscheduled Sep 19, 2024
@jmooring
Copy link
Member Author

Thanks for the clarification. This obviously isn't a high priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants