You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use rustc_codegen_cranelift in a project that has a build.rs file using the tonic_build crate. It seems that the compiled build.rs executable is crashing. I put up a repo that reproduces this here: https://github.com/soenkehahn/cranelift-bug. In that repo, cargo build works successfully, but path_to_rustc_codegen_cranelift/build/cargo build does not. I get the following error:
error: failed to run custom build command for `foo v0.0.1 (/home/shahn/cranelift-bug)`
Caused by:
process didn't exit successfully: `/home/shahn/cranelift-bug/target/debug/build/foo-39185742e3e011c8/build-script-build` (signal: 6, SIGABRT: process abort signal)
Passing in -vvv to get a more informative error message does not yield anything more interesting, as far as I can tell.
I'm using rustc_codegen_cranelift from commit e9eac6bd on linux.
The text was updated successfully, but these errors were encountered:
tl;dr: tonic_build uses proc_macro2 which checks if it runs inside a proc_macro by calling a proc_macro function that panics if it is called outside of a proc macro. cg_clif doesn't yet support catching panics and as such aborts.
You could try adding proc_macro2 as build-dependency and then calling proc_macro2::fallback::force() before tonic_build inside the build script. This will force it to assume that it isn't running inside a proc macro.
I see. Thanks for the explanation. proc_macro2::fallback::force() does the trick. Unfortunately the real project that I was trying to use rustc_codegen_cranelift in, also depends on cssparser, which fails for the same reason (as described in #1101).
I tried to use
rustc_codegen_cranelift
in a project that has abuild.rs
file using thetonic_build
crate. It seems that the compiledbuild.rs
executable is crashing. I put up a repo that reproduces this here: https://github.com/soenkehahn/cranelift-bug. In that repo,cargo build
works successfully, butpath_to_rustc_codegen_cranelift/build/cargo build
does not. I get the following error:Passing in
-vvv
to get a more informative error message does not yield anything more interesting, as far as I can tell.I'm using
rustc_codegen_cranelift
from commite9eac6bd
on linux.The text was updated successfully, but these errors were encountered: