git.delta.rocks / jrsonnet / refs/commits / a6dd70c0570f

difftreelog

ci build current binaries with crane

Yaroslav Bolyukin2024-03-25parent: #c2313a2.patch.diff
in: master

5 files changed

modifiedflake.lockdiffbeforeafterboth
1{1{
2 "nodes": {2 "nodes": {
3 "crane": {
4 "inputs": {
5 "nixpkgs": [
6 "nixpkgs"
7 ]
8 },
9 "locked": {
10 "lastModified": 1711299236,
11 "narHash": "sha256-6/JsyozOMKN8LUGqWMopKTSiK8N79T8Q+hcxu2KkTXg=",
12 "owner": "ipetkov",
13 "repo": "crane",
14 "rev": "880573f80d09e18a11713f402b9e6172a085449f",
15 "type": "github"
16 },
17 "original": {
18 "owner": "ipetkov",
19 "repo": "crane",
20 "type": "github"
21 }
22 },
3 "flake-utils": {23 "flake-utils": {
4 "inputs": {24 "inputs": {
5 "systems": "systems"25 "systems": "systems"
35 },55 },
36 "root": {56 "root": {
37 "inputs": {57 "inputs": {
58 "crane": "crane",
38 "flake-utils": "flake-utils",59 "flake-utils": "flake-utils",
39 "nixpkgs": "nixpkgs",60 "nixpkgs": "nixpkgs",
40 "rust-overlay": "rust-overlay"61 "rust-overlay": "rust-overlay"
modifiedflake.nixdiffbeforeafterboth
5 flake-utils.url = "github:numtide/flake-utils";5 flake-utils.url = "github:numtide/flake-utils";
6 rust-overlay = {6 rust-overlay = {
7 url = "github:oxalica/rust-overlay";7 url = "github:oxalica/rust-overlay";
8 inputs.nixpkgs.follows = "nixpkgs";8 inputs = {
9 nixpkgs.follows = "nixpkgs";
9 inputs.flake-utils.follows = "flake-utils";10 flake-utils.follows = "flake-utils";
11 };
10 };12 };
13 crane = {
14 url = "github:ipetkov/crane";
15 inputs.nixpkgs.follows = "nixpkgs";
16 };
11 };17 };
12 outputs = {18 outputs = {
13 nixpkgs,19 nixpkgs,
14 flake-utils,20 flake-utils,
15 rust-overlay,21 rust-overlay,
22 crane,
16 ...23 ...
17 }:24 }:
18 flake-utils.lib.eachDefaultSystem (25 flake-utils.lib.eachDefaultSystem (
22 overlays = [rust-overlay.overlays.default];29 overlays = [rust-overlay.overlays.default];
23 config.allowUnsupportedSystem = true;30 config.allowUnsupportedSystem = true;
24 };31 };
25 lib = pkgs.lib;32 rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
26 rust =33 craneLib = (crane.mkLib pkgs).overrideToolchain rust;
27 (pkgs.rustChannelOf {
28 date = "2024-01-10";
29 channel = "nightly";
30 })
31 .default
32 .override {
33 extensions = ["rust-src" "miri" "rust-analyzer" "clippy"];
34 };
35 in {34 in {
36 packages = rec {35 packages = rec {
37 default = jrsonnet;36 default = jrsonnet;
42 # haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };41 # haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };
42
43 jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {43 jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {
44 rustPlatform = pkgs.makeRustPlatform {
45 rustc = rust;
46 cargo = rust;
47 };44 inherit craneLib;
48 };45 };
49 jrsonnet-nightly = pkgs.callPackage ./nix/jrsonnet.nix {46 jrsonnet-nightly = pkgs.callPackage ./nix/jrsonnet.nix {
50 rustPlatform = pkgs.makeRustPlatform {
51 rustc = rust;
52 cargo = rust;
53 };47 inherit craneLib;
54 withNightlyFeatures = true;48 withNightlyFeatures = true;
55 };49 };
50 jrsonnet-experimental = pkgs.callPackage ./nix/jrsonnet.nix {
51 inherit craneLib;
52 withExperimentalFeatures = true;
53 };
54
56 jrsonnet-release = pkgs.callPackage ./nix/jrsonnet-release.nix {55 jrsonnet-release = pkgs.callPackage ./nix/jrsonnet-release.nix {
57 rustPlatform = pkgs.makeRustPlatform {56 rustPlatform = pkgs.makeRustPlatform {
115 ];114 ];
116 };115 };
117 };116 };
118 packagesCross = lib.genAttrs ["mingwW64"] (crossSystem: let
119 callPackage = pkgs.pkgsCross.${crossSystem}.callPackage;
120 in {
121 jrsonnet = callPackage ./nix/jrsonnet.nix {
122 # rustPlatform = pkgs.makeRustPlatform {
123 # rustc = rust;
124 # cargo = rust;
125 # };
126 };
127 });
128 devShells.default = pkgs.mkShell {117 devShells.default = craneLib.devShell {
129 nativeBuildInputs = with pkgs; [118 nativeBuildInputs = with pkgs; [
130 alejandra119 alejandra
131 rust
132 cargo-edit120 cargo-edit
133 cargo-asm121 cargo-asm
134 cargo-outdated122 cargo-outdated
modifiednix/jrsonnet-release.nixdiffbeforeafterboth
1{ lib, fetchFromGitHub, rustPlatform, runCommand, makeWrapper }:1{
22 fetchFromGitHub,
33 rustPlatform,
4 makeWrapper,
5}:
4rustPlatform.buildRustPackage rec {6rustPlatform.buildRustPackage rec {
5 pname = "jrsonnet";7 pname = "jrsonnet";
modifiednix/jrsonnet.nixdiffbeforeafterboth
1{1{
2 lib,2 lib,
3 rustPlatform,3 craneLib,
4 runCommand,
5 makeWrapper,4 makeWrapper,
6 withNightlyFeatures ? false,5 withNightlyFeatures ? false,
6 withExperimentalFeatures ? false,
7 forBenchmarks ? false,7 forBenchmarks ? false,
8}:8}:
9with lib; let9with lib;
10 filteredSrc = builtins.path {10 craneLib.buildPackage rec {
11 name = "jrsonnet-src-filtered";
12 filter = path: type: !(builtins.baseNameOf path == "flake.nix" || builtins.baseNameOf path == "nix");
13 path = ../.;
14 };
15
16 # for some reason, filteredSrc hash still depends on nix directory contents
17 # Moving it into a CA store drops leftover references
18 src =
19 runCommand "jrsonnet-src"
20 {
21 __contentAddressed = true;
22 } "cp -r '${filteredSrc}' $out";
23in
24 rustPlatform.buildRustPackage rec {
25 inherit src;11 src = lib.cleanSourceWith {
12 src = ../.;
13 filter = path: type:
14 (lib.hasSuffix "\.jsonnet" path)
15 || (craneLib.filterCargoSources path type);
16 };
26 pname = "jrsonnet";17 pname = "jrsonnet";
27 version = "current${optionalString withNightlyFeatures "-nightly"}";18 version = "current${optionalString withNightlyFeatures "-nightly"}${optionalString withExperimentalFeatures "-experimental"}";
2819
29 cargoTestFlags = [20 cargoTestFlags = [
30 "--features=mimalloc,legacy-this-file${optionalString withNightlyFeatures ",nightly"}"21 "--features=mimalloc,legacy-this-file${optionalString withNightlyFeatures ",nightly"}${optionalString withExperimentalFeatures ",experimental"}"
31 ];22 ];
32 cargoBuildFlags = cargoTestFlags;23 cargoBuildFlags = cargoTestFlags;
3324
38 wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000 --os-stack=200000"29 wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000 --os-stack=200000"
39 '';30 '';
40
41 cargoLock = {
42 lockFile = ../Cargo.lock;
43 };
44 }31 }
4532
modifiedrust-toolchain.tomldiffbeforeafterboth
1[toolchain]1[toolchain]
2channel = "nightly-2023-10-28"2channel = "nightly-2024-01-10"
3components = ["rustfmt", "clippy"]3components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]
44