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

rusty_v8 fails to build with Rust 1.72.0 (128-bit TypeId) #3684

Closed
SimonSapin opened this issue Aug 26, 2023 · 3 comments
Closed

rusty_v8 fails to build with Rust 1.72.0 (128-bit TypeId) #3684

SimonSapin opened this issue Aug 26, 2023 · 3 comments

Comments

@SimonSapin
Copy link
Contributor

SimonSapin commented Aug 26, 2023

Describe the bug
The version of the v8 crate currently used by the Router relies on (and checks that) std::any::TypeId is 64 bits large. In Rust 1.72.0 this was changed to 128 bits. The crate added support for this but the Router still needs to update to a version that contains that change.

Work around
For now, please use Rust 1.71.1 instead. This is the default when Rust installed with rustup and when compiling from the router repository. When using apollo_router as a library, either make a rust-toolchain.toml file at the root of your project like below, or run cargo +1.71.1 instead of cargo (after rustup install 1.71.1)

[toolchain]
channel = "1.71.1"
components = ["rustfmt", "clippy"]

To Reproduce
Steps to reproduce the behavior:

  1. Clone current dev: 1a3e677
  2. Change the rust-toolchain.toml file to specify channel = "1.72.0"
  3. Run cargo check

Expected behavior
Compilation succeeds

Output

error[E0080]: evaluation of constant value failed
    --> /Users/simon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-0.71.2/src/isolate.rs:1715:3
     |
1715 |   assert!(size_of::<TypeId>() == size_of::<u64>());
     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: size_of::<TypeId>() == size_of::<u64>()', /Users/simon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-0.71.2/src/isolate.rs:1715:3
@abernix abernix pinned this issue Aug 28, 2023
o0Ignition0o added a commit that referenced this issue Aug 29, 2023
Fix #3305, #3684

Router docs failed to build on crates.io because of a documentation
compile error in Deno.
This updates Deno to the latest version, which allows us to generate
crates.io documentation again.
@o0Ignition0o
Copy link
Contributor

o0Ignition0o commented Aug 30, 2023

Closing this since it was fixed in #3626

Let's keep it pinned until we release 1.29

@rickbijkerk
Copy link

Might want to add a warning here: https://www.apollographql.com/docs/router/customizations/custom-binary/#1-create-a-new-project as it says:

Rust 1.71.1 or later

which made me install 1.72 and took me a bit to figure out why it wasnt working

@abernix
Copy link
Member

abernix commented Sep 5, 2023

@rickbijkerk Thanks for the callout: That should hopefully no longer be the case after the 1.29.1 release (which came out yesterday, shortly after your message), which should support 1.72.0. Do you mind trying it out and seeing if you still encounter this?

@abernix abernix unpinned this issue Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants