From d05926c8c57e1570b36552b0b8da6c00d1c13b52 Mon Sep 17 00:00:00 2001 From: Wangchong Zhou Date: Wed, 24 Apr 2024 14:51:00 +0800 Subject: [PATCH] chore(deps): bump rules_foreign_cc from 0.9.0 to 0.12.0 --- WORKSPACE | 15 +++++++++++--- build/README.md | 2 -- build/kong_bindings.bzl | 7 ------- build/luarocks/BUILD.luarocks.bazel | 4 ++-- build/openresty/BUILD.openresty.bazel | 28 +++++++++++++-------------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 33f7ac614fa3b..c8e0051453082 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -13,11 +13,20 @@ http_archive( load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() +http_archive( + name = "bazel_features", + sha256 = "ba1282c1aa1d1fffdcf994ab32131d7c7551a9bc960fbf05f42d55a1b930cbfb", + strip_prefix = "bazel_features-1.15.0", + url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.15.0/bazel_features-v1.15.0.tar.gz", +) +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + http_archive( name = "rules_foreign_cc", - sha256 = "2a4d07cd64b0719b39a7c12218a3e507672b82a97b98c6a89d38565894cf7c51", - strip_prefix = "rules_foreign_cc-0.9.0", - url = "https://github.com/bazelbuild/rules_foreign_cc/archive/refs/tags/0.9.0.tar.gz", + sha256 = "a2e6fb56e649c1ee79703e99aa0c9d13c6cc53c8d7a0cbb8797ab2888bbc99a3", + strip_prefix = "rules_foreign_cc-0.12.0", + url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.12.0/rules_foreign_cc-0.12.0.tar.gz", ) load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") # This sets up some common toolchains for building targets. For more details, please see diff --git a/build/README.md b/build/README.md index b3d224d1aa7e6..efc53e874c5e7 100644 --- a/build/README.md +++ b/build/README.md @@ -24,8 +24,6 @@ The build system requires the following tools to be installed: # check bazel version bazel version ``` -- [Python](https://www.python.org/), Python 3 is used to build some of the dependencies. Note: build system relies on `python` - in the PATH; if you have `python3` you need to create a symlink from `python` to `python3` - [Build dependencies](https://github.com/Kong/kong/blob/master/DEVELOPER.md#build-and-install-from-source) **Note**: Bazel relies on logged user to create the temporary file system; however if your username contains `@` diff --git a/build/kong_bindings.bzl b/build/kong_bindings.bzl index fa23119d27049..c05e98242c6c1 100644 --- a/build/kong_bindings.bzl +++ b/build/kong_bindings.bzl @@ -80,13 +80,6 @@ def _check_sanity(ctx): "The following command is useful to check if Xcode is picked up by Bazel:\n" + "eval `find /private/var/tmp/_bazel_*/|grep xcode-locator|head -n1`") - python = ctx.execute(["which", "python"]).stdout.strip() - if not python: - fail("rules_foreign_cc hasn't migrated to python3 on macOS yet, and your system doens't \n" + - "have a `python` binary. Consider create a symlink to `python3` and include in PATH:\n" + - "ln -s `which python3` /usr/local/bin/python\n" + - "export PATH=/usr/local/bin:$PATH bazel build \n") - user = ctx.os.environ.get("USER", "") if "@" in user: fail("Bazel uses $USER in cache and rule_foreign_cc uses `@` in its sed command.\n" + diff --git a/build/luarocks/BUILD.luarocks.bazel b/build/luarocks/BUILD.luarocks.bazel index d4d5c67c4d4b1..d5159513189a3 100644 --- a/build/luarocks/BUILD.luarocks.bazel +++ b/build/luarocks/BUILD.luarocks.bazel @@ -19,8 +19,8 @@ configure_make( configure_in_place = True, configure_options = [ "--lua-suffix=jit", - "--with-lua=$$EXT_BUILD_DEPS$$/luajit", - "--with-lua-include=$$EXT_BUILD_DEPS$$/luajit/include/luajit-2.1", + "--with-lua=$$EXT_BUILD_DEPS/luajit", + "--with-lua-include=$$EXT_BUILD_DEPS/luajit/include/luajit-2.1", ], lib_source = ":all_srcs", out_bin_dir = "", diff --git a/build/openresty/BUILD.openresty.bazel b/build/openresty/BUILD.openresty.bazel index 700ebe22d7fd4..40db5a07fc330 100644 --- a/build/openresty/BUILD.openresty.bazel +++ b/build/openresty/BUILD.openresty.bazel @@ -144,14 +144,14 @@ CONFIGURE_OPTIONS = [ "--without-http_redis_module", "--without-http_rds_json_module", "--without-http_rds_csv_module", - "--with-luajit=$$EXT_BUILD_DEPS$$/luajit", - "--with-cc-opt=\"-I$$EXT_BUILD_DEPS$$/pcre/include\"", - "--with-cc-opt=\"-I$$EXT_BUILD_DEPS$$/openssl/include\"", - "--with-cc-opt=\"-I$$EXT_BUILD_DEPS$$/luajit/include\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/pcre/lib\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/openssl/lib\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/luajit/lib\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/lib\"", + "--with-luajit=$$EXT_BUILD_DEPS/luajit", + "--with-cc-opt=\"-I$$EXT_BUILD_DEPS/pcre/include\"", + "--with-cc-opt=\"-I$$EXT_BUILD_DEPS/openssl/include\"", + "--with-cc-opt=\"-I$$EXT_BUILD_DEPS/luajit/include\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/pcre/lib\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/openssl/lib\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/luajit/lib\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/lib\"", # Here let's try not having --disable-new-dtags; --disable-new-dtags creates rpath instead of runpath # note rpath can't handle indirect dependency (nginx -> luajit -> dlopen("other")), so each indirect # dependency should have its rpath set (luajit, libxslt etc); on the other side, rpath is not @@ -201,14 +201,14 @@ CONFIGURE_OPTIONS = [ "//conditions:default": [], }) + select({ "@kong//:any-cross": [ - "--with-cc-opt=\"-I$$EXT_BUILD_DEPS$$/zlib/include\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/zlib/lib\"", + "--with-cc-opt=\"-I$$EXT_BUILD_DEPS/zlib/include\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/zlib/lib\"", ], "//conditions:default": [], }) + select({ ":needs-xcrypt2": [ - "--with-cc-opt=\"-I$$EXT_BUILD_DEPS$$/libxcrypt/include\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/libxcrypt/lib\"", + "--with-cc-opt=\"-I$$EXT_BUILD_DEPS/libxcrypt/include\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/libxcrypt/lib\"", ], "//conditions:default": [], }) + select({ @@ -220,8 +220,8 @@ CONFIGURE_OPTIONS = [ "//conditions:default": [], }) + select({ "@kong//:fips_flag": [ - "--with-cc-opt=\"-I$$EXT_BUILD_DEPS$$/include\"", - "--with-ld-opt=\"-L$$EXT_BUILD_DEPS$$/lib -Wl,-Bsymbolic-functions -Wl,-z,relro\"", + "--with-cc-opt=\"-I$$EXT_BUILD_DEPS/include\"", + "--with-ld-opt=\"-L$$EXT_BUILD_DEPS/lib -Wl,-Bsymbolic-functions -Wl,-z,relro\"", ], "//conditions:default": [], }) + select({