From cc4d2af0ec43d8ce5e148df6440ae4a22d50f8c2 Mon Sep 17 00:00:00 2001 From: Anubhav Srivastava Date: Thu, 19 Oct 2023 00:40:25 -0700 Subject: [PATCH] Upgrade Snappy to 1.1.9-yb-3 to fix GCC 11 (#238) Backport the snappy upgrade from https://github.com/yugabyte/yugabyte-db-thirdparty/commit/5ea869b800a5173f116921ea03a33604143748e2 to fix GCC 11 builds running into this longjmp error: https://github.com/yugabyte/yugabyte-db/issues/12429. --- python/build_definitions/snappy.py | 47 ++++++------------------------ thirdparty_src_checksums.txt | 1 + 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/python/build_definitions/snappy.py b/python/build_definitions/snappy.py index a732cb9f..d7d1ea38 100644 --- a/python/build_definitions/snappy.py +++ b/python/build_definitions/snappy.py @@ -21,45 +21,16 @@ class SnappyDependency(Dependency): def __init__(self) -> None: super(SnappyDependency, self).__init__( name='snappy', - version='1.1.3', - url_pattern='https://github.com/google/snappy/archive/{0}.tar.gz', + version='1.1.9-yb-3', + url_pattern='https://github.com/yugabyte/snappy/archive/refs/tags/v{0}.tar.gz', build_group=BUILD_GROUP_INSTRUMENTED) - self.copy_sources = True - self.patch_version = 1 - self.patches = ['snappy-define-guard-macro.patch'] - self.post_patch = ['autoreconf', '-fvi'] - - def _disable_lzo2_library_in_test(self) -> None: - ''' - Makes the snappy unit test not use the liblzo2 library. Sometimes the configure script will - pick up the library from a system directory when it should not. - ''' - log("Removing HAVE_LIBLZO2 from config.h") - lines: List[str] = [] - removed = False - with open('config.h') as input_file: - for line in input_file: - if line.strip() == '#define HAVE_LIBLZO2 1': - removed = True - else: - lines.append(line) - if not removed: - log("Warning: did not remove HAVE_LIBLZO2 from config.h") - with open('config.h', 'w') as output_file: - output_file.write('\n'.join(lines) + '\n') def build(self, builder: BuilderInterface) -> None: - log_prefix = builder.log_prefix(self) - builder.build_with_configure( - log_prefix=log_prefix, - extra_args=['--with-pic'], - post_configure_action=self._disable_lzo2_library_in_test, + builder.build_with_cmake( + dep=self, + extra_args=[ + '-DSNAPPY_BUILD_TESTS=OFF', + '-DSNAPPY_BUILD_BENCHMARKS=OFF', + ], + shared_and_static=True ) - # Copy over all the headers into a generic include/ directory. - mkdir_if_missing('include') - subprocess.check_call('ls | egrep "snappy.*.h" | xargs -I{} rsync -av "{}" "include/"', - shell=True) - - # Copy over all the libraries into a generic lib/ directory. - mkdir_if_missing('lib') - subprocess.check_call('ls ".libs/" | xargs -I{} rsync -av ".libs/{}" "lib/"', shell=True) diff --git a/thirdparty_src_checksums.txt b/thirdparty_src_checksums.txt index 81e42e6c..ca35d651 100644 --- a/thirdparty_src_checksums.txt +++ b/thirdparty_src_checksums.txt @@ -80,6 +80,7 @@ ffcbaa53fc2cedee1f7e0e43adc7624d650a19e4fc5929df5d781a6f4ddf0bc6 rapidjson-1.1. 8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab rapidjson-1.1.0.zip 9824a7906b9f742c34a205e552d7b8fcc4b2790832a6b1a14907e37f435328b0 redis_cli-4.0.1.tar.gz f94c0f816510a95d7521c725e9ddf48bfd600a0f6623d33c9a6a92ec824d8c12 snappy-1.1.3.tar.gz +3580e35e9ffb24e6e718c9159e9c557c9bb850986a3263f8abc8cf2c56848fc9 snappy-1.1.9-yb-3.tar.gz 71847377c42b4b31cb07327daf9042f6e0e919c4e1ce62fad794cb5827b159e1 squeasel-8ac777a122fccf0358cb8562e900f8e9edd9ed11.tar.gz 48cc3c73697ff7f6119d0a960fdc3218780cbfb895c187f7f45f2393b16f601f squeasel-8ac777a122fccf0358cb8562e900f8e9edd9ed11-yb-1.tar.gz 2dd06f19e0208c423f7514760150d2f41a8dafdd3aed5384ef2afbfc3df7d900 yb-llvm-v11.1.0-yb-1-1633143292-130bd22e-almalinux8-x86_64.tar.gz