Skip to content

doc: update GitHub developers setup guide #153

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

opeolluwa
Copy link

What is in this PR?

  • Update GitHub developers setup guide to resolve error
error: the 'cargo' binary, normally provided by the 'cargo' component, is not applicable to the 'nightly-2025-02-16-aarch64-apple-darwin' toolchain

@ndmitchell
Copy link
Contributor

Thanks for the patch. If you are in the pyrefly directory (e.g. C:/Neil/pyrefly/pyrefly if you clone from C:/Neil) then cargo build is meant to pick up https://github.com/facebook/pyrefly/blob/main/pyrefly/rust-toolchain which is meant to automatically install the right nightly. Because nightlies sometimes have bugs we tend to develop pinned to a specific nightly (currently 2025-02-16, but we upgrade every 4 months or so).

If you try that, what fails? I just tried it on my windows machine with a fresh rustup (rustup 1.28.1) and the first time I ran cargo build it transparently installed the necessary nightly and selected it.

@opeolluwa
Copy link
Author

@ndmitchell Thank you for the swift follow up<

Here's a copy of my command run for Mac,

Screenshot 2025-05-02 at 13 08 04
error: the 'cargo' binary, normally provided by the 'cargo' component, is not applicable to the 'nightly-2025-02-16-aarch64-apple-darwin' toolchain

@ndmitchell
Copy link
Contributor

Moving to my Mac, I removed all toolchains from rustup, then did:

ndmitchell@ndmitchell-mbp pyrefly % cargo build
info: syncing channel updates for 'nightly-2025-02-16-aarch64-apple-darwin'
info: latest update on 2025-02-16, rust version 1.86.0-nightly (9cd60bd2c 2025-02-15)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
    Updating crates.io index
    Updating git repository `https://github.com/astral-sh/ruff/`
     Locking 359 packages to latest compatible versions
      Adding argfile v0.1.6 (available: v0.2.1)
      Adding blake3 v1.5.5 (available: v1.8.2)
      Adding const-str v0.4.3 (available: v0.6.2)
      Adding convert_case v0.6.0 (available: v0.8.0)
      Adding enum-iterator v1.5.0 (available: v2.1.0)
      Adding lsp-types v0.94.1 (available: v0.97.0)
      Adding notify v5.2.0 (available: v8.0.0)
      Adding parse-display v0.8.2 (available: v0.10.0)
      Adding regex-syntax v0.7.5 (available: v0.8.5)
      Adding serde_with v1.14.0 (available: v3.12.0)
      Adding which v4.4.2 (available: v7.0.3)
  Downloaded synstructure v0.13.2
  Downloaded cc v1.2.21
  Downloaded winnow v0.7.9
  Downloaded hashbrown v0.15.3
  Downloaded rustix v1.0.7
  Downloaded 5 crates (854.7 KB) in 2.85s
   Compiling unicode-ident v1.0.18
   Compiling proc-macro2 v1.0.95
   Compiling cfg-if v1.0.0
   ... many lines resulting in a compiled binary ...

In a different directory, in order to not be effected by the rust-toolchain file, I ran:

ndmitchell@ndmitchell-mbp pyrefly % cargo --version
cargo 1.86.0 (adf9b6ad1 2025-02-28)
ndmitchell@ndmitchell-mbp pyrefly % rustup --version
rustup 1.28.1 (f9edccde0 2025-03-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.86.0 (05f9846f8 2025-03-31)`

Showing that it does change cargo and my versions. Can you try the --version for both rustup and cargo. Then do rustup update. Then try and see if it works after?

@ndmitchell
Copy link
Contributor

I think the issue here might be that if you get cargo from your distribution rather than for rustup then it ignores the rust_toolchain file we have.

@opeolluwa
Copy link
Author

Not at all, it was from rustup.

@opeolluwa
Copy link
Author

I uninstalled the entire Rust toolchain the other day, and I haven't re-run the project since.

I'll check back when I do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants