Skip to content

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

Closed

Description

@pateljoel

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

Activity

  1. youknowone commented on Jul 29, 2022

    @youknowone
    Member

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

  2. fanninpm commented on Jul 29, 2022

    @fanninpm
    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?

  3. youknowone commented on Jul 29, 2022

    @youknowone
    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.

  4. youknowone commented on Jul 29, 2022

    @youknowone
    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.

  5. qingshi163 commented on Jul 29, 2022

    @qingshi163
    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

  6. pinned this issue on Aug 15, 2022
  7. youknowone commented on Aug 15, 2022

    @youknowone
    Member

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

  8. youknowone commented on Aug 15, 2022

    @youknowone
    Member

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

  9. qingshi163 commented on Aug 16, 2022

    @qingshi163
    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.

  10. youknowone commented on Aug 17, 2022

    @youknowone
    Member

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

  11. unpinned this issue on Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions