From 3fb7728b9fa0e30ea7637e44f45b0f357401501f Mon Sep 17 00:00:00 2001 From: Water-Melon Date: Fri, 6 Sep 2024 16:55:30 +0000 Subject: [PATCH] debug --- .github/matrix-commitly.yml | 53 ------------------------------------- build/BUILD.bazel | 19 +++++++------ build/build_system.bzl | 15 +++++++++-- 3 files changed, 24 insertions(+), 63 deletions(-) diff --git a/.github/matrix-commitly.yml b/.github/matrix-commitly.yml index 541eaed6869b..71eb2b00753a 100644 --- a/.github/matrix-commitly.yml +++ b/.github/matrix-commitly.yml @@ -5,49 +5,6 @@ build-packages: # package-type: the nfpm packaging target, //:kong_{package} target; only used when package is rpm # bazel-args: additional bazel build flags # check-manifest-suite: the check manifest suite as defined in scripts/explain_manifest/config.py - -# Ubuntu -- label: ubuntu-20.04 - image: ubuntu:20.04 - package: deb - check-manifest-suite: ubuntu-20.04-amd64 -- label: ubuntu-22.04 - image: ubuntu:22.04 - package: deb - check-manifest-suite: ubuntu-22.04-amd64 -- label: ubuntu-22.04-arm64 - image: ubuntu:22.04 - package: deb - bazel-args: --platforms=//:generic-crossbuild-aarch64 - check-manifest-suite: ubuntu-22.04-arm64 - -# Debian -- label: debian-11 - image: debian:11 - package: deb - check-manifest-suite: debian-11-amd64 -- label: debian-12 - image: debian:12 - package: deb - check-manifest-suite: debian-12-amd64 - -# RHEL -- label: rhel-8 - image: rockylinux:8 - package: rpm - package-type: el8 - check-manifest-suite: el8-amd64 -- label: rhel-9 - image: rockylinux:9 - package: rpm - package-type: el9 - check-manifest-suite: el9-amd64 -- label: rhel-9-arm64 - package: rpm - package-type: el9 - bazel-args: --platforms=//:rhel9-crossbuild-aarch64 --//:brotli=False - check-manifest-suite: el9-arm64 - # Amazon Linux - label: amazonlinux-2 package: rpm @@ -55,16 +12,6 @@ build-packages: check-manifest-suite: amazonlinux-2-amd64 # ada and simdjson don't compile on gcc7.3.1 (needs 7.4) bazel-args: --platforms=//:aws2-crossbuild-x86_64 --//:simdjson=False --//:ada=False -- label: amazonlinux-2023 - image: amazonlinux:2023 - package: rpm - package-type: aws2023 - check-manifest-suite: amazonlinux-2023-amd64 -- label: amazonlinux-2023-arm64 - package: rpm - package-type: aws2023 - bazel-args: --platforms=//:aws2023-crossbuild-aarch64 --//:brotli=False - check-manifest-suite: amazonlinux-2023-arm64 build-images: # Only build images for the latest version of each major release. diff --git a/build/BUILD.bazel b/build/BUILD.bazel index 6b2e872a2406..39f2ec6d0a48 100644 --- a/build/BUILD.bazel +++ b/build/BUILD.bazel @@ -9,6 +9,15 @@ exports_files([ # C libraries +get_clib_deps( + name = "deps_list", + ada_flag = select({ + ":ada_flag": True, + "//conditions:default": False, + }), + output_file = "deps.txt", +) + [ kong_install( name = "install-%s" % get_workspace_name(k), @@ -16,20 +25,14 @@ exports_files([ prefix = "kong/lib" if k in ("@passwdqc", "@snappy", "@ada") else "kong", strip_path = "snappy" if k == "@snappy" else "ada" if k == "@ada" else "", ) - for k in get_clib_deps(select({ - "@kong//:ada_flag": True, - "//conditions:default": False, - })) + for k in ctx.file("deps.txt").read().splitlines() ] kong_rules_group( name = "install-clibs", propagates = [ ":install-%s" % get_workspace_name(k) - for k in get_clib_deps(select({ - "@kong//:ada_flag": True, - "//conditions:default": False, - })) + for k in ctx.file("deps.txt").read().splitlines() ], visibility = ["//visibility:public"], ) diff --git a/build/build_system.bzl b/build/build_system.bzl index 9cf6e3b7d277..64c5420a89f2 100644 --- a/build/build_system.bzl +++ b/build/build_system.bzl @@ -356,12 +356,23 @@ kong_install = rule( def get_workspace_name(label): return label.replace("@", "").split("/")[0] -def get_clib_deps(ada_flag): +def _get_clib_deps_impl(ctx): + ada_flag = ctx.attr.ada_flag base_deps = [ "@openssl", "@libexpat", "@snappy", ] if ada_flag: + print("!!!!!!!!!!!!! " + str(ada_flag)) base_deps.append("@ada") - return base_deps + + ctx.attr.output_file.write("\n".join(base_deps)) + +get_clib_deps = rule( + implementation = _get_clib_deps_impl, + attrs = { + "ada_flag": attr.bool(), + "output_file": attr.output(), + }, +)