CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.22k stars 97 forks source link

Fails to build #563

Closed yonas closed 4 months ago

yonas commented 4 months ago

I'm getting a bunch of No such file or directory errors:

$ cargo build --release
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /git/pagefind/pagefind_web/Cargo.toml
workspace: /git/pagefind/Cargo.toml
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
   Compiling pagefind v0.0.0 (/git/pagefind/pagefind)
warning: unused variable: `e`
  --> pagefind_web/src/lib.rs:73:13
   |
73 |         Err(e) => {
   |             ^ help: if this is intentional, prefix it with an underscore: `_e`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `e`
  --> pagefind_web/src/lib.rs:88:13
   |
88 |         Err(e) => {
   |             ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: unused variable: `e`
   --> pagefind_web/src/lib.rs:102:13
    |
102 |         Err(e) => {
    |             ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: `pagefind_web` (lib) generated 3 warnings (run `cargo fix --lib -p pagefind_web` to apply 3 suggestions)
    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: couldn't read /git/pagefind/pagefind/vendor/wasm/pagefind_web_bg.unknown.0.0.0.wasm.gz: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:21:33
   |
21 |   const GENERIC_WEB_WASM: &[u8] = include_bytes!(concat!(
   |  _________________________________^
22 | |     env!("CARGO_MANIFEST_DIR"),
23 | |     "/vendor/wasm/pagefind_web_bg.unknown.",
24 | |     env!("CARGO_PKG_VERSION"),
25 | |     ".wasm.gz"
26 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: proc macro panicked
  --> pagefind/src/output/mod.rs:27:33
   |
27 | const WEB_WASM_FILES: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/vendor/wasm");
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: "/git/pagefind/pagefind/vendor/wasm" is not a directory

    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: couldn't read /git/pagefind/pagefind/vendor/pagefind_web.0.0.0.js: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:29:22
   |
29 |   const WEB_JS: &str = include_str!(concat!(
   |  ______________________^
30 | |     env!("CARGO_MANIFEST_DIR"),
31 | |     "/vendor/pagefind_web.",
32 | |     env!("CARGO_PKG_VERSION"),
33 | |     ".js"
34 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)

error: couldn't read /git/pagefind/pagefind/vendor/pagefind_ui.0.0.0.js: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:35:26
   |
35 |   const WEB_UI_JS: &[u8] = include_bytes!(concat!(
   |  __________________________^
36 | |     env!("CARGO_MANIFEST_DIR"),
37 | |     "/vendor/pagefind_ui.",
38 | |     env!("CARGO_PKG_VERSION"),
39 | |     ".js"
40 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: couldn't read /git/pagefind/pagefind/vendor/pagefind_ui.0.0.0.css: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:41:27
   |
41 |   const WEB_UI_CSS: &[u8] = include_bytes!(concat!(
   |  ___________________________^
42 | |     env!("CARGO_MANIFEST_DIR"),
43 | |     "/vendor/pagefind_ui.",
44 | |     env!("CARGO_PKG_VERSION"),
45 | |     ".css"
46 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

error: couldn't read /git/pagefind/pagefind/vendor/pagefind_modular_ui.0.0.0.js: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:47:34
   |
47 |   const WEB_MODULAR_UI_JS: &[u8] = include_bytes!(concat!(
   |  __________________________________^
48 | |     env!("CARGO_MANIFEST_DIR"),
49 | |     "/vendor/pagefind_modular_ui.",
50 | |     env!("CARGO_PKG_VERSION"),
51 | |     ".js"
52 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: couldn't read /git/pagefind/pagefind/vendor/pagefind_modular_ui.0.0.0.css: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:53:35
   |
53 |   const WEB_MODULAR_UI_CSS: &[u8] = include_bytes!(concat!(
   |  ___________________________________^
54 | |     env!("CARGO_MANIFEST_DIR"),
55 | |     "/vendor/pagefind_modular_ui.",
56 | |     env!("CARGO_PKG_VERSION"),
57 | |     ".css"
58 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: couldn't read /git/pagefind/pagefind/vendor/pagefind_coupled_search.0.0.0.js: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:59:25
   |
59 |   const SEARCH_JS: &str = include_str!(concat!(
   |  _________________________^
60 | |     env!("CARGO_MANIFEST_DIR"),
61 | |     "/vendor/pagefind_coupled_search.",
62 | |     env!("CARGO_PKG_VERSION"),
63 | |     ".js"
64 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)

error: couldn't read /git/pagefind/pagefind/vendor/pagefind_highlight.0.0.0.js: No such file or directory (os error 2)
  --> pagefind/src/output/mod.rs:65:29
   |
65 |   const HIGHLIGHT_JS: &[u8] = include_bytes!(concat!(
   |  _____________________________^
66 | |     env!("CARGO_MANIFEST_DIR"),
67 | |     "/vendor/pagefind_highlight.",
68 | |     env!("CARGO_PKG_VERSION"),
69 | |     ".js"
70 | | ));
   | |__^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

    Building [=======================> ] 349/351: pagefind                                                                                                                                                         
error: could not compile `pagefind` (lib) due to 9 previous errors 

OS: FreeBSD 14 Rust: 1.76.0-nightly (37b2813a7 2023-11-24) (built from a source tarball) Version: 67867e2

yonas commented 4 months ago

Also fails with the same errors on Ubuntu 23. Updated the title.

bglw commented 4 months ago

šŸ‘‹ Hey @yonas

A few things in-repo need to be build before the main Pagefind binary will build. I think the CONTRIBUTING.md file should be up to date: https://github.com/CloudCannon/pagefind/blob/main/CONTRIBUTING.md

Let me know if those steps resolve the issue, or if there is anything else I should add to that document šŸ™‚

yonas commented 4 months ago

@bglw Those instructions work, thanks!