Skip to content

Commit

Permalink
Built Make toolchains can now be used in RBE (#548)
Browse files Browse the repository at this point in the history
* Enable more tests for RBE

* Turn off gn build for RBE

* Fix to make_simple example

* Turn off configure_with_bazel_transitive due to an issue with toolchain configuration

* Add CMAKE_MAKE_PROGRAM to generate_args

* Set CMP0074 policy for cmake to use the ZLIB_ROOT entry

* Disable libpng build on rbe

* Disable bison build on RBE

* Disable cmake_android example on RBE

* Fix typo in ZLIB_ROOT

* Reenable libpng build

* Address review comments
  • Loading branch information
jsharpe authored Mar 28, 2021
1 parent 46047ae commit 0379c97
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
10 changes: 2 additions & 8 deletions .bazelci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,10 @@ tasks:
working_directory: examples
rbe_targets: &rbe_targets
- "//..."
# TODO: fix these targets on RBE
- "-//:third_party_examples_linux_tests"
- "//:third_party_examples_linux_rbe_tests"
# Gives error: zipalign: error while loading shared libraries: /usr/local/lib/libc++.so: file too short
- "-//cmake_android/..."
- "-//cmake_defines/..."
- "-//cmake_hello_world_lib/..."
- "-//cmake_with_data/..."
- "-//cmake_with_target/..."
- "-//cmake_working_dir/..."
- "-//configure_with_bazel_transitive/..."
- "-//make_simple/..."
build_targets: *rbe_targets
test_targets: *rbe_targets
macos_examples:
Expand Down
6 changes: 6 additions & 0 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ test_suite(
tests = ["@rules_foreign_cc_examples_third_party//:linux_tests"],
)

test_suite(
name = "third_party_examples_linux_rbe_tests",
tags = ["manual"],
tests = ["@rules_foreign_cc_examples_third_party//:linux_rbe_tests"],
)

test_suite(
name = "third_party_examples_macos_tests",
tags = ["manual"],
Expand Down
1 change: 1 addition & 0 deletions examples/make_simple/code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ default all $(BUILD_DIR)/lib/liba.a: liba.cpp liba.h
ar rcs $(BUILD_DIR)/lib/liba.a $(BUILD_DIR)/lib/liba.o

install: $(BUILD_DIR)/lib/liba.a
mkdir -p $(PREFIX)/lib $(PREFIX)/include
cp -rv $(BUILD_DIR)/lib $(PREFIX)
cp liba.h $(PREFIX)/include
19 changes: 19 additions & 0 deletions examples/third_party/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ test_suite(
],
)

test_suite(
name = "linux_rbe_tests",
tags = ["manual"],
tests = [
# Missing a new enough m4 to build
#"//bison:bison_build_test",
"//cares:test_c_ares",
"//curl:curl_build_test",
# Attempts to access git sha during configure of build so fails
#"//gn:gn_launch_test",
"//libgit2:libgit2_build_test",
"//libpng:test_libpng",
"//libssh2:libssh2_build_test",
"//openssl:openssl_build_test",
"//pcre:pcre_build_test",
],
)


test_suite(
name = "macos_tests",
tags = ["manual"],
Expand Down
3 changes: 2 additions & 1 deletion examples/third_party/libpng/BUILD.libpng.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ filegroup(
cmake(
name = "libpng",
cache_entries = {
"ZLIB_ROOT": "$EXT_BUILD_DEPS/libz",
"CMAKE_POLICY_DEFAULT_CMP0074": "NEW",
"ZLIB_ROOT": "$EXT_BUILD_DEPS/zlib",
},
lib_source = "//:all_srcs",
out_include_dir = "include/libpng16",
Expand Down
4 changes: 2 additions & 2 deletions foreign_cc/cmake.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def _cmake_impl(ctx):
if "Unix Makefiles" == generator:
make_data = get_make_data(ctx)
tools_deps.extend(make_data.deps)
env.update({"CMAKE_MAKE_PROGRAM": make_data.path})
generate_args.append("-DCMAKE_MAKE_PROGRAM={}".format(make_data.path))
elif "Ninja" in generator:
ninja_data = get_ninja_data(ctx)
tools_deps.extend(ninja_data.deps)
env.update({"CMAKE_MAKE_PROGRAM": ninja_data.path})
generate_args.append("-DCMAKE_MAKE_PROGRAM={}".format(ninja_data.path))

attrs = create_attrs(
ctx.attr,
Expand Down

0 comments on commit 0379c97

Please sign in to comment.