ActivityWatch/aw-server-rust

CI (sometimes) fails on macOS

johan-bjareholt opened this issue · 5 comments

Sometimes it's this

 error[E0463]: can't find crate for `pear_codegen` which `pear` depends on
  --> /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_http-0.4.5/src/lib.rs:15:14
   |
15 | #[macro_use] extern crate pear;
   |              ^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `rocket_http`

While other times it's a similar thing but it can't find serde_derive or serde or whatever. I have no idea why and it's even more strange that it only occurs on macOS as it doesn't seem to have to do with anything platform specific.

Happened in the bundle repo too just now. Weird af.

@johan-bjareholt I have a theory of what might cause this.

IME, the issue rarely occurs when there has been a recent update to the Cargo.lock (flushing the cache), then things start to fail when there is a new Rust nightly. This suggests that it might be due to the stale build cache (as previously suspected) that somehow doesn't get updated for the new nightly.

Does that sound like a possible cause to you?

Edit: lol, just realized I said the exact same thing in #192 (comment), with proof.

Still getting this: https://github.com/ActivityWatch/activitywatch/runs/1618609088#step:11:498

Perhaps we should just turn off the Cargo cache entirely for now.

I disabled the Cargo cache for macOS and it seems to work. Hopefully, it stays that way.

Not too big a sacrifice to keep the cache off specifically for macOS builds if it stops the builds from failing intermittently.

Tried enabling it again, but spuriously getting weird stuff: https://github.com/ActivityWatch/activitywatch/runs/7340434809

   Compiling aw-transform v0.1.0 (/Users/runner/work/activitywatch/activitywatch/aw-server-rust/aw-transform)
error[E0786]: found invalid metadata files for crate `rocket_codegen` which `rocket` depends on
  --> aw-transform/src/split_url.rs:25:9
   |
25 |     use rocket::http::uri::Absolute;
   |         ^^^^^^
   |
   = note: invalid metadata version found: /Users/runner/work/activitywatch/activitywatch/aw-server-rust/target/release/deps/librocket_codegen-66a6ea628577ce59.dylib