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
before · nix/benchmarks.nix
1{2  lib,3  runCommand,4  jsonnet-bundler,5  cacert,6  stdenv,7  fetchFromGitHub,8  go-jsonnet,9  sjsonnet,10  cpp-jsonnet,11  rsjsonnet,12  hyperfine,13  quick ? false,14  jrsonnetVariants,15}:16with lib;17let18  inherit (cpp-jsonnet) jsonnetBench;19  inherit (go-jsonnet) goJsonnetBench;20  graalvmBench = fetchFromGitHub {21    owner = "oracle";22    repo = "graal";23    rev = "bc305df3fe587960f7635f0185571500e5988475";24    hash = "sha256-4EKB1b2o4/qtYQ+nqbbs621OJrtjApsAWEBcw5EjrYc=";25  };26  kubePrometheusBench =27    let28      src = fetchFromGitHub {29        owner = "prometheus-operator";30        repo = "kube-prometheus";31        rev = "d3889807798d1697ea0691f10caf1b6a1997a8bd";32        hash = "sha256-TeYWHzoZAmDp2PzT7EH8XRUcvb3tR8Qfxel7o2QBvIM=";33      };34    in35    runCommand "kube-prometheus-vendor"36      {37        outputHash = "sha256-AGc0dHlD/Ld7I5b1+gOotzJkYrn+bB1VjISdD5NITtw=";38        outputHashMode = "recursive";39        buildInputs = [ cacert ];40      }41      ''42        mkdir -p $out43        cp -r ${src}/* $out/44        cd $out45        chmod u+w jsonnetfile.lock.json46        mkdir vendor47        ${jsonnet-bundler}/bin/jb install48      '';4950  # Removes outsiders from the output51  # Useful when comparing performance of different jrsonnet releases52  skipSlow = if quick then "slow benchmark, but only quick requested" else "";53in54stdenv.mkDerivation {55  name = "benchmarks";56  # __impure = true; # not supported by hercules-ci57  unpackPhase = "true";5859  buildInputs = [60    sjsonnet61    cpp-jsonnet62    rsjsonnet63    go-jsonnet6465    hyperfine66  ];6768  installPhase =69    let70      mkBench =71        {72          name,73          path,74          omitSource ? false,75          pathIsGenerator ? false,76          skipRustAlternative ? "",77          skipScala ? "",78          skipCpp ? "",79          skipGo ? "",80          vendor ? "",81        }:82        ''83          echo >> $out84          echo "=== ${name}" >> $out85          echo >> $out86          ${optionalString (skipRustAlternative != "") ''87            echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out88            echo >> $out89          ''}90          ${optionalString (skipGo != "") ''91            echo "> Note: No results for Go, ${skipGo}" >> $out92            echo >> $out93          ''}94          ${optionalString (skipScala != "") ''95            echo "> Note: No results for Scala (native)/Scala (GraalVM), ${skipScala}" >> $out96            echo >> $out97          ''}98          ${optionalString (skipCpp != "") ''99            echo "> Note: No results for C++, ${skipCpp}" >> $out100            echo >> $out101          ''}102          ${optionalString (!omitSource) ''103            echo ".Source" >> $out104            echo "[%collapsible]" >> $out105            echo "====" >> $out106            echo "[source,jsonnet]" >> $out107            echo "----" >> $out108            ${optionalString pathIsGenerator "echo \"// Generator source\" >> $out"}109            cat ${path} >> $out110            echo >> $out111            echo "----" >> $out112            echo "====" >> $out113            echo >> $out114          ''}115          path=${path}116          ${optionalString pathIsGenerator ''117            go-jsonnet $path > generated.jsonnet118            path=generated.jsonnet119          ''}120          hyperfine -N -w4 -m20 --output=pipe --style=basic --export-asciidoc result.adoc \121            ${122              concatStringsSep " " (123                forEach jrsonnetVariants (124                  variant:125                  "\"${variant.drv}/bin/jrsonnet $path${optionalString (vendor != "") " -J${vendor}"}\" -n \"Rust${126                    if variant.name != "" then " (${variant.name})" else ""127                  }\""128                )129              )130            } \131            ${132              optionalString (skipRustAlternative == "")133                "\"rsjsonnet $path${134                  optionalString (vendor != "") " -J ${vendor}"135                }\" -n \"Rust (alternative, rsjsonnet)\""136            } \137            ${138              optionalString (skipGo == "")139                "\"go-jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Go\""140            } \141            ${142              optionalString (skipScala == "")143                "\"sjsonnet-native $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (native)\""144            } \145            ${146              # My aarch64-linux machine can't run graalvm image:147              # The current machine does not support all of the following CPU features that are required by the image: [FP, ASIMD, CRC32, LSE].148              optionalString (skipScala == "" && stdenv.hostPlatform.system != "aarch64-linux")149                "\"sjsonnet-graalvm $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (GraalVM)\""150            } \151            ${optionalString (skipCpp == "")152              "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""153            }154          cat result.adoc >> $out155        '';156    in157    ''158      set -oux159      ulimit -s unlimited160161      temp=$(mktemp -d)162      cd $temp163164      touch $out165      ${optionalString (true) ''166        cat ${./benchmarks.adoc} >> $out167        echo >> $out168169        echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2 | xargs), $(grep -c '^processor' /proc/cpuinfo) threads" >> $out170        echo >> $out171172        echo ".Tested versions" >> $out173        echo "[%collapsible]" >> $out174        echo "====" >> $out175        echo "* Go: $(go-jsonnet --version)" >> $out176        echo "* C++: $(jsonnet --version)" >> $out177        echo "* Scala (native/GraalVM): $(sjsonnet-native 2>&1 | grep -oP 'Sjsonnet \S+')" >> $out178        echo "* Rust (alternative): rsjsonnet ${rsjsonnet.version} (${rsjsonnet.src.rev})" >> $out179        ${concatStringsSep "\n" (180          forEach jrsonnetVariants (181            variant:182            "echo \"* Rust${183              if variant.name != "" then " (${variant.name})" else ""184            }: $(${variant.drv}/bin/jrsonnet --version 2>&1)\" >> $out"185          )186        )}187        echo "====" >> $out188        echo >> $out189      ''}190      echo "== Real world" >> $out191      ${mkBench {192        name = "Graalvm CI";193        path = "${graalvmBench}/ci.jsonnet";194        omitSource = true;195        skipCpp = "takes longer than a hour";196        skipGo = skipSlow;197      }}198      ${mkBench {199        name = "Kube-prometheus manifests";200        vendor = "${kubePrometheusBench}/vendor";201        path = "${kubePrometheusBench}/example.jsonnet";202        omitSource = true;203        skipCpp = "too slow, takes hours, skews results";204        skipGo = skipSlow;205      }}206207      echo >> $out208      echo "== Benchmarks from C++ jsonnet (/perf_tests)" >> $out209      ${mkBench {210        name = "Large string join";211        path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";212      }}213      ${mkBench {214        name = "Large string template";215        omitSource = true;216        path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";217        skipGo = "fails with os stack size exhausion";218        skipCpp = "too slow, takes hours, skews results";219      }}220      ${mkBench {221        name = "Realistic 1";222        path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";223        skipGo = skipSlow;224        skipCpp = "too slow, takes hours, skews results";225      }}226      ${mkBench {227        name = "Realistic 2";228        path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";229        skipGo = skipSlow;230        skipCpp = "too slow, takes hours, skews results";231      }}232233      echo >> $out234      echo "== Benchmarks from C++ jsonnet (/benchmarks)" >> $out235      ${mkBench {236        name = "Tail call";237        path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";238      }}239      ${mkBench {240        name = "Inheritance recursion";241        path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";242        skipCpp = skipSlow;243        skipGo = skipSlow;244      }}245      ${mkBench {246        name = "Simple recursive call";247        path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";248        skipGo = skipSlow;249      }}250      ${mkBench {251        name = "Foldl string concat";252        path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";253        skipCpp = skipSlow;254      }}255      ${mkBench {256        name = "Array sorts";257        path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";258        skipCpp = skipSlow;259      }}260      ${mkBench {261        name = "Lazy array";262        path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";263        skipGo = skipSlow;264      }}265      ${mkBench {266        name = "Inheritance function recursion";267        path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";268        skipCpp = skipSlow;269      }}270      ${mkBench {271        name = "String strips";272        path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";273        skipCpp = "too slow, takes hours, skews results";274      }}275      ${mkBench {276        name = "Big object";277        path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";278        pathIsGenerator = true;279      }}280281      echo >> $out282      echo "== Benchmarks from Go jsonnet (builtins)" >> $out283      ${mkBench {284        name = "std.base64";285        path = "${goJsonnetBench}/base64.jsonnet";286        skipRustAlternative = skipSlow;287        skipCpp = "too slow, takes hours, skews results";288      }}289      ${mkBench {290        name = "std.base64Decode";291        path = "${goJsonnetBench}/base64Decode.jsonnet";292        skipRustAlternative = skipSlow;293        skipCpp = skipSlow;294      }}295      ${mkBench {296        name = "std.base64DecodeBytes";297        path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";298        skipRustAlternative = skipSlow;299        skipCpp = skipSlow;300        skipGo = skipSlow;301      }}302      ${mkBench {303        name = "std.base64 (byte array)";304        path = "${goJsonnetBench}/base64_byte_array.jsonnet";305        skipRustAlternative = skipSlow;306        skipCpp = skipSlow;307        skipGo = skipSlow;308      }}309      ${mkBench {310        name = "std.foldl";311        path = "${goJsonnetBench}/foldl.jsonnet";312      }}313      ${mkBench {314        name = "std.manifestJsonEx";315        path = "${goJsonnetBench}/manifestJsonEx.jsonnet";316        skipCpp = skipSlow;317      }}318      ${mkBench {319        name = "std.manifestTomlEx";320        path = "${goJsonnetBench}/manifestTomlEx.jsonnet";321        skipCpp = skipSlow;322      }}323      ${mkBench {324        name = "std.parseInt";325        path = "${goJsonnetBench}/parseInt.jsonnet";326        skipCpp = skipSlow;327      }}328      ${mkBench {329        name = "std.reverse";330        path = "${goJsonnetBench}/reverse.jsonnet";331        skipCpp = skipSlow;332        skipGo = skipSlow;333      }}334      ${mkBench {335        name = "std.substr";336        path = "${goJsonnetBench}/substr.jsonnet";337      }}338      ${mkBench {339        name = "Comparsion for array";340        path = "${goJsonnetBench}/comparison.jsonnet";341        skipCpp = "too slow, takes hours, skews results";342      }}343      ${mkBench {344        name = "Comparsion for primitives";345        path = "${goJsonnetBench}/comparison2.jsonnet";346        skipRustAlternative = skipSlow;347        skipCpp = "can't run: uses up to 192GB of RAM";348        skipGo = skipSlow;349      }}350    '';351}
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'