From f21da41a74cbc72a0f2b392d2eed4d7f205b83b9 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.10.1 --- WORKSPACE | 6 +++--- build/README.md | 2 -- build/kong_bindings.bzl | 7 ------- build/luarocks/BUILD.luarocks.bazel | 4 ++-- build/openresty/BUILD.openresty.bazel | 28 +++++++++++++-------------- 5 files changed, 19 insertions(+), 28 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index ae97c320d94e..fa4c08a33491 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -17,9 +17,9 @@ load_bindings(name = "kong_bindings") 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 = "476303bd0f1b04cc311fc258f1708a5f6ef82d3091e53fd1977fa20383425a6a", + strip_prefix = "rules_foreign_cc-0.10.1", + url = "https://github.com/bazelbuild/rules_foreign_cc/archive/refs/tags/0.10.1.tar.gz", ) load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") diff --git a/build/README.md b/build/README.md index 7e795dff7774..0540a5d2df77 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 fa23119d2704..c05e98242c6c 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 d4d5c67c4d4b..d5159513189a 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 9b86a74a25e5..c6b531d02ab7 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,16 +201,16 @@ 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({ # any cross build that migrated to use libxcrypt needs those flags # alpine uses different libc so doesn't need it ":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({ @@ -222,8 +222,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({