Commit Graph

8 Commits

Author SHA1 Message Date
David Ostrovsky a80130d655 Bazel: Fix remote build execution for Java 17
Bazel build and test with remote17 configuration was actually executed
locally, and not remotely.

Rename remote configuration setting for Java 11 from remote to remote11
and derive the common remote configuration settings for remote11 and
remote17 configurations.

Also remove deprecated --host_javabase and --javabase options.

Test Plan:

Verify that the remote build for Java 17 is actually executed remotely:

  $ bazel test --config=remote17 --remote_instance_name=$PROJECT_NAME \
    org.eclipse.jgit.test/...

Change-Id: I10ad8c1d28c92fed9e465c2d36770ed4fb2940c3
2023-05-31 00:31:46 -04:00
Matthias Sohn c6b979444b Rerun flaky tests 3 times
This can help to reduce time spent on rebuilds caused by flaky tests.

Change-Id: I8f7831e470fd8aa065f0b8728f62f39734d05016
2023-03-07 16:39:20 +01:00
David Ostrovsky 75e7d08480 Bazel: Include bazel resource configuration file for RBE build
In I988f61e34 tools/remote-bazelrc was added, but this resource file
wasn't imported from main resource file workspace/.bazelrc.

Change-Id: Ie0c2f128fbccaa6f9e99ad29a3a76ac294f3cd29
2022-01-22 20:43:56 +01:00
David Ostrovsky 969601c742 Bazel: Add RBE support
The Bazel build can be used with Google's Remote Build Execution.

This needs the following setup steps:

  $ gcloud auth application-default login
  $ gcloud services enable remotebuildexecution.googleapis.com  --project=${PROJECT}

Create a worker pool. The instances should have at least 4 CPUs each
for adequate performance.

  $ gcloud alpha remote-build-execution worker-pools create default \
    --project=${PROJECT} \
    --instance=default_instance \
    --worker-count=50 \
    --machine-type=e2-standard-4 \
    --disk-size=200

To use RBE, execute

  $ bazel test --config=remote \
    --remote_instance_name=projects/${PROJECT}/instances/default_instance \
    //...

Change-Id: I988f61e342dab2136d8752ace945a4ed91a4189a
2022-01-20 06:43:13 -04:00
David Ostrovsky be732c16ab Bazel: Switch to using toolchain resolution for java rules
Bump Bazel version to release 5.0.0. In this new Bazel release,
--incompatible_use_toolchain_resolution_for_java_rules is flipped, that
means that the build must be adapted to toolchain resolution.

Specification toolchain resolution for java rules is here: [1]. Main
tracking Bazel issue is here: [2].

Given that new Bazel release also added support for remote JDK 17, add
experimental support for building with remote JDK 17 to produce major
byte code version 61.

Test Plan:

To build with remote JDK 11 run:

  $ bazel build :all

To build with remote JDK 17 run:

  $ bazel build --config java17 :all

[1] https://docs.google.com/document/d/1MVbBxbKVKRJJY7DnkptHpvz7ROhyAYy4a-TZ-n7Q0r4/edit?usp=sharing
[2] https://github.com/bazelbuild/bazel/issues/7849

Change-Id: I8d26dff722c6677ea7642913b61e416b23ea9041
2022-01-20 06:40:51 -04:00
David Ostrovsky d35f0ffb7c Bazel: Add workspace status command to stamp final artifact
Include implementation version in jgit library. This version is used
by other products that depend on JGit, and built using Bazel and not
consume officially released artifact from Central or Eclipse own Maven
repository.

Most notably, in Gerrit Code Review JGit agent that was previously
reported as "unknown", is now reported as:

  JGit/v5.8.0.202006091008-r-16-g14c43828d

using this change [1].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/272505

Change-Id: Ia50de9ac35b8dbe9e92d8ad7d0d14cd00f057863
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2020-07-17 01:10:15 +02:00
David Pursehouse 4c33f70d5a Enable error-prone checks by default
Based on recent work by Dave Borowitz on the Gerrit project [1, 2].

The warnings/error configuration is unchanged, but now the checks are
enabled by default during the build rather than having to be manually
invoked.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/225653
[2] https://gerrit-review.googlesource.com/c/gerrit/+/225714

Change-Id: I7f4849896af72de38880b13d64519cc93bb3d2a3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-26 17:47:08 +09:00
David Ostrovsky a4f5fc1572 Add bazel options to align with gerrit's
Change-Id: I6addd5fcaecb8c2508e1d5776ecfed8ae676b6ed
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2019-05-26 02:44:33 -04:00