Skip to content

cargo install --git ... does not work with rustc from Homebrew (on MacOS) #5910

Closed as not planned

Description

@reactive-firewall

Summary

Similar build issue to GHI #5419 but when running cargo install --git https://github.com/RustPython/RustPython rustpython

Details

Versions

$ bash --version
version 5.2.37(1)-release (x86_64-apple-darwin24.5.0)
$ rustc --version
rustc 1.87.0 (17067e9ac 2025-05-09) (Homebrew)
$ uname -a
Darwin Computer 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_X86_64 x86_64

Reproducing the error

  • run in terminal.app on macOS (or fresh bash -il shell in container):

        cargo install --git https://github.com/RustPython/RustPython rustpython
  • wait for end of proccess

  • see ERROR:

   Compiling rustpython-common v0.4.0 (/Users/amak/.cargo/git/checkouts/rustpython-63090cdce5e18442/ec577e5/common)
error[E0658]: `let` expressions in this position are unstable
   --> vm/src/protocol/object.rs:462:12
    |
462 |         if let Some(cls) = PyType::check(cls)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information

error[E0658]: `let` expressions in this position are unstable
   --> vm/src/protocol/object.rs:463:16
    |
463 |             && let Some(derived) = PyType::check(self)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `rustpython-vm` (lib) due to 2 previous errors
error: failed to compile `rustpython v0.4.0 (https://github.com/RustPython/RustPython#ec577e55)`, intermediate artifacts can be found at `<REDACTED RANDOM PATH>`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

🤷 I was planning on using this project to learn some rust-lang, but I seem to be stuck on the rust package manager already.

I doubt the correct response is the advice from rustc --explain E0658 to "just add the corresponding feature to be able to use it" (seems hackish and contrary to the rustpython project goals, but I'm just a neophyte to rust)

I susspect the hint about this being related to rust-lang/rust#53667 is more relevant and looks to my uninitiated eyes as related to rust-lang/rust#86730 (which I'm thinking needs something like let-verify + if verified ... style fix for stable versions of rustc, but I really am just guessing)

Activity

  1. reactive-firewall commented on Jul 8, 2025

    @reactive-firewall
    Author

    Additional hint:

    I found the relevant code here:

    // Fast path for both being types (matches CPython's PyType_Check)
    if let Some(cls) = PyType::check(cls)
    && let Some(derived) = PyType::check(self)

  2. youknowone commented on Jul 8, 2025

    @youknowone
    Member

    That's by policy. Please check our README: https://github.com/RustPython/RustPython/blob/main/README.md?plain=1#L22-L26

    Rust community encourage to use rustup in general.

  3. reactive-firewall commented on Jul 8, 2025

    @reactive-firewall
    Author

    @youknowone, thanks for the quick response, 🙉 I miss-read the README the first time and took the example given to be the actual required version, despite the date. I should have checked for a stable upgrade 🤦 how embarrassing. 🙇 thank you again.

    • Confirmed fixed in rustc v1.88.0 (Homebrew)
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions