Repository navigation
Unable to install RustPython from source with cargo install. #3982
Copy link
Copy link
Closed
Labels
C-bugSomething isn't workingSomething isn't working
Description
I ran the below command:
cargo install --git https://github.com/RustPython/RustPython --features ssl
To try the new pip features and I get this error:
Compiling rustpython-derive v0.1.2 (/Users/jptl/.cargo/git/checkouts/rustpython-f8ef4d934ac33cd8/0341e72/derive)
error[E0493]: destructors cannot be evaluated at compile-time
--> vm/src/builtins/bytes.rs:619:15
|
619 | ..PyNumberMethods::NOT_IMPLEMENTED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ statics cannot evaluate destructors
620 | };
| - value is dropped here
error[E0493]: destructors cannot be evaluated at compile-time
--> vm/src/builtins/complex.rs:469:15
|
469 | ..PyNumberMethods::NOT_IMPLEMENTED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ statics cannot evaluate destructors
470 | };
| - value is dropped here
error[E0493]: destructors cannot be evaluated at compile-time
--> vm/src/builtins/float.rs:600:15
|
600 | ..PyNumberMethods::NOT_IMPLEMENTED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ statics cannot evaluate destructors
601 | };
| - value is dropped here
error[E0493]: destructors cannot be evaluated at compile-time
--> vm/src/builtins/int.rs:824:15
|
824 | ..PyNumberMethods::NOT_IMPLEMENTED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ statics cannot evaluate destructors
825 | };
| - value is dropped here
error[E0493]: destructors cannot be evaluated at compile-time
--> vm/src/builtins/mappingproxy.rs:229:15
|
229 | ..PyNumberMethods::NOT_IMPLEMENTED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ statics cannot evaluate destructors
230 | };
| - value is dropped here
error[E0493]: destructors cannot be evaluated at compile-time
--> vm/src/builtins/singletons.rs:63:15
|
63 | ..PyNumberMethods::NOT_IMPLEMENTED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ statics cannot evaluate destructors
64 | };
| - value is dropped here
For more information about this error, try `rustc --explain E0493`.
error: could not compile `rustpython-vm` due to 6 previous errors
error: failed to compile `rustpython v0.1.2 (https://github.com/RustPython/RustPython#0341e72d)`, intermediate artifacts can be found at `/var/folders/kr/bth5f40j6k97jj7m0w22rnh80000gn/T/cargo-installPr3Y3y`Rust & Cargo Versions
rustc 1.62.1 (e092d0b6b 2022-07-16)
cargo 1.62.1 (a748cf5a3 2022-06-08)
I am on macOS Monterey 12.4 x86_64.
Any help would be appreciated.
Joel
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugSomething isn't workingSomething isn't working
Activity
youknowone commentedon Jul 29, 2022
oh, wow. this is so weird, but reproducible.
fanninpm commentedon Jul 29, 2022
This appears to be a side effect of #3507 and other PRs that added
PyNumberProtocolto certain objects.@qingshi163 are you able to help investigate this issue?
youknowone commentedon Jul 29, 2022
I think we need to file a bug report to rust. the different result of
cargo buildandcargo installare unlikely to be happened.youknowone commentedon Jul 29, 2022
consttest.zip
I created a small project to test it. I now think our code is wrong and
cargo buildmysteriously not able to catch it.qingshi163 commentedon Jul 29, 2022
Can't believe it, if the code is wrong, why rust not allow a static variable to be constructed by a const variable. a const var in rust isn't works like macro, the compiler copy it to everywhere it is using?
I think the simplest work around is make NOT_IMPLEMENTED static instead const
youknowone commentedon Aug 15, 2022
This is (probably) broken by #3819. Using previous version than that will be helpful
youknowone commentedon Aug 15, 2022
I tried to fix it a few days ago but making NOT_IMPLEMENTED static was not enough
qingshi163 commentedon Aug 16, 2022
I think the issue is caused by crossbeam::AtomicCell, It works with std::sync::AtomicPtr, see the test
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ee8cb953a641bdebcd008146e71474d4
we probably can extend our PyAtomic to take a function pointer.
youknowone commentedon Aug 17, 2022
@qingshi163 Thank you! we will need a proper fix later but pinning crossbeam-utils will be helpful right now