@@ -11,3 +11,29 @@ TS_DL_DIR ??= "${DL_DIR}"
CCACHE_DISABLE = "1"
export HOSTTOOLS_DIR
+
+BAZEL_DIR ?= "${WORKDIR}/bazel"
+BAZEL_OUTPUTBASE_DIR ?= "${BAZEL_DIR}/output_base"
+BAZEL ?= "${BAZEL_DIR}/bazel"
+
+do_rm_work[prefuncs] += "clean_bazel"
+do_clean[prefuncs] += "clean_bazel"
+clean_bazel() {
+ # Assure to run `rm -rf ${BAZEL_DIR}' could work
+ if [ -d ${BAZEL_DIR} ]; then
+ chmod -R +w ${BAZEL_DIR}
+ fi
+
+ if [ -d ${S} ]; then
+ cd ${S}
+ if [ -e ${BAZEL} ] && [ -e ${S}/bazelrc ]; then
+ ${BAZEL} clean
+ fi
+ fi
+ rm ${BAZEL_DIR} -rf
+}
+
+do_compile:append() {
+ # Assure to run `rm -rf ${BAZEL_DIR}' could work
+ chmod -R +w ${BAZEL_DIR}
+}
@@ -5,8 +5,6 @@ DEPENDS:append:class-target = " python3"
inherit bazel-base
-BAZEL_DIR ?= "${WORKDIR}/bazel"
-BAZEL_OUTPUTBASE_DIR ?= "${BAZEL_DIR}/output_base"
export USER = "unused-bazel-user"
export BAZEL_STARTUP_OPTIONS = "--output_user_root=${BAZEL_DIR}/user_root \
--output_base=${BAZEL_OUTPUTBASE_DIR} \
@@ -14,8 +12,6 @@ export BAZEL_STARTUP_OPTIONS = "--output_user_root=${BAZEL_DIR}/user_root \
--batch \
"
-BAZEL ?= "${BAZEL_DIR}/bazel"
-
do_prepare_recipe_sysroot[postfuncs] += "do_install_bazel"
do_install_bazel() {
mkdir -p ${BAZEL_DIR}
@@ -152,25 +148,4 @@ inherit unsupportarch
export YOCTO_NATIVE_SYSROOT = "${BAZEL_OUTPUTBASE_DIR}/external/yocto_compiler/recipe-sysroot-native"
-do_rm_work[prefuncs] += "clean_bazel"
-do_clean[prefuncs] += "clean_bazel"
-clean_bazel() {
- # Assure to run `rm -rf ${BAZEL_DIR}' could work
- if [ -d ${BAZEL_DIR} ]; then
- chmod -R +w ${BAZEL_DIR}
- fi
-
- if [ -d ${S} ]; then
- cd ${S}
- if [ -e ${BAZEL} ] && [ -e ${S}/bazelrc ]; then
- ${BAZEL} clean
- fi
- fi
- rm ${BAZEL_DIR} -rf
-}
-
-do_compile:append() {
- # Assure to run `rm -rf ${BAZEL_DIR}' could work
- chmod -R +w ${BAZEL_DIR}
-}
do_compile[network] = "1"
@@ -42,7 +42,8 @@ EXTRA_BAZEL_ARGS = " \
do_compile[network] = "1"
do_compile () {
BAZEL_DEV_VERSION_OVERRIDE="7.7.0" \
- TMPDIR="${TMPDIR}/bazel" \
+ BAZEL_WRKDIR="${BAZEL_DIR}" \
+ TMPDIR="${BAZEL_DIR}" \
VERBOSE=yes \
EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS}" \
./compile.sh