Skip to content
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

init: macOS apple silicon runner #5957

Closed
wants to merge 1 commit into from

Conversation

LeviticusNelson
Copy link

I started the first steps to have aarch64-apple-darwin builds possible for rustfmt so that that people who use the aarch64-apple-darwin target can use the latest rustfmt builds.

@ytmimi
Copy link
Contributor

ytmimi commented Nov 5, 2023

Thanks for the PR, but we're going to move away from distributing pre-built binaries in the future. You can read the discussion on #5761 for more details.

The recommendation is for users to get rustfmt via rustup

# stable
rustup component add rustfmt

# nightly
rustup component add rustfmt --toolchain nightly

@ytmimi ytmimi closed this Nov 5, 2023
@LeviticusNelson
Copy link
Author

LeviticusNelson commented Nov 5, 2023

It seems that I cannot use the nightly version of rustfmt so I just installed via homebrew

brew install rustfmt

@ytmimi
Copy link
Contributor

ytmimi commented Nov 5, 2023

@LeviticusNelson did you mean rustfmt and not rustfml?

@LeviticusNelson
Copy link
Author

Yes, I meant to write rustfmt but after figuring out how to run this tool all morning my heart was feeling the fml 😂

@ytmimi
Copy link
Contributor

ytmimi commented Nov 5, 2023

I'm glad that you were able to get rustfmt installed and working. I'm a bit surprised that things didn't work when you tried to install rustfmt via rustup though, and that you needed to install it via homebrew. Do you have a rust toolchain installed? If not that could be the issue.

I ask because on my mac I'm using the nightly-aarch64-apple-darwin toolchain and I don't have any issue running rustfmt.

@LeviticusNelson
Copy link
Author

I was running this command while having my default set to nightly:

rustup component add rustfmt --toolchain nightly

# output
info: component 'rustfmt' for target 'aarch64-apple-darwin' is up to date

This seems to still be running the stable version of rustfmt for some reason

@ytmimi
Copy link
Contributor

ytmimi commented Nov 6, 2023

I'd double check whether or not you're using a nightly toolchain by default. What do you see for you active toolchain when you run rustup show?

active toolchain
----------------

nightly-aarch64-apple-darwin (default)

Assuming that your default toolchain is stable, if you just want to run nightly rustfmt on an ad hoc basis you can run rustfmt +nightly path/to/rust_file.rs or cargo +nightly fmt.

Note: You can't pass file paths to cargo fmt

You can run rustup override nightly to set a nightly toolchain for a specific directory, while still using a stable toolchain everywhere else. Then executing rustfmt path/to/rust_file.rs should get forwarded to nightly rustfmt when running in that directory.

Alternatively, you can run rustup default nightly to set the default toolchain on your system to nightly. Then all calls to rustfmt path/to/rust_file.rs should use the nightly version, and if you want to use stable for some reason you could run rustfmt +stable or cargo +stable fmt

@LeviticusNelson
Copy link
Author

I had to clear out $HOME/.cargo and reinstall rustup to get this to work properly. Thanks for the concise assistance!

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

Successfully merging this pull request may close these issues.

3 participants