diff --git a/Makefile b/Makefile index 77a0ce04ca..9470ce4780 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,8 @@ endif BAZEL_COMMON_FLAGS=\ --announce_rc \ --features=swift.use_global_module_cache \ + --features=swift.split_derived_files_generation \ + --features=swift.skip_function_bodies_for_derived_files BAZEL_DEBUG_FLAGS=\ --features=swift.enable_batch_mode \ diff --git a/WORKSPACE b/WORKSPACE index 069a35c57e..2629621a6d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,4 +1,4 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") http_archive( name = "com_google_protobuf", @@ -50,3 +50,9 @@ apple_support_dependencies() load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() + +http_file( + name = "cmake_tar_gz", + urls = ["https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-Darwin-x86_64.tar.gz"], + sha256 = "9d27049660474cf134ab46fa0e0db771b263313fcb8ba82ee8b2d1a1a62f8f20", +) diff --git a/build-system/bazel-rules/apple_support b/build-system/bazel-rules/apple_support index b8755bd288..2583fa0bfd 160000 --- a/build-system/bazel-rules/apple_support +++ b/build-system/bazel-rules/apple_support @@ -1 +1 @@ -Subproject commit b8755bd2884d6bf651827c30e00bd0ea318e41a2 +Subproject commit 2583fa0bfd6909e7936da5b30e3547ba13e198dc diff --git a/build-system/bazel-rules/rules_apple b/build-system/bazel-rules/rules_apple index d6f9a87d70..f3434dcd7e 160000 --- a/build-system/bazel-rules/rules_apple +++ b/build-system/bazel-rules/rules_apple @@ -1 +1 @@ -Subproject commit d6f9a87d70781e92b95b9344c7d21d921ccc3ae2 +Subproject commit f3434dcd7e1dd033231143078b8540ae1b754286 diff --git a/build-system/bazel-rules/rules_swift b/build-system/bazel-rules/rules_swift index 44e8c29afe..dcc5235294 160000 --- a/build-system/bazel-rules/rules_swift +++ b/build-system/bazel-rules/rules_swift @@ -1 +1 @@ -Subproject commit 44e8c29afe3baa7f5fc434f4a7e83f7ac786644e +Subproject commit dcc52352949d5ccf184f5d202aa5084957b0e103 diff --git a/third-party/cmake/BUCK b/third-party/cmake/BUCK deleted file mode 100644 index 99d7db5a9f..0000000000 --- a/third-party/cmake/BUCK +++ /dev/null @@ -1,21 +0,0 @@ - -genrule( - name = "cmake", - srcs = [ - "cmake-3.16.0.tar.gz", - ], - bash = -""" - core_count="`sysctl -n hw.logicalcpu`" - mkdir -p "$OUT" - tar -xzf "$SRCDIR/cmake-3.16.0.tar.gz" --directory "$OUT" - pushd "$OUT/cmake-3.16.0" - ./bootstrap --parallel=$core_count -- -DCMAKE_BUILD_TYPE:STRING=Release - make -j $core_count - popd -""", - out = "cmake", - visibility = [ - "PUBLIC", - ] -) diff --git a/third-party/cmake/BUILD b/third-party/cmake/BUILD deleted file mode 100644 index 2bebb90f22..0000000000 --- a/third-party/cmake/BUILD +++ /dev/null @@ -1,32 +0,0 @@ - -genrule( - name = "cmake", - srcs = [ - "cmake-3.16.0.tar.gz", - ], - cmd_bash = -""" - BUILD_DIR="$(RULEDIR)/build" - rm -rf "$$BUILD_DIR" - mkdir -p "$$BUILD_DIR" - tar -xzf "$(location cmake-3.16.0.tar.gz)" --directory "$$BUILD_DIR" - - pushd "$$BUILD_DIR/cmake-3.16.0" - - export PATH=/usr/bin:/bin:/usr/sbin:/sbin - - core_count="`sysctl -n hw.logicalcpu`" - ./bootstrap --parallel=$$core_count -- -DCMAKE_BUILD_TYPE:STRING=Release - make -j $$core_count - - popd - - tar -cf "$(location cmake.tar)" -C "$$BUILD_DIR/cmake-3.16.0" . -""", - outs = [ - "cmake.tar", - ], - visibility = [ - "//visibility:public", - ] -) diff --git a/third-party/cmake/cmake-3.16.0.tar.gz b/third-party/cmake/cmake-3.16.0.tar.gz deleted file mode 100644 index af3e739dab..0000000000 Binary files a/third-party/cmake/cmake-3.16.0.tar.gz and /dev/null differ diff --git a/third-party/mozjpeg/BUILD b/third-party/mozjpeg/BUILD index 76dd224534..21b69c34c4 100644 --- a/third-party/mozjpeg/BUILD +++ b/third-party/mozjpeg/BUILD @@ -22,6 +22,7 @@ genrule( srcs = [ "build-mozjpeg-bazel.sh", ":mozjpeg_sources", + "@cmake_tar_gz//file", ], cmd_bash = """ @@ -44,7 +45,7 @@ genrule( CMAKE_DIR="$$(pwd)/$$BUILD_DIR/cmake" rm -rf "$$CMAKE_DIR" mkdir -p "$$CMAKE_DIR" - tar -xf "$(location //third-party/cmake:cmake.tar)" -C "$$CMAKE_DIR" + tar -xzf "$(location @cmake_tar_gz//file)" -C "$$CMAKE_DIR" cp $(location :build-mozjpeg-bazel.sh) "$$BUILD_DIR/" @@ -54,7 +55,7 @@ genrule( mkdir -p "$$BUILD_DIR/Public/mozjpeg" - PATH="$$PATH:$$CMAKE_DIR/bin" sh $$BUILD_DIR/build-mozjpeg-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/mozjpeg" "$$BUILD_DIR" + PATH="$$PATH:$$CMAKE_DIR/cmake-3.18.4-Darwin-x86_64/CMake.app/Contents/bin" sh $$BUILD_DIR/build-mozjpeg-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/mozjpeg" "$$BUILD_DIR" """ + "\n".join([ "cp -f \"$$BUILD_DIR/mozjpeg/{}\" \"$(location Public/mozjpeg/{})\"".format(header, header) for header in headers @@ -67,9 +68,6 @@ genrule( outs = ["Public/mozjpeg/" + x for x in headers] + ["Public/mozjpeg/jconfig.h"] + ["Public/mozjpeg/lib/lib{}.a".format(x) for x in libs], - tools = [ - "//third-party/cmake:cmake.tar", - ], visibility = [ "//visibility:public", ] diff --git a/third-party/yasm/BUILD b/third-party/yasm/BUILD index 79abf15e3a..8e3e654a39 100644 --- a/third-party/yasm/BUILD +++ b/third-party/yasm/BUILD @@ -1,8 +1,10 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") genrule( name = "yasm", srcs = [ "yasm-1.3.0.tar.gz", + "@cmake_tar_gz//file", ], cmd_bash = """ @@ -15,21 +17,18 @@ set -x CMAKE_DIR="$$(pwd)/$$BUILD_DIR/cmake" rm -rf "$$CMAKE_DIR" mkdir -p "$$CMAKE_DIR" - tar -xf "$(location //third-party/cmake:cmake.tar)" -C "$$CMAKE_DIR" + tar -xf "$(location @cmake_tar_gz//file)" -C "$$CMAKE_DIR" tar -xzf "$(location yasm-1.3.0.tar.gz)" --directory "$$BUILD_DIR" pushd "$$BUILD_DIR/yasm-1.3.0" mkdir build cd build - PATH="$$PATH:$$CMAKE_DIR/bin" cmake .. -DYASM_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + PATH="$$PATH:$$CMAKE_DIR/cmake-3.18.4-Darwin-x86_64/CMake.app/Contents/bin" cmake .. -DYASM_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF make -j $$core_count popd tar -cf "$(location yasm.tar)" -C "$$BUILD_DIR/yasm-1.3.0/build" . """, - tools = [ - "//third-party/cmake:cmake.tar", - ], outs = [ "yasm.tar", ],