rustfmt: allow building as nightly
This is used by bindgen, and may be useful for other projects as well, as rustfmt disables many features when built as stable.
This commit is contained in:
parent
6eb00a41a0
commit
ddef8a68cb
3 changed files with 7 additions and 3 deletions
|
@ -77,6 +77,7 @@ in
|
|||
pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmBootstrapForDarwin.stdenv; };
|
||||
});
|
||||
rustfmt = self.callPackage ./rustfmt.nix { inherit Security; };
|
||||
rustfmt-nightly = self.callPackage ./rustfmt.nix { inherit Security; asNightly = true; };
|
||||
cargo = self.callPackage ./cargo.nix {
|
||||
# Use boot package set to break cycle
|
||||
rustPlatform = bootRustPlatform;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, stdenv, rustPlatform, Security }:
|
||||
{ lib, stdenv, rustPlatform, Security, asNightly ? false }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "rustfmt";
|
||||
pname = "rustfmt" + lib.optionalString asNightly "-nightly";
|
||||
inherit (rustPlatform.rust.rustc) version src;
|
||||
|
||||
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
|
||||
|
@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
|
|||
# As of rustc 1.45.0, these env vars are required to build rustfmt (due to
|
||||
# https://github.com/rust-lang/rust/pull/72001)
|
||||
CFG_RELEASE = rustPlatform.rust.rustc.version;
|
||||
CFG_RELEASE_CHANNEL = "stable";
|
||||
CFG_RELEASE_CHANNEL = if asNightly then "nightly" else "stable";
|
||||
|
||||
# FIXME: seems fixed upstream, remove after the next update
|
||||
patches = [ ./rustfmt-fix-self-tests.patch ];
|
||||
|
|
|
@ -13471,7 +13471,10 @@ with pkgs;
|
|||
rhack = callPackage ../development/tools/rust/rhack { };
|
||||
inherit (rustPackages) rls;
|
||||
roogle = callPackage ../development/tools/rust/roogle { };
|
||||
|
||||
rustfmt = rustPackages.rustfmt;
|
||||
rustfmt-nightly = rustPackages.rustfmt-nightly;
|
||||
|
||||
rustracer = callPackage ../development/tools/rust/racer {
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue