Skip to content

Unable to install RustPython from source with cargo install. #3982

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

Closed
pateljoel opened this issue Jul 29, 2022 · 9 comments
Closed

Unable to install RustPython from source with cargo install. #3982

pateljoel opened this issue Jul 29, 2022 · 9 comments
Labels
C-bug Something isn't working

Comments

@pateljoel
Copy link

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

@youknowone
Copy link
Member

oh, wow. this is so weird, but reproducible.

@fanninpm
Copy link
Contributor

This appears to be a side effect of #3507 and other PRs that added PyNumberProtocol to certain objects.

@qingshi163 are you able to help investigate this issue?

@youknowone
Copy link
Member

I think we need to file a bug report to rust. the different result of cargo build and cargo install are unlikely to be happened.

@youknowone
Copy link
Member

consttest.zip

I created a small project to test it. I now think our code is wrong and cargo build mysteriously not able to catch it.

@qingshi163
Copy link
Contributor

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 youknowone added the C-bug Something isn't working label Jul 31, 2022
@youknowone youknowone pinned this issue Aug 15, 2022
@youknowone
Copy link
Member

This is (probably) broken by #3819. Using previous version than that will be helpful

@youknowone
Copy link
Member

I tried to fix it a few days ago but making NOT_IMPLEMENTED static was not enough

@qingshi163
Copy link
Contributor

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
Copy link
Member

@qingshi163 Thank you! we will need a proper fix later but pinning crossbeam-utils will be helpful right now

@youknowone youknowone unpinned this issue Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants