2019-07-17 14:28:40 +02:00
|
|
|
#
|
|
|
|
# Copyright (C) 2019 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Notice: this works only with Google's RBE service.
|
|
|
|
ifneq ($(filter-out false,$(USE_RBE)),)
|
|
|
|
ifdef RBE_DIR
|
|
|
|
rbe_dir := $(RBE_DIR)
|
|
|
|
else
|
2020-08-12 07:27:15 +02:00
|
|
|
rbe_dir := prebuilts/remoteexecution-client/live/
|
2019-07-17 14:28:40 +02:00
|
|
|
endif
|
2020-02-05 03:28:48 +01:00
|
|
|
|
2021-09-15 03:31:34 +02:00
|
|
|
ifdef RBE_CXX_POOL
|
|
|
|
cxx_pool := $(RBE_CXX_POOL)
|
|
|
|
else
|
|
|
|
cxx_pool := default
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef RBE_JAVA_POOL
|
|
|
|
java_pool := $(RBE_JAVA_POOL)
|
|
|
|
else
|
|
|
|
java_pool := java16
|
|
|
|
endif
|
|
|
|
|
2020-02-05 03:28:48 +01:00
|
|
|
ifdef RBE_CXX_EXEC_STRATEGY
|
|
|
|
cxx_rbe_exec_strategy := $(RBE_CXX_EXEC_STRATEGY)
|
|
|
|
else
|
2020-08-12 08:04:47 +02:00
|
|
|
cxx_rbe_exec_strategy := local
|
2020-02-05 03:28:48 +01:00
|
|
|
endif
|
|
|
|
|
2020-05-26 20:54:36 +02:00
|
|
|
ifdef RBE_CXX_COMPARE
|
|
|
|
cxx_compare := $(RBE_CXX_COMPARE)
|
|
|
|
else
|
2020-08-12 08:04:47 +02:00
|
|
|
cxx_compare := false
|
2020-05-26 20:54:36 +02:00
|
|
|
endif
|
|
|
|
|
2020-02-05 03:28:48 +01:00
|
|
|
ifdef RBE_JAVAC_EXEC_STRATEGY
|
|
|
|
javac_exec_strategy := $(RBE_JAVAC_EXEC_STRATEGY)
|
|
|
|
else
|
2020-08-12 07:27:15 +02:00
|
|
|
javac_exec_strategy := remote_local_fallback
|
2020-02-05 03:28:48 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef RBE_R8_EXEC_STRATEGY
|
|
|
|
r8_exec_strategy := $(RBE_R8_EXEC_STRATEGY)
|
|
|
|
else
|
2020-08-12 07:27:15 +02:00
|
|
|
r8_exec_strategy := remote_local_fallback
|
2020-02-05 03:28:48 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef RBE_D8_EXEC_STRATEGY
|
|
|
|
d8_exec_strategy := $(RBE_D8_EXEC_STRATEGY)
|
|
|
|
else
|
2020-08-12 07:27:15 +02:00
|
|
|
d8_exec_strategy := remote_local_fallback
|
2020-02-05 03:28:48 +01:00
|
|
|
endif
|
|
|
|
|
2020-08-12 08:04:47 +02:00
|
|
|
platform := container-image=docker://gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62
|
2021-09-15 03:31:34 +02:00
|
|
|
cxx_platform := $(platform),Pool=$(cxx_pool)
|
|
|
|
java_r8_d8_platform := $(platform),Pool=$(java_pool)
|
2020-04-02 21:07:47 +02:00
|
|
|
|
2020-01-27 20:21:24 +01:00
|
|
|
RBE_WRAPPER := $(rbe_dir)/rewrapper
|
2020-10-20 07:52:49 +02:00
|
|
|
RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_allowlist=PWD --exec_strategy=$(cxx_rbe_exec_strategy) --platform=$(cxx_platform) --compare=$(cxx_compare)
|
2019-07-17 14:28:40 +02:00
|
|
|
|
|
|
|
# Append rewrapper to existing *_WRAPPER variables so it's possible to
|
|
|
|
# use both ccache and rewrapper.
|
2020-01-27 20:21:24 +01:00
|
|
|
CC_WRAPPER := $(strip $(CC_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
|
|
|
|
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
|
|
|
|
|
|
|
|
ifdef RBE_JAVAC
|
2020-08-12 08:04:47 +02:00
|
|
|
JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac --exec_strategy=$(javac_exec_strategy) --platform=$(java_r8_d8_platform))
|
2020-01-27 20:21:24 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef RBE_R8
|
2023-01-19 19:00:54 +01:00
|
|
|
R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8 --exec_strategy=$(r8_exec_strategy) --platform=$(java_r8_d8_platform) --inputs=$(OUT_DIR)/host/linux-x86/framework/r8.jar,build/make/core/proguard_basic_keeps.flags --toolchain_inputs=$(firstword $(JAVA)))
|
2020-01-27 20:21:24 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef RBE_D8
|
2023-01-19 19:00:54 +01:00
|
|
|
D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8 --exec_strategy=$(d8_exec_strategy) --platform=$(java_r8_d8_platform) --inputs=$(OUT_DIR)/host/linux-x86/framework/d8.jar --toolchain_inputs=$(firstword $(JAVA)))
|
2020-01-27 20:21:24 +01:00
|
|
|
endif
|
2019-07-17 14:28:40 +02:00
|
|
|
|
|
|
|
rbe_dir :=
|
|
|
|
endif
|
2020-04-02 21:07:47 +02:00
|
|
|
|