diff --git a/.github/workflows/lib_compat_test.py b/.github/workflows/lib_compat_test.py index 25ce685..10460cc 100755 --- a/.github/workflows/lib_compat_test.py +++ b/.github/workflows/lib_compat_test.py @@ -19,21 +19,18 @@ args = parser.parse_args() # Parses GLIBC_2.3 into ("GLIBC", [2,3]) # Parses GLIBC into ("GLIBC", None) def parse_version(version): - parts = version.split('_', 1) + parts = version.rsplit('_', 1) if len(parts) == 1: return (version, None) - return (parts[0], [int(p) for p in parts[1].split('.')]) + try: + return (parts[0], [int(p) for p in parts[1].split('.')]) + except ValueError: + return (version, None) lib_versions = dict([parse_version(v) for v in args.lib]) -# Determines whether an optionally-versioned symbol is acceptable. -def accept_symbol(sym): - if sym in args.sym: - return True - split = sym.split('@', 1) - return (split[0] in args.sym) or (len(split) == 2 and accept_lib(split[1])) - # Determines whether all symbols with version 'lib' are acceptable. +# A versioned library is name_x.y.z by convention. def accept_lib(lib): (lib, ver) = parse_version(lib) if not lib in lib_versions: # Non-whitelisted library. @@ -44,6 +41,14 @@ def accept_lib(lib): return False return ver <= lib_versions[lib] +# Determines whether an optionally-versioned symbol is acceptable. +# A versioned symbol is symbol@version as output by nm. +def accept_symbol(sym): + if sym in args.sym: + return True + split = sym.split('@', 1) + return (split[0] in args.sym) or (len(split) == 2 and accept_lib(split[1])) + # Run nm to find the undefined symbols, and check whether each is acceptable. nm = subprocess.run(['nm', '-uD', '--with-symbol-version', args.binary], stdout=subprocess.PIPE, text=True) diff --git a/releases.md b/releases.md index 68c11d0..d466557 100644 --- a/releases.md +++ b/releases.md @@ -8,7 +8,8 @@ is being able to cut releases easily whenever we want. The releases are just a zip archive containing the `clangd` binary, and the clang builtin headers. They should be runnable immediately after extracting the archive. The linux binary has `libstdc++` and other dependencies statically -linked for maximum portability. +linked for maximum portability, and requires glibc 2.18 (the first version with +`thread_local` support). ## Creating a release manually