bazel_6: Add check to assert GSON serialization works

See https://github.com/NixOS/nixpkgs/issues/273500
This commit is contained in:
Claudio Bley 2024-01-24 12:02:51 +01:00
parent 7cb1b52dbf
commit 6528de1a4f
1 changed files with 7 additions and 0 deletions

View File

@ -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
'';