Skip to content

Commit

Permalink
Upgrade Snappy to 1.1.9-yb-3 to fix GCC 11 (#238)
Browse files Browse the repository at this point in the history
Backport the snappy upgrade from
5ea869b
to fix GCC 11 builds running into this longjmp error:
yugabyte/yugabyte-db#12429.
  • Loading branch information
SrivastavaAnubhav authored Oct 19, 2023
1 parent 78ea75d commit cc4d2af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 38 deletions.
47 changes: 9 additions & 38 deletions python/build_definitions/snappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions thirdparty_src_checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc4d2af

Please sign in to comment.