From 6528de1a4f140a62612c939356c7820d445e03e1 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 24 Jan 2024 12:02:51 +0100 Subject: [PATCH] bazel_6: Add check to assert GSON serialization works See https://github.com/NixOS/nixpkgs/issues/273500 --- .../tools/build-managers/bazel/bazel_6/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix index 8f775dd056a35..7de1ee8e072fa 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix @@ -678,6 +678,13 @@ stdenv.mkDerivation rec { # second call succeeds because it defers to $out/bin/bazel-{version}-{os_arch} hello_test + ## Test that the GSON serialisation files are present + gson_classes=$(unzip -l $($out/bin/bazel info install_base)/A-server.jar | grep -F -c _GsonTypeAdapter.class) + if [ "$gson_classes" -lt 10 ]; then + echo "Missing GsonTypeAdapter classes in A-server.jar. Lockfile generation will not work" + exit 1 + fi + runHook postInstall '';