I have a little zola-driven blog on FreeBSD, and after upgrading from 0.10.0 to 0.12.2, my site won’t build anymore. The issuse seems to be related to the static catalogue.
~/dev/zola-test $ zola build
Building site...
-> Creating 26 pages (0 orphan), 4 sections, and processing 0 images
Failed to build the site
Error: Invalid argument (os error 22)
If I delete the static folder, the site builds just fine. If I copy any file to the static catalogue - even something like “touch test.css”, the error will reappear. Everything worked fine in 0.10.0. Any ideas on how to approach this error?
I’m guessing it’s something in the static copying then, when we check the time of a file to compare if we need to copy or not components/utils/src/fs.rs ?
Thanks, I will check fs.rs. The error triggers on all my zola sites and even if I create a new zola project with a single static file, so I can’t build any zola projects. Since nobody else has this problem, I guess it might be a FreeBSD issue.
You were right, the bug seems to be in fs.rs. I ran the tests of the utils component on FreeBSD 12.1 with the following result:
jans@badister ~/dev/thirdparty/zola/components/utils (git::master) $ RUST_BACKTRACE=1 cargo test
Finished test [unoptimized + debuginfo] target(s) in 0.52s
Running /usr/home/jans/dev/thirdparty/zola/target/debug/deps/utils-af1ca2f3481e41fa
running 15 tests
test site::tests::can_resolve_escaped_internal_links ... ok
test fs::tests::can_find_related_assets ... ok
test site::tests::can_resolve_internal_links_with_anchors ... ok
test site::tests::can_resolve_valid_internal_link ... ok
test site::tests::can_resolve_valid_root_internal_link ... ok
test site::tests::errors_resolve_inexistant_internal_link ... ok
test fs::tests::test_copy_file_timestamp_preserved ... FAILED
test site::tests::reading_analytics_empty_text ... ok
test fs::tests::test_copy_file_already_exists ... FAILED
test site::tests::reading_analytics_short_text ... ok
test slugs::tests::can_slugify_anchors ... ok
test slugs::tests::can_slugify_paths ... ok
test vec::test::insert_many_works ... ok
test templates::tests::can_rewrite_all_paths_of_theme ... ok
test site::tests::reading_analytics_long_text ... ok
failures:
---- fs::tests::test_copy_file_timestamp_preserved stdout ----
thread 'fs::tests::test_copy_file_timestamp_preserved' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Io(Os { code: 22, kind: InvalidInput, message: "Invalid argument" }), source: None }', components/utils/src/fs.rs:223:86
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- fs::tests::test_copy_file_already_exists stdout ----
thread 'fs::tests::test_copy_file_already_exists' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Io(Os { code: 22, kind: InvalidInput, message: "Invalid argument" }), source: None }', components/utils/src/fs.rs:244:86
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
fs::tests::test_copy_file_already_exists
fs::tests::test_copy_file_timestamp_preserved
test result: FAILED. 13 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out