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

CI fail build assets running cross-build #835

Closed
joepio opened this issue Feb 5, 2024 · 1 comment
Closed

CI fail build assets running cross-build #835

joepio opened this issue Feb 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working ci Github actions / e2e tests / build / etc

Comments

@joepio
Copy link
Member

joepio commented Feb 5, 2024

Status: Downloaded newer image for ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5
warning: /project/lib/Cargo.toml: unused manifest key: bench.0.all-features
warning: atomic-server@0.37.0: Could not find index.html in ./assets_tmp. Skipping JS build.
warning: atomic-server@0.37.0: Could not find ./assets_tmp , copying from ../browser/data-browser/dist
   Compiling atomic-server v0.37.0 (/project/server)
error: couldn't read server/src/handlers/../../assets_tmp/index.html: No such file or directory (os error 2)
  --> server/src/handlers/single_page_app.rs:13:20
   |
13 |     let template = include_str!("../../assets_tmp/index.html");
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)

For some reason the dist folder is not properly copied to assets_tmp.

I'd assume this is a problem with build.rs, but I fail to see what is going wrong.

If I run earthly -i --org ontola --sat henk -P --push +docker-all --tags="latest,v0.37.0", and try to find out where the files are, I notice that the assets_tmp folder is missing - even after the "Could not find ./assets_tmp , copying from ../browser/data-browser/distwarning was printed. I also see that thedist` folder is there and has the files, so it's not as if it's copying an empty folder or something.

I tried running cargo build on the same machine, and that seems to run just fine. Could it be that cross does not properly copy the files? Or maybe it moves things?

One solution is to manually copy the js assets to the right dir.

@joepio joepio added bug Something isn't working ci Github actions / e2e tests / build / etc labels Feb 5, 2024
@joepio joepio self-assigned this Feb 5, 2024
joepio added a commit that referenced this issue Feb 6, 2024
@joepio
Copy link
Member Author

joepio commented Feb 14, 2024

Looks fixed in 14c261c

@joepio joepio closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci Github actions / e2e tests / build / etc
Projects
None yet
Development

No branches or pull requests

1 participant