git.delta.rocks / jrsonnet / refs/commits / 3ab5bdb7f60f

difftreelog

ci more realworld benchmarks

yvoquykvYaroslav Bolyukin2026-05-07parent: #97dec27.patch.diff
in: master

12 files changed

modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -218,6 +218,9 @@
         in
         {
           legacyPackages = {
+            fetchJrq = pkgs.callPackage ./nix/fetch-jrq.nix {
+              inherit (self'.packages) jrsonnet;
+            };
             release = optionalAttrs pkgs.stdenv.hostPlatform.isLinux (
               {
                 jrsonnet-linux-glibc = self'.packages.jrsonnet;
@@ -254,6 +257,7 @@
             );
             benchmarks = optionalAttrs (system == "x86_64-linux" || system == "aarch64-linux") {
               default = pkgs.callPackage ./nix/benchmarks.nix {
+                inherit (config.legacyPackages) fetchJrq;
                 inherit (config.legacyPackages.jsonnetImpls)
                   go-jsonnet
                   sjsonnet
@@ -268,6 +272,7 @@
                 ];
               };
               quick = pkgs.callPackage ./nix/benchmarks.nix {
+                inherit (config.legacyPackages) fetchJrq;
                 inherit (config.legacyPackages.jsonnetImpls)
                   go-jsonnet
                   sjsonnet
@@ -283,6 +288,7 @@
                 ];
               };
               against-release = pkgs.callPackage ./nix/benchmarks.nix {
+                inherit (config.legacyPackages) fetchJrq;
                 inherit (config.legacyPackages.jsonnetImpls)
                   go-jsonnet
                   sjsonnet
@@ -305,6 +311,7 @@
                 ];
               };
               quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {
+                inherit (config.legacyPackages) fetchJrq;
                 inherit (config.legacyPackages.jsonnetImpls)
                   go-jsonnet
                   sjsonnet
modifiednix/benchmarks.nixdiffbeforeafterboth
after · nix/benchmarks.nix
1{2  lib,3  runCommand,4  stdenv,5  fetchFromGitHub,6  fetchJrq,7  go-jsonnet,8  sjsonnet,9  cpp-jsonnet,10  rsjsonnet,11  hyperfine,12  quick ? false,13  jrsonnetVariants,14}:15with lib;16let17  inherit (cpp-jsonnet) jsonnetBench;18  inherit (go-jsonnet) goJsonnetBench;19  graalvmBench = fetchFromGitHub {20    owner = "oracle";21    repo = "graal";22    rev = "bc305df3fe587960f7635f0185571500e5988475";23    hash = "sha256-4EKB1b2o4/qtYQ+nqbbs621OJrtjApsAWEBcw5EjrYc=";24  };25  realworldVendor = fetchJrq {26    name = "realworld-vendor";27    lockfile = ../tests/realworld/jsonnetfile.lock.json;28    vendorHash = "sha256-6tXi6bRw77YKB17PhSpJnVYQcsGOvB8sgjKIrFtrwfc=";29  };30  realworldBench = runCommand "realworld-bench" { } ''31    mkdir -p $out32    cp ${../tests/realworld}/*.jsonnet ${../tests/realworld}/*.libsonnet $out/33    cp -r ${realworldVendor} $out/vendor34  '';3536  # Removes outsiders from the output37  # Useful when comparing performance of different jrsonnet releases38  skipSlow = if quick then "slow benchmark, but only quick requested" else "";39in40stdenv.mkDerivation {41  name = "benchmarks";42  # __impure = true; # not supported by hercules-ci43  unpackPhase = "true";4445  buildInputs = [46    sjsonnet47    cpp-jsonnet48    rsjsonnet49    go-jsonnet5051    hyperfine52  ];5354  installPhase =55    let56      mkBench =57        {58          name,59          path,60          omitSource ? false,61          pathIsGenerator ? false,62          skipRustAlternative ? "",63          skipScala ? "",64          skipCpp ? "",65          skipGo ? "",66          jpaths ? [ ],67        }:68        let69          jpathArgs = concatMapStrings (p: " -J ${p}") jpaths;70        in71        ''72          echo >> $out73          echo "=== ${name}" >> $out74          echo >> $out75          ${optionalString (skipRustAlternative != "") ''76            echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out77            echo >> $out78          ''}79          ${optionalString (skipGo != "") ''80            echo "> Note: No results for Go, ${skipGo}" >> $out81            echo >> $out82          ''}83          ${optionalString (skipScala != "") ''84            echo "> Note: No results for Scala (native)/Scala (GraalVM), ${skipScala}" >> $out85            echo >> $out86          ''}87          ${optionalString (skipCpp != "") ''88            echo "> Note: No results for C++, ${skipCpp}" >> $out89            echo >> $out90          ''}91          ${optionalString (!omitSource) ''92            echo ".Source" >> $out93            echo "[%collapsible]" >> $out94            echo "====" >> $out95            echo "[source,jsonnet]" >> $out96            echo "----" >> $out97            ${optionalString pathIsGenerator "echo \"// Generator source\" >> $out"}98            cat ${path} >> $out99            echo >> $out100            echo "----" >> $out101            echo "====" >> $out102            echo >> $out103          ''}104          path=${path}105          ${optionalString pathIsGenerator ''106            go-jsonnet $path > generated.jsonnet107            path=generated.jsonnet108          ''}109          hyperfine -N -w4 -m20 --output=pipe --style=basic --export-asciidoc result.adoc \110            ${111              concatStringsSep " " (112                forEach jrsonnetVariants (113                  variant:114                  "\"${variant.drv}/bin/jrsonnet $path${jpathArgs}\" -n \"Rust${115                    if variant.name != "" then " (${variant.name})" else ""116                  }\""117                )118              )119            } \120            ${121              optionalString (skipRustAlternative == "")122                "\"rsjsonnet $path${jpathArgs}\" -n \"Rust (alternative, rsjsonnet)\""123            } \124            ${125              optionalString (skipGo == "")126                "\"go-jsonnet $path${jpathArgs}\" -n \"Go\""127            } \128            ${129              optionalString (skipScala == "")130                "\"sjsonnet-native $path${jpathArgs}\" -n \"Scala (native)\""131            } \132            ${133              # My aarch64-linux machine can't run graalvm image:134              # The current machine does not support all of the following CPU features that are required by the image: [FP, ASIMD, CRC32, LSE].135              optionalString (skipScala == "" && stdenv.hostPlatform.system != "aarch64-linux")136                "\"sjsonnet-graalvm $path${jpathArgs}\" -n \"Scala (GraalVM)\""137            } \138            ${optionalString (skipCpp == "")139              "\"jsonnet $path${jpathArgs}\" -n \"C++\""140            }141          cat result.adoc >> $out142        '';143    in144    ''145      set -oux146      ulimit -s unlimited147148      temp=$(mktemp -d)149      cd $temp150151      touch $out152      ${optionalString (true) ''153        cat ${./benchmarks.adoc} >> $out154        echo >> $out155156        echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2 | xargs), $(grep -c '^processor' /proc/cpuinfo) threads" >> $out157        echo >> $out158159        echo ".Tested versions" >> $out160        echo "[%collapsible]" >> $out161        echo "====" >> $out162        echo "* Go: $(go-jsonnet --version)" >> $out163        echo "* C++: $(jsonnet --version)" >> $out164        echo "* Scala (native/GraalVM): $(sjsonnet-native 2>&1 | grep -oP 'Sjsonnet \S+')" >> $out165        echo "* Rust (alternative): rsjsonnet ${rsjsonnet.version} (${rsjsonnet.src.rev})" >> $out166        ${concatStringsSep "\n" (167          forEach jrsonnetVariants (168            variant:169            "echo \"* Rust${170              if variant.name != "" then " (${variant.name})" else ""171            }: $(${variant.drv}/bin/jrsonnet --version 2>&1)\" >> $out"172          )173        )}174        echo "====" >> $out175        echo >> $out176      ''}177      echo "== Real world" >> $out178      ${mkBench {179        name = "Graalvm CI";180        path = "${graalvmBench}/ci.jsonnet";181        omitSource = true;182        skipCpp = "takes longer than a hour";183        skipGo = skipSlow;184      }}185      ${mkBench {186        name = "Loki manifests";187        path = "${realworldBench}/entry-loki.jsonnet";188        jpaths = [ "${realworldBench}/vendor" ];189        skipCpp = "too slow, takes hours, skews results";190        skipGo = skipSlow;191      }}192      ${mkBench {193        name = "Mimir manifests";194        path = "${realworldBench}/entry-mimir.jsonnet";195        jpaths = [ "${realworldBench}/vendor" ];196        skipCpp = "too slow, takes hours, skews results";197        skipGo = skipSlow;198      }}199      ${mkBench {200        name = "Tempo manifests";201        path = "${realworldBench}/entry-tempo.jsonnet";202        jpaths = [ "${realworldBench}/vendor" ];203        skipCpp = "too slow, takes hours, skews results";204        skipGo = skipSlow;205      }}206      ${mkBench {207        name = "GitLab runbooks dashboards";208        path = "${realworldBench}/entry-gitlab-runbooks.jsonnet";209        jpaths = [210          "${realworldBench}/vendor"211          "${realworldBench}/vendor/runbooks/libsonnet"212          "${realworldBench}/vendor/runbooks/dashboards"213          "${realworldBench}/vendor/runbooks/services"214          "${realworldBench}/vendor/runbooks/metrics-catalog"215        ];216        skipCpp = "too slow, takes hours, skews results";217        skipGo = skipSlow;218      }}219220      echo >> $out221      echo "== Benchmarks from C++ jsonnet (/perf_tests)" >> $out222      ${mkBench {223        name = "Large string join";224        path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";225      }}226      ${mkBench {227        name = "Large string template";228        omitSource = true;229        path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";230        skipGo = "fails with os stack size exhausion";231        skipCpp = "too slow, takes hours, skews results";232      }}233      ${mkBench {234        name = "Realistic 1";235        path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";236        skipGo = skipSlow;237        skipCpp = "too slow, takes hours, skews results";238      }}239      ${mkBench {240        name = "Realistic 2";241        path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";242        skipGo = skipSlow;243        skipCpp = "too slow, takes hours, skews results";244      }}245246      echo >> $out247      echo "== Benchmarks from C++ jsonnet (/benchmarks)" >> $out248      ${mkBench {249        name = "Tail call";250        path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";251      }}252      ${mkBench {253        name = "Inheritance recursion";254        path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";255        skipCpp = skipSlow;256        skipGo = skipSlow;257      }}258      ${mkBench {259        name = "Simple recursive call";260        path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";261        skipGo = skipSlow;262      }}263      ${mkBench {264        name = "Foldl string concat";265        path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";266        skipCpp = skipSlow;267      }}268      ${mkBench {269        name = "Array sorts";270        path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";271        skipCpp = skipSlow;272      }}273      ${mkBench {274        name = "Lazy array";275        path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";276        skipGo = skipSlow;277      }}278      ${mkBench {279        name = "Inheritance function recursion";280        path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";281        skipCpp = skipSlow;282      }}283      ${mkBench {284        name = "String strips";285        path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";286        skipCpp = "too slow, takes hours, skews results";287      }}288      ${mkBench {289        name = "Big object";290        path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";291        pathIsGenerator = true;292      }}293294      echo >> $out295      echo "== Benchmarks from Go jsonnet (builtins)" >> $out296      ${mkBench {297        name = "std.base64";298        path = "${goJsonnetBench}/base64.jsonnet";299        skipRustAlternative = skipSlow;300        skipCpp = "too slow, takes hours, skews results";301      }}302      ${mkBench {303        name = "std.base64Decode";304        path = "${goJsonnetBench}/base64Decode.jsonnet";305        skipRustAlternative = skipSlow;306        skipCpp = skipSlow;307      }}308      ${mkBench {309        name = "std.base64DecodeBytes";310        path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";311        skipRustAlternative = skipSlow;312        skipCpp = skipSlow;313        skipGo = skipSlow;314      }}315      ${mkBench {316        name = "std.base64 (byte array)";317        path = "${goJsonnetBench}/base64_byte_array.jsonnet";318        skipRustAlternative = skipSlow;319        skipCpp = skipSlow;320        skipGo = skipSlow;321      }}322      ${mkBench {323        name = "std.foldl";324        path = "${goJsonnetBench}/foldl.jsonnet";325      }}326      ${mkBench {327        name = "std.manifestJsonEx";328        path = "${goJsonnetBench}/manifestJsonEx.jsonnet";329        skipCpp = skipSlow;330      }}331      ${mkBench {332        name = "std.manifestTomlEx";333        path = "${goJsonnetBench}/manifestTomlEx.jsonnet";334        skipCpp = skipSlow;335      }}336      ${mkBench {337        name = "std.parseInt";338        path = "${goJsonnetBench}/parseInt.jsonnet";339        skipCpp = skipSlow;340      }}341      ${mkBench {342        name = "std.reverse";343        path = "${goJsonnetBench}/reverse.jsonnet";344        skipCpp = skipSlow;345        skipGo = skipSlow;346      }}347      ${mkBench {348        name = "std.substr";349        path = "${goJsonnetBench}/substr.jsonnet";350      }}351      ${mkBench {352        name = "Comparsion for array";353        path = "${goJsonnetBench}/comparison.jsonnet";354        skipCpp = "too slow, takes hours, skews results";355      }}356      ${mkBench {357        name = "Comparsion for primitives";358        path = "${goJsonnetBench}/comparison2.jsonnet";359        skipRustAlternative = skipSlow;360        skipCpp = "can't run: uses up to 192GB of RAM";361        skipGo = skipSlow;362      }}363    '';364}
addednix/fetch-jrq.nixdiffbeforeafterboth
--- /dev/null
+++ b/nix/fetch-jrq.nix
@@ -0,0 +1,49 @@
+{
+  lib,
+  stdenvNoCC,
+  cacert,
+  jrsonnet,
+}:
+{
+  lockfile,
+  vendorHash,
+  name ? "jrq-vendor",
+}:
+stdenvNoCC.mkDerivation (finalAttrs: {
+  inherit name;
+
+  outputHashMode = "recursive";
+  outputHashAlgo = "sha256";
+  outputHash = vendorHash;
+
+  nativeBuildInputs = [
+    jrsonnet
+    cacert
+  ];
+
+  dontUnpack = true;
+  dontConfigure = true;
+  dontInstall = true;
+  dontFixup = true;
+
+  SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
+  GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
+
+  buildPhase = ''
+    runHook preBuild
+
+    export HOME=$TMPDIR
+
+    install -m644 ${lockfile} jsonnetfile.json
+    install -m644 ${lockfile} jsonnetfile.lock.json
+
+    mkdir -p "$out"
+    jrb --jsonnetpkg-home "$out" install
+
+    runHook postBuild
+  '';
+
+  passthru = {
+    inherit lockfile vendorHash;
+  };
+})
addedtests/realworld/.gitignorediffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/.gitignore
@@ -0,0 +1 @@
+/vendor
addedtests/realworld/entry-gitlab-runbooks.jsonnetdiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/entry-gitlab-runbooks.jsonnet
@@ -0,0 +1 @@
+import 'api/main.dashboard.jsonnet'
addedtests/realworld/entry-graalvm.jsonnetdiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/entry-graalvm.jsonnet
@@ -0,0 +1,42 @@
+local common = import 'ci/ci_common/common.jsonnet';
+local graal_common = import 'graal-common.json';
+
+local compiler = import 'compiler/ci/ci.jsonnet';
+local wasm = import 'wasm/ci/ci.jsonnet';
+local espresso = import 'espresso/ci/ci.jsonnet';
+local regex = import 'regex/ci/ci.jsonnet';
+local sdk = import 'sdk/ci/ci.jsonnet';
+local substratevm = import 'substratevm/ci/ci.jsonnet';
+local sulong = import 'sulong/ci/ci.jsonnet';
+local tools = import 'tools/ci/ci.jsonnet';
+local truffle = import 'truffle/ci/ci.jsonnet';
+local javadoc = import 'ci_includes/publish-javadoc.jsonnet';
+local visualizer = import 'visualizer/ci/ci.jsonnet';
+local web_image = import 'web-image/ci/ci.jsonnet';
+
+{
+  ci_resources:: (import 'ci/ci_common/ci-resources.libsonnet'),
+  overlay: graal_common.ci.overlay,
+  specVersion: '7',
+  tierConfig: {
+    tier1: 'gate',
+    tier2: 'gate',
+    tier3: 'gate',
+    tier4: 'post-merge',
+  },
+  builds: [common.add_excludes_guard(common.with_style_component(b)) for b in (
+    common.with_components(compiler.builds, ['compiler']) +
+    common.with_components(wasm.builds, ['wasm']) +
+    common.with_components(espresso.builds, ['espresso']) +
+    common.with_components(regex.builds, ['regex']) +
+    common.with_components(sdk.builds, ['sdk']) +
+    common.with_components(substratevm.builds, ['svm']) +
+    common.with_components(sulong.builds, ['sulong']) +
+    common.with_components(tools.builds, ['tools']) +
+    common.with_components(truffle.builds, ['truffle']) +
+    common.with_components(javadoc.builds, ['javadoc']) +
+    common.with_components(visualizer.builds, ['visualizer']) +
+    common.with_components(web_image.builds, ['webimage'])
+  )],
+  assert (import 'ci/ci_common/run-spec-demo.jsonnet').check(),
+}
addedtests/realworld/entry-loki.jsonnetdiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/entry-loki.jsonnet
@@ -0,0 +1,30 @@
+local loki = import 'loki/loki.libsonnet';
+
+loki {
+  _config+:: {
+    namespace: 'loki',
+    cluster: 'loki-bench',
+    storage_backend: 's3',
+    s3_address: 's3.example.com',
+    s3_bucket_name: 'loki-bench',
+    s3_access_key: 'AKIA',
+    s3_secret_access_key: 'SECRET',
+    boltdb_shipper_shared_store: 's3',
+
+    using_boltdb_shipper: false,
+    using_tsdb_shipper: true,
+    use_index_gateway: true,
+
+    loki+: {
+      schema_config+: {
+        configs: [{
+          from: '2024-01-01',
+          store: 'tsdb',
+          object_store: 's3',
+          schema: 'v13',
+          index: { prefix: 'loki_index_', period: '24h' },
+        }],
+      },
+    },
+  },
+}
addedtests/realworld/entry-mimir.jsonnetdiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/entry-mimir.jsonnet
@@ -0,0 +1,14 @@
+local mimir = import 'mimir/mimir.libsonnet';
+
+mimir {
+  _config+:: {
+    namespace: 'mimir',
+    cluster: 'mimir-bench',
+    external_url: 'http://mimir.example.com',
+
+    storage_backend: 'gcs',
+    blocks_storage_bucket_name: 'mimir-blocks',
+    ruler_storage_bucket_name: 'mimir-ruler',
+    alertmanager_storage_bucket_name: 'mimir-alertmanager',
+  },
+}
addedtests/realworld/entry-tempo.jsonnetdiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/entry-tempo.jsonnet
@@ -0,0 +1,36 @@
+local tempo = import 'microservices/tempo.libsonnet';
+
+tempo {
+  _images+:: {
+    tempo: 'grafana/tempo:latest',
+    tempo_vulture: 'grafana/tempo-vulture:latest',
+    tempo_query: 'grafana/tempo-query:latest',
+  },
+
+  _config+:: {
+    namespace: 'tracing',
+    distributor+: {
+      receivers: {
+        otlp: { protocols: { grpc: { endpoint: '0.0.0.0:4317' } } },
+      },
+    },
+    metrics_generator+: {
+      pvc_size: '10Gi',
+      pvc_storage_class: 'fast',
+      ephemeral_storage_request_size: '10Gi',
+      ephemeral_storage_limit_size: '11Gi',
+    },
+    live_store+: {
+      pvc_size: '10Gi',
+      pvc_storage_class: 'fast',
+    },
+    backend_scheduler+: {
+      pvc_size: '200Mi',
+      pvc_storage_class: 'fast',
+    },
+    backend: 'gcs',
+    bucket: 'tempo-bench',
+    kafka_address: 'kafka:9092',
+    kafka_topic: 'tempo',
+  },
+}
addedtests/realworld/jsonnetfile.jsondiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/jsonnetfile.json
@@ -0,0 +1,52 @@
+{
+  "version": 1,
+  "dependencies": [
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus-operator/kube-prometheus"
+        }
+      }
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/oracle/graal"
+        }
+      }
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/loki",
+          "subdir": "production/ksonnet/loki"
+        }
+      }
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/mimir",
+          "subdir": "operations/mimir"
+        }
+      }
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/tempo",
+          "subdir": "operations/jsonnet/microservices"
+        }
+      }
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://gitlab.com/gitlab-com/runbooks"
+        }
+      },
+      "version": "c4082c94065b1b6a521eed59ed624478131cd9c0"
+    }
+  ],
+  "legacyImports": true
+}
addedtests/realworld/jsonnetfile.lock.jsondiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/jsonnetfile.lock.json
@@ -0,0 +1,341 @@
+{
+  "version": 1,
+  "dependencies": [
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus-operator/kube-prometheus"
+        }
+      },
+      "version": "392c6c5e8e83c9a0f76355d4b0837dccf76ad7ea"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "mixin-utils"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/brancz/kubernetes-grafana",
+          "subdir": "grafana"
+        }
+      },
+      "version": "5698c8940b6dadca3f42107b7839557bc041761f"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/grafonnet-lib.git",
+          "subdir": "grafonnet"
+        }
+      },
+      "version": "a1d61cce1da59c71409b99b5c7568511fec661ea"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/grafana",
+          "subdir": "grafana-mixin"
+        }
+      },
+      "version": "278a9c4cb758a546229e2b408def7e3dcb5f4ec0",
+      "name": "grafana-mixin"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/etcd-io/etcd",
+          "subdir": "contrib/mixin"
+        }
+      },
+      "version": "0cbc031e7f224102bd1ec42a81f659a2b8c3350c"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/grafonnet.git",
+          "subdir": "gen/grafonnet-v10.0.0"
+        }
+      },
+      "version": "7380c9c64fb973f34c3ec46265621a2b0dee0058"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/jsonnet-libs/docsonnet.git",
+          "subdir": "doc-util"
+        }
+      },
+      "version": "bf6f08ae02a51c48bdcec4629b1c1a5a62c6f803"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/jsonnet-libs/xtd.git"
+        }
+      },
+      "version": "4d7f8cb24d613430799f9d56809cc6964f35cea9"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus-operator/prometheus-operator",
+          "subdir": "jsonnet/prometheus-operator"
+        }
+      },
+      "version": "288f0ae3f4ef14e3c75078cbd7dfe1857c3fb066"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus-operator/prometheus-operator",
+          "subdir": "jsonnet/mixin"
+        }
+      },
+      "version": "288f0ae3f4ef14e3c75078cbd7dfe1857c3fb066",
+      "name": "prometheus-operator-mixin"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/kubernetes-monitoring/kubernetes-mixin"
+        }
+      },
+      "version": "acd544dbd02ebce1e000abe006df6d2e4ac1438e"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/grafonnet.git",
+          "subdir": "gen/grafonnet-latest"
+        }
+      },
+      "version": "7380c9c64fb973f34c3ec46265621a2b0dee0058"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/grafonnet.git",
+          "subdir": "gen/grafonnet-v11.4.0"
+        }
+      },
+      "version": "7380c9c64fb973f34c3ec46265621a2b0dee0058"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/kubernetes/kube-state-metrics",
+          "subdir": "jsonnet/kube-state-metrics"
+        }
+      },
+      "version": "cd5430fd1834f43ffd093e3e22c2af1a625dbe2e"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/kubernetes/kube-state-metrics",
+          "subdir": "jsonnet/kube-state-metrics-mixin"
+        }
+      },
+      "version": "cd5430fd1834f43ffd093e3e22c2af1a625dbe2e"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus/node_exporter",
+          "subdir": "docs/node-mixin"
+        }
+      },
+      "version": "d6d0e710bb7daf07a2743fde060f0d5f32c565f3"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus/prometheus",
+          "subdir": "documentation/prometheus-mixin"
+        }
+      },
+      "version": "91c184a899b8e8237cdd08876fba54aa5f9feb6c",
+      "name": "prometheus"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/prometheus/alertmanager",
+          "subdir": "doc/alertmanager-mixin"
+        }
+      },
+      "version": "c85e06d3cd4ba24d003454ee11834404224d7763",
+      "name": "alertmanager"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/pyrra-dev/pyrra.git",
+          "subdir": "jsonnet/controller-gen"
+        }
+      },
+      "version": "25bac00a6c478211326eed4aa46583d1b9466ca8",
+      "name": "pyrra"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/thanos-io/thanos",
+          "subdir": "mixin"
+        }
+      },
+      "version": "cdca5483752e1635d249fbb1271978262775dc1b",
+      "name": "thanos-mixin"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "grafana-builder"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/oracle/graal"
+        }
+      },
+      "version": "d24e4efdac60ee798d7a795cf015f084556c912e"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/loki",
+          "subdir": "production/ksonnet/loki"
+        }
+      },
+      "version": "fe7f43b7f36d8f90931a3bfd35fadc83e1c23d5f"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "consul"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "jaeger-agent-mixin"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "ksonnet-util"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "memcached"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/mimir",
+          "subdir": "operations/mimir"
+        }
+      },
+      "version": "39dd4ffb859d0abb3951d406495bc4bd422600dd"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/rollout-operator.git",
+          "subdir": "operations/rollout-operator"
+        }
+      },
+      "version": "2afe062893496f0554b4764bbe1638f8019832fb"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/jsonnet-libs/keda-libsonnet.git",
+          "subdir": "2.15"
+        }
+      },
+      "version": "dbc8cf1a9847f123d8325378111155fb135983ab",
+      "name": "keda-libsonnet"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/tempo",
+          "subdir": "operations/jsonnet/microservices"
+        }
+      },
+      "version": "f6124c0dea954763dbaa461dcc7b8a89bc8d2635"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
+          "subdir": "1.32"
+        }
+      },
+      "version": "55380470fb7979e6ce0c4316cb9c27a266caf298"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/jsonnet-libs/vertical-pod-autoscaler-libsonnet.git",
+          "subdir": "1.0.0"
+        }
+      },
+      "version": "5d16cd466d12489e6ffba5b17813a0203016e68d"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://gitlab.com/gitlab-com/runbooks"
+        }
+      },
+      "version": "c4082c94065b1b6a521eed59ed624478131cd9c0"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/grafana/jsonnet-libs.git",
+          "subdir": "memcached-mixin"
+        }
+      },
+      "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+    },
+    {
+      "source": {
+        "git": {
+          "remote": "https://github.com/yugui/jsonnetunit.git",
+          "subdir": "jsonnetunit"
+        }
+      },
+      "version": "6927c58cae7624a00f368b977ccc477d4f74071f"
+    }
+  ],
+  "legacyImports": true
+}
addedtests/realworld/k.libsonnetdiffbeforeafterboth
--- /dev/null
+++ b/tests/realworld/k.libsonnet
@@ -0,0 +1 @@
+import '1.32/main.libsonnet'