diff --git a/m/ml-metadata/ml-metadata_ubi_9.6.sh b/m/ml-metadata/ml-metadata_ubi_9.6.sh index 244419871f..bb644f5c18 100644 --- a/m/ml-metadata/ml-metadata_ubi_9.6.sh +++ b/m/ml-metadata/ml-metadata_ubi_9.6.sh @@ -68,10 +68,6 @@ sed -i '/j2objc/d' WORKSPACE wget https://raw.githubusercontent.com/ppc64le/build-scripts/refs/heads/master/m/ml-metadata/ml_metadata_ubi9.6.patch git apply ml_metadata_ubi9.6.patch --reject || true -#update zetasql hash and strip_prefix to match actual archive -sed -i 's/651a768cd51627f58aa6de7039aba9ddab22f4b0450521169800555269447840/86f81591ab5ec20457a5394eb2c5c981e6f6c89f4c49c211d096c3acffec1eb1/g' WORKSPACE -sed -i 's/strip_prefix = "zetasql-/strip_prefix = "googlesql-/g' WORKSPACE - #set correct PYTHON_LIB_PATH export PYTHON_BIN_PATH=$(which python3.11) export PYTHON_LIB_PATH=$(python3.11 -c "import sysconfig; print(sysconfig.get_path('stdlib'))") @@ -121,4 +117,4 @@ else echo "$PACKAGE_URL $PACKAGE_NAME" echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Build_and_Test_Success" exit 0; -fi \ No newline at end of file +fi diff --git a/m/ml-metadata/ml_metadata_ubi9.6.patch b/m/ml-metadata/ml_metadata_ubi9.6.patch deleted file mode 100644 index d8508b208e..0000000000 --- a/m/ml-metadata/ml_metadata_ubi9.6.patch +++ /dev/null @@ -1,196 +0,0 @@ -diff --git a/WORKSPACE b/WORKSPACE -index 2465151..94eb6fd 100644 ---- a/WORKSPACE -+++ b/WORKSPACE -@@ -9,6 +9,7 @@ http_archive( - workspace_file_content = "//ml_metadata:postgresql.WORKSPACE", - sha256 = "9868c1149a04bae1131533c5cbd1c46f9c077f834f6147abaef8791a7c91b1a1", - strip_prefix = "postgresql-12.1", -+ patches = ["//ml_metadata/third_party:postgresql.patch",], - urls = [ - "https://ftp.postgresql.org/pub/source/v12.1/postgresql-12.1.tar.gz", - ], -@@ -43,17 +44,17 @@ rules_foreign_cc_dependencies() - - http_archive( - name = "com_google_absl", -- urls = ["https://github.com/abseil/abseil-cpp/archive/940c06c25d2953f44310b68eb8aab6114dba11fb.zip"], -- strip_prefix = "abseil-cpp-940c06c25d2953f44310b68eb8aab6114dba11fb", -- sha256 = "0e800799aa64d0b4d354f3ff317bbd5fbf42f3a522ab0456bb749fc8d3b67415", -+ urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.2.zip"], -+ strip_prefix = "abseil-cpp-20230125.2", -+ sha256 = "2d40102022a01c6f3dddd23ec9ddafff49697a2e4bd09af68bccb74d26ecf64a", - ) - - http_archive( - name = "boringssl", -- sha256 = "1188e29000013ed6517168600fc35a010d58c5d321846d6a6dfee74e4c788b45", -- strip_prefix = "boringssl-7f634429a04abc48e2eb041c81c5235816c96514", -+ sha256 = "579cb415458e9f3642da0a39a72f79fdfe6dc9c1713b3a823f1e276681b9703e", -+ strip_prefix = "boringssl-648cbaf033401b7fe7acdce02f275b06a88aab5c", - urls = [ -- "https://github.com/google/boringssl/archive/7f634429a04abc48e2eb041c81c5235816c96514.tar.gz", -+ "https://github.com/google/boringssl/archive/648cbaf033401b7fe7acdce02f275b06a88aab5c.tar.gz", - ], - ) - -@@ -252,7 +253,7 @@ http_archive( - name = "com_google_zetasql", - urls = ["https://github.com/google/zetasql/archive/%s.zip" % ZETASQL_COMMIT], - strip_prefix = "zetasql-%s" % ZETASQL_COMMIT, -- #patches = ["//ml_metadata/third_party:zetasql.patch"], -+ patches = ["//ml_metadata/third_party:zetasql.patch"], - sha256 = '651a768cd51627f58aa6de7039aba9ddab22f4b0450521169800555269447840' - ) - -diff --git a/ml_metadata/third_party/postgresql.patch b/ml_metadata/third_party/postgresql.patch -new file mode 100644 -index 0000000..dd75d88 ---- /dev/null -+++ b/ml_metadata/third_party/postgresql.patch -@@ -0,0 +1,37 @@ -+diff --git src/port/pg_bitutils.c src/port/pg_bitutils.c -+index 7847e8a..17714af 100644 -+--- src/port/pg_bitutils.c -++++ src/port/pg_bitutils.c -+@@ -12,12 +12,14 @@ -+ */ -+ #include "c.h" -+ -++#if !defined(__ppc__) && !defined(__PPC__) && !defined(__ppc64__) && !defined(__PPC64__) -+ #ifdef HAVE__GET_CPUID -+ #include -+ #endif -+ #ifdef HAVE__CPUID -+ #include -+ #endif -++#endif -+ -+ #include "port/pg_bitutils.h" -+ -+@@ -141,6 +143,7 @@ int (*pg_popcount64) (uint64 word) = pg_popcount64_slow; -+ static bool -+ pg_popcount_available(void) -+ { -++#if !defined(__ppc__) && !defined(__PPC__) && !defined(__ppc64__) && !defined(__PPC64__) -+ unsigned int exx[4] = {0, 0, 0, 0}; -+ -+ #if defined(HAVE__GET_CPUID) -+@@ -152,6 +155,9 @@ pg_popcount_available(void) -+ #endif -+ -+ return (exx[2] & (1 << 23)) != 0; /* POPCNT */ -++#else -++ return false; -++#endif -+ } -+ -+ /* -diff --git a/ml_metadata/third_party/zetasql.patch b/ml_metadata/third_party/zetasql.patch -new file mode 100644 -index 0000000..9e54d86 ---- /dev/null -+++ b/ml_metadata/third_party/zetasql.patch -@@ -0,0 +1,102 @@ -+diff --git bazel/m4.patch bazel/m4.patch -+index 544cbaa..c536bdc 100644 -+--- bazel/m4.patch -++++ bazel/m4.patch -+@@ -131,3 +131,97 @@ -+ # else -+ # define USE_SNPRINTF 0 -+ # endif -++diff --git lib/c-stack.c lib/c-stack.c -++index 5353c08..a608fbe 100644 -++--- lib/c-stack.c -+++++ lib/c-stack.c -++@@ -50,16 +50,16 @@ -++ #if ! HAVE_STACK_T && ! defined stack_t -++ typedef struct sigaltstack stack_t; -++ #endif -++-#ifndef SIGSTKSZ -++-# define SIGSTKSZ 16384 -++-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 -++-/* libsigsegv 2.6 through 2.8 have a bug where some architectures use -++- more than the Linux default of an 8k alternate stack when deciding -++- if a fault was caused by stack overflow. */ -++-# undef SIGSTKSZ -++-# define SIGSTKSZ 16384 -++-#endif -++- -+++/* Storage for the alternate signal stack. -+++ * 64 KiB is not too large for Gnulib-using apps, and is large enough -+++ * for all known platforms. Smaller sizes may run into trouble. -+++ * For example, libsigsegv 2.6 through 2.8 have a bug where some -+++ * architectures use more than the Linux default of an 8 KiB alternate -+++ * stack when deciding if a fault was caused by stack overflow. */ -+++static max_align_t alternate_signal_stack[(64 * 1024 -+++ + sizeof (max_align_t) - 1) -+++ / sizeof (max_align_t)]; -+++ -++ #include -++ #include -++ -++@@ -128,18 +128,6 @@ die (int signo) -++ #if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ -++ && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV -++ -++-/* Storage for the alternate signal stack. */ -++-static union -++-{ -++- char buffer[SIGSTKSZ]; -++- -++- /* These other members are for proper alignment. There's no -++- standard way to guarantee stack alignment, but this seems enough -++- in practice. */ -++- long double ld; -++- long l; -++- void *p; -++-} alternate_signal_stack; -++ -++ static void -++ null_action (int signo __attribute__ ((unused))) -++@@ -205,8 +193,8 @@ c_stack_action (void (*action) (int)) -++ -++ /* Always install the overflow handler. */ -++ if (stackoverflow_install_handler (overflow_handler, -++- alternate_signal_stack.buffer, -++- sizeof alternate_signal_stack.buffer)) -+++ alternate_signal_stack, -+++ sizeof alternate_signal_stack)) -++ { -++ errno = ENOTSUP; -++ return -1; -++@@ -279,14 +267,14 @@ c_stack_action (void (*action) (int)) -++ stack_t st; -++ struct sigaction act; -++ st.ss_flags = 0; -+++ st.ss_sp = alternate_signal_stack; -+++ st.ss_size = sizeof alternate_signal_stack; -++ # if SIGALTSTACK_SS_REVERSED -++ /* Irix mistakenly treats ss_sp as the upper bound, rather than -++ lower bound, of the alternate stack. */ -++- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *); -++- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *); -++-# else -++- st.ss_sp = alternate_signal_stack.buffer; -++- st.ss_size = sizeof alternate_signal_stack.buffer; -+++ st.ss_size -= sizeof (void *); -+++ char *ss_sp = st.ss_sp; -+++ st.ss_sp = ss_sp + st.ss_size; -++ # endif -++ r = sigaltstack (&st, NULL); -++ if (r != 0) -++diff --git lib/c-stack.h lib/c-stack.h -++index efd3b8f..df8a790 100644 -++--- lib/c-stack.h -+++++ lib/c-stack.h -++@@ -34,7 +34,7 @@ -++ A null ACTION acts like an action that does nothing. -++ -++ ACTION must be async-signal-safe. ACTION together with its callees -++- must not require more than SIGSTKSZ bytes of stack space. Also, -+++ must not require more than 64 KiB of stack space. Also, -++ ACTION should not call longjmp, because this implementation does -++ not guarantee that it is safe to return to the original stack. -++ diff --git a/m/ml-metadata/ml_metadata_ubi_9.6.patch b/m/ml-metadata/ml_metadata_ubi_9.6.patch new file mode 100644 index 0000000000..cae406dbc4 --- /dev/null +++ b/m/ml-metadata/ml_metadata_ubi_9.6.patch @@ -0,0 +1,80 @@ +diff --git a/WORKSPACE b/WORKSPACE +index 683cc7e..f66294d 100644 +--- a/WORKSPACE ++++ b/WORKSPACE +@@ -8,6 +8,7 @@ http_archive( + build_file = "//ml_metadata:postgresql.BUILD", + workspace_file_content = "//ml_metadata:postgresql.WORKSPACE", + sha256 = "9868c1149a04bae1131533c5cbd1c46f9c077f834f6147abaef8791a7c91b1a1", ++ patches = ["//ml_metadata/third_party:postgresql.patch",], + strip_prefix = "postgresql-12.1", + urls = [ + "https://ftp.postgresql.org/pub/source/v12.1/postgresql-12.1.tar.gz", +@@ -38,17 +39,17 @@ rules_foreign_cc_dependencies() + + http_archive( + name = "com_google_absl", +- urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz"], +- strip_prefix = "abseil-cpp-20230802.1", +- sha256 = "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed", ++ urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.2.zip"], ++ strip_prefix = "abseil-cpp-20230125.2", ++ sha256 = "2d40102022a01c6f3dddd23ec9ddafff49697a2e4bd09af68bccb74d26ecf64a", + ) + + http_archive( + name = "boringssl", +- sha256 = "1188e29000013ed6517168600fc35a010d58c5d321846d6a6dfee74e4c788b45", +- strip_prefix = "boringssl-7f634429a04abc48e2eb041c81c5235816c96514", ++ sha256 = "579cb415458e9f3642da0a39a72f79fdfe6dc9c1713b3a823f1e276681b9703e", ++ strip_prefix = "boringssl-648cbaf033401b7fe7acdce02f275b06a88aab5c", + urls = [ +- "https://github.com/google/boringssl/archive/7f634429a04abc48e2eb041c81c5235816c96514.tar.gz", ++ "https://github.com/google/boringssl/archive/648cbaf033401b7fe7acdce02f275b06a88aab5c.tar.gz", + ], + ) + +diff --git a/ml_metadata/third_party/postgresql.patch b/ml_metadata/third_party/postgresql.patch +new file mode 100644 +index 0000000..351b306 +--- /dev/null ++++ b/ml_metadata/third_party/postgresql.patch +@@ -0,0 +1,37 @@ +++diff --git src/port/pg_bitutils.c src/port/pg_bitutils.c +++index 7847e8a..17714af 100644 +++--- src/port/pg_bitutils.c ++++++ src/port/pg_bitutils.c +++@@ -12,12 +12,14 @@ +++ */ +++ #include "c.h" +++ ++++#if !defined(__ppc__) && !defined(__PPC__) && !defined(__ppc64__) && !defined(__PPC64__) +++ #ifdef HAVE__GET_CPUID +++ #include +++ #endif +++ #ifdef HAVE__CPUID +++ #include +++ #endif ++++#endif +++ +++ #include "port/pg_bitutils.h" +++ +++@@ -141,6 +143,7 @@ int (*pg_popcount64) (uint64 word) = pg_popcount64_slow; +++ static bool +++ pg_popcount_available(void) +++ { ++++#if !defined(__ppc__) && !defined(__PPC__) && !defined(__ppc64__) && !defined(__PPC64__) +++ unsigned int exx[4] = {0, 0, 0, 0}; +++ +++ #if defined(HAVE__GET_CPUID) +++@@ -152,6 +155,9 @@ pg_popcount_available(void) +++ #endif +++ +++ return (exx[2] & (1 << 23)) != 0; /* POPCNT */ ++++#else ++++ return false; ++++#endif +++ } +++ +++ /* +