rustc_codegen_cranelift icon indicating copy to clipboard operation
rustc_codegen_cranelift copied to clipboard

run test.sh in mingw64 panic!

Open unitsoftrover opened this issue 4 years ago • 8 comments

[mini_core_hello_world : codegen mono items] start [mini_core_hello_world : codegen mono items] end time: 11.797544ms thread 'rustc' panicked at 'can't resolve symbol _ZN9mini_core8A_STATIC17h1e90a401893c503aE', C:\Users\robinson.cargo\git\checkouts\wasmtime-41807828cb3a7a7e\9c550fc\cranelift\jit\src\backend.rs:288:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/bjorn3/rustc_codegen_cranelift/issues/new

note: rustc 1.56.0-nightly (29ef6cf16 2021-08-31) running on x86_64-pc-windows-gnu

note: compiler flags: -Z unstable-options -C debuginfo=2 -C llvm-args=mode=jit -C prefer-dynamic

query stack during panic: end of query stack warning: 1 warning emitted

unitsoftrover avatar Sep 02 '21 10:09 unitsoftrover

Try https://github.com/bjorn3/rustc_codegen_cranelift/pull/1195. This PR contains several windows fixes.

bjorn3 avatar Sep 02 '21 10:09 bjorn3

I checkout the windows_fix branch. build fail.

Compiling cranelift-bforest v0.76.0 (https://github.com/bytecodealliance/wasmtime.git#9c550fcf) Compiling regalloc v0.0.31 Compiling gimli v0.25.0 error[E0107]: this struct takes 2 generic arguments but 1 generic argument was supplied --> C:\Users\robinson.cargo\registry\src\github.com-1ecc6299db9ec823\gimli-0.25.0\src\write\abbrev.rs:16:14 | 16 | abbrevs: IndexSet<Abbreviation>, | ^^^^^^^^ ------------ supplied 1 generic argument | | | expected 2 generic arguments | note: struct defined here, with 2 generic parameters: T, S --> C:\Users\robinson.cargo\registry\src\github.com-1ecc6299db9ec823\indexmap-1.7.0\src\set.rs:67:12 | 67 | pub struct IndexSet<T, S> { | ^^^^^^^^ - - help: add missing generic argument | 16 | abbrevs: IndexSet<Abbreviation, S>, | +++

error[E0107]: this struct takes 2 generic arguments but 1 generic argument was supplied --> C:\Users\robinson.cargo\registry\src\github.com-1ecc6299db9ec823\gimli-0.25.0\src\write\cfi.rs:25:11 | 25 | cies: IndexSet<CommonInformationEntry>, | ^^^^^^^^ ---------------------- supplied 1 generic argument | | | expected 2 generic arguments

unitsoftrover avatar Sep 02 '21 11:09 unitsoftrover

Huh, compilation succeeds on CI.

bjorn3 avatar Sep 02 '21 11:09 bjorn3

when could the cranelift run in windows? I want to use Rust to improve ERP system speed, but the Rust compile too slowly. even use the Diesel-ORM when table fields number more than 32, every compile time long than a minute. I think the rustc_codegen_cranelift can solve the compile problem. btw, how long do you compile rust program offen?

unitsoftrover avatar Sep 02 '21 11:09 unitsoftrover

btw, how long do you compile rust program offen?

This depends on the program. Some programs stress the backend more, while others the frontend. This project only replaces part of the backend and as such doesn't help much when most of the time is spent in the frontend.

I want to use Rust to improve ERP system speed, but the Rust compile too slowly. even use the Diesel-ORM when table fields number more than 32, every compile time long than a minute. I think the rustc_codegen_cranelift can solve the compile problem.

I guess Diesel is rather heavy in the frontend, but I am not sure. How long does cargo check take on your program? This only runs the frontend and as such is the absolute lower bound on how long it will take to compile with cg_clif.

when could the cranelift run in windows?

Not sure. I don't use windows myself and wine at least in the version I have doesn't implement an api required by cargo, so I can't easily test it locally.

bjorn3 avatar Sep 02 '21 11:09 bjorn3

I read the Diesel source code and write a new driver to odbc. I find compile very slow is subjected to macro. rust macro is very powerful but waste compiling time. every time modify some words and compile, then waiting about a minute. can cranelift save macro compilation time?

unitsoftrover avatar Sep 02 '21 13:09 unitsoftrover

It should save on the time it takes to compile the macro itself.

bjorn3 avatar Sep 02 '21 13:09 bjorn3

ok, thanks very much.

unitsoftrover avatar Sep 02 '21 13:09 unitsoftrover

The thread 'rustc' panicked at 'can't resolve symbol _ZN9mini_core8A_STATIC17h1e90a401893c503aE' issue has been fixed by https://github.com/bjorn3/rustc_codegen_cranelift/pull/1273. There are still some windows issues, but they are being worked at.

bjorn3 avatar Sep 01 '22 15:09 bjorn3