aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-06-14 08:06:32 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-14 08:07:45 -0700
commit09222fac7c8851d26e44e087a6beb4ce2ed5dc39 (patch)
treed1d11ad74e6f1058ec6cceb6ac2addf2455753c5 /scripts
parent518568ff79512c0867822aeab0d86a1e2322bd6d (diff)
Introduces a BAZEL_JAVAC_OPTS environment variable to the bootstrap build with empty default value to keep the script behavior unchanged. javac is not given a large enough max heap on Raspberry Pi 3. This change but allows the user to override the setting.
RELNOTES: The BAZEL_JAVAC_OPTS environment variable allows arguments, e.g., "-J-Xmx2g", may be passed to the javac compiler during bootstrap build. This is helpful if your system chooses too small of a max heap size for the Java compiler during the bootstrap build. PiperOrigin-RevId: 200557606
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap/compile.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 1c22e03b49..b8e98cba5b 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -114,9 +114,14 @@ function java_compilation() {
cat "$paramfile" >&2
fi
+ # Use BAZEL_JAVAC_OPTS to pass additional arguments to javac, e.g.,
+ # export BAZEL_JAVAC_OPTS="-J-Xmx2g -J-Xms200m"
+ # Useful if your system chooses too small of a max heap for javac.
+ # We intentionally rely on shell word splitting to allow multiple
+ # additional arguments to be passed to javac.
run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
-d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
- -encoding UTF-8 "@${paramfile}"
+ -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}"
log "Extracting helper classes for $name..."
for f in ${library_jars} ; do