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

use system rustup to get rustfmt #2055

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions packages/rustfmt/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@ categories:
- Formatter

source:
id: pkg:github/rust-lang/[email protected]
asset:
- target: [darwin_x64, darwin_arm64]
file: rustfmt_macos-x86_64_{{version}}.tar.gz
bin: rustfmt_macos-x86_64_{{version}}/rustfmt
- target: linux_x64
file: rustfmt_linux-x86_64_{{version}}.tar.gz
bin: rustfmt_linux-x86_64_{{version}}/rustfmt
- target: win_x64
file: rustfmt_windows-x86_64-msvc_{{version}}.zip
bin: rustfmt_windows-x86_64-msvc_{{version}}/rustfmt.exe
id: pkg:generic/rustfmt@x
build:
run: cp $(which rustfmt) . || echo "rustfmt not found"
bin: rustfmt
Comment on lines +14 to +17
Copy link
Member

@williamboman williamboman Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic for a couple of reasons:

  1. It has a placeholder version number. Packages must refer to real version numbers.
  2. The build script simply copies an external installation of rustfmt into the Mason installation directory. This is not a self-contained installation, and may also be problematic for loading linked libraries (relative rpath). This is likely also problematic because it will use whatever toolchain is currently active.
  3. Doesn't support Windows (although this would be an easy fix by providing a powershell script as well).


bin:
rustfmt: "{{source.asset.bin}}"
rustfmt: "{{source.build.bin}}"