https://linen.dev logo
Shuttle cannot compile error-stack
# help
s
Locally
cargo build
works. When I try to
cargo shuttle deploy
I get a crash, and the log shows:
Copy code
text
2022-11-27T18:57:40.546567961Z  INFO    Compiling error-stack v0.2.4
2022-11-27T18:57:40.967242638Z DEBUG error[E0514]: found crate `rustc_version` compiled by an incompatible version of rustc
 --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/error-stack-0.2.4/build.rs:1:5
  |
1 | use rustc_version::{version_meta, Channel, Version};
  |     ^^^^^^^^^^^^^
  |
  = note: the following crate versions were found:
          crate `rustc_version` compiled by rustc 1.63.0 (4b91a6ea7 2022-08-08): /opt/shuttle/shuttle-builds/rorschach/target/release/deps/librustc_version-9eecf20def6331b7.rlib
  = help: please recompile that crate using this compiler (rustc 1.67.0-nightly (11ebe6512 2022-11-01)) (consider running `cargo clean` first)


2022-11-27T18:57:40.978802565Z DEBUG error: aborting due to previous error


2022-11-27T18:57:40.990656746Z  INFO error: could not compile `error-stack` due to 2 previous errors
2022-11-27T18:57:40.997114214Z  INFO warning: build failed, waiting for other jobs to finish...

2022-11-27T18:57:41.361548677Z  INFO Entering crashed state
2022-11-27T18:57:41.361771190Z ERROR {error="Build error: 1 job failed"} shuttle_deployer::deployment::queue: service build encountered an error
Additionally, I tried running locally with
cargo shuttle run
, but I get segfault on both Rust 1.63.0 and 1.65.0
w
Hey @stale-kilobyte-24744 ! If you run
cargo shuttle run
locally does that work?
s
@worried-airplane-91571 It segfaults
Copy code
; cargo shuttle run                                       
Building /home/czar/work/rust/rorschach
    Finished dev [unoptimized + debuginfo] target(s) in 0.21s

Starting rorschach on http://127.0.0.1:8000
Error: IO error: [1]    28019 segmentation fault (core dumped)  cargo shuttle run
w
Oh I didn’t see that 🤦‍♂️
s
The thing is, it builds fine locally, there's something wrong between shuttle's build environment and the error-stack crate. Not sure what's up with the segfault either, I'm on shuttle 0.7.2.
Just noticed something super weird, when I launch
cargo shuttle run
via IntelliJ, it does not segfault and successfully runs and works.
To make sure I'm not doing something crazy unrelated to shuttle, I removed shuttle stuff and changed the app into a "normal" executable, it runs and works without a hitch.
s
Hmm,
error-stack
seems to have a toolchain file [1]. We saw this kind of error for the first time a few weeks ago with
dashmap
and quite some more last week. For some reason a
cargo shuttle deploy
seems to respect the toolchain file (ie it tries to build with the version in the toolchain file) while a
cargo build
does not. I looked into this quite a bit last week Thursday and Friday... It seems this will require some more attention this week 😅 [1]: https://github.com/hashintel/hash/blob/main/packages/libs/error-stack/rust-toolchain.toml
s
I'm just a beginner with rust, but from what I see at error-stack documentation, it feels like nightly is optional, otherwise error-stack claims compatibility with rust stable 1.63.0+ So cargo, probably, does the right thing and without explicit request for nightly it uses stable rust, while shuttle doesn't. On the other hand, in theory, it could be a bug (or undocumented behaviour) in cargo that error-stack devs are exploiting, I just don't know enough to be sure.
I assume there is a server-side builder, because the directories mentioned in the log do not exist on my system. After consulting with error-stack developers, it seems that the issue is that there is some conflicting rust-nightly compiled stuff in the build server's cache. Here's the discussion, for reference: https://github.com/hashintel/hash/discussions/1512
s
Oh, this is most definitely a shuttle bug
Yip, we have a server side builder. I'll quickly run
cargo clean
on your project, but think the cargo shuttle is using is likely to pick the wrong rustc version again...
...
cargo clean
has been run
s
@stocky-kangaroo-53672 yep, I'm getting the same error