mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 10:26:18 +04:00
Build flake packages with stable Rust (#8133)
We can continue to use the MSRV for local development and checks while building release executables with the latest stable Rust, as we do in CI.
This commit is contained in:
parent
48373d4a2b
commit
7cf775d512
19
flake.nix
19
flake.nix
@ -121,7 +121,8 @@
|
|||||||
then ''$RUSTFLAGS -C link-arg=-fuse-ld=lld -C target-cpu=native -Clink-arg=-Wl,--no-rosegment''
|
then ''$RUSTFLAGS -C link-arg=-fuse-ld=lld -C target-cpu=native -Clink-arg=-Wl,--no-rosegment''
|
||||||
else "$RUSTFLAGS";
|
else "$RUSTFLAGS";
|
||||||
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
|
craneLibMSRV = (crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||||
|
craneLibStable = (crane.mkLib pkgs).overrideToolchain pkgs.pkgsBuildHost.rust-bin.stable.latest.default;
|
||||||
commonArgs =
|
commonArgs =
|
||||||
{
|
{
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
@ -133,13 +134,13 @@
|
|||||||
doCheck = false;
|
doCheck = false;
|
||||||
meta.mainProgram = "hx";
|
meta.mainProgram = "hx";
|
||||||
}
|
}
|
||||||
// craneLib.crateNameFromCargoToml {cargoToml = ./helix-term/Cargo.toml;};
|
// craneLibMSRV.crateNameFromCargoToml {cargoToml = ./helix-term/Cargo.toml;};
|
||||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
cargoArtifacts = craneLibMSRV.buildDepsOnly commonArgs;
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
helix-unwrapped = craneLib.buildPackage (commonArgs
|
helix-unwrapped = craneLibStable.buildPackage (commonArgs
|
||||||
// {
|
// {
|
||||||
inherit cargoArtifacts;
|
cargoArtifacts = craneLibStable.buildDepsOnly commonArgs;
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps $out/share/icons/hicolor/256x256/apps
|
mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps $out/share/icons/hicolor/256x256/apps
|
||||||
cp contrib/Helix.desktop $out/share/applications
|
cp contrib/Helix.desktop $out/share/applications
|
||||||
@ -155,20 +156,20 @@
|
|||||||
# Build the crate itself
|
# Build the crate itself
|
||||||
inherit (self.packages.${system}) helix;
|
inherit (self.packages.${system}) helix;
|
||||||
|
|
||||||
clippy = craneLib.cargoClippy (commonArgs
|
clippy = craneLibMSRV.cargoClippy (commonArgs
|
||||||
// {
|
// {
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
});
|
});
|
||||||
|
|
||||||
fmt = craneLib.cargoFmt commonArgs;
|
fmt = craneLibMSRV.cargoFmt commonArgs;
|
||||||
|
|
||||||
doc = craneLib.cargoDoc (commonArgs
|
doc = craneLibMSRV.cargoDoc (commonArgs
|
||||||
// {
|
// {
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
});
|
});
|
||||||
|
|
||||||
test = craneLib.cargoTest (commonArgs
|
test = craneLibMSRV.cargoTest (commonArgs
|
||||||
// {
|
// {
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user