Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packaging/check_glibcxx.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
The goal of this script is to ensure that the .so files we ship do not contain
symbol versions from libstdc++ that are too recent.
symbol versions from libstdc++ that are too recent. This is a very manual way of
doing the checks that `auditwheel repair` would do (but using auditwheel isn't
necessarily easy either).

Why this is needed: during development, we observed the following general
scenario in various local development setups:
Expand All @@ -25,9 +27,8 @@
GLIBCXX_3.4.19, so as long as torchcodec doesn't ship a symbol that is higher
than that, torchcodec should be fine.

Note that the easiest way to avoid recent symbols is simply to use an old-enough
toolchain. In July 2024, pytorch libraries (and torchcodec) are built with gcc
9.
The easiest way to avoid recent symbols is simply to use an old-enough
toolchain. Relying on the test-infra runners should be enough.
"""

import re
Expand All @@ -36,7 +37,7 @@
if len(sys.argv) != 2:
raise ValueError("Wrong usage: python check_glibcxx.py <str_with_symbols>.")

MAX_ALLOWED = (3, 4, 19)
MAX_ALLOWED = (3, 4, 24)

symbol_matches = sys.argv[1].split("\n")
all_symbols = set()
Expand Down
15 changes: 7 additions & 8 deletions packaging/post_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ assert_not_in_wheel $wheel_path "^doc"
assert_not_in_wheel $wheel_path "^benchmarks"
assert_not_in_wheel $wheel_path "^packaging"

# TODO: Put this back with higher upper bound of version symbol.
#if [[ "$unamestr" == 'Linux' ]]; then
# # See invoked python script below for details about this check.
# extracted_wheel_dir=$(mktemp -d)
# unzip -q $wheel_path -d $extracted_wheel_dir
# symbols_matches=$(find $extracted_wheel_dir | grep ".so$" | xargs objdump --syms | grep GLIBCXX_3.4.)
# python packaging/check_glibcxx.py "$symbols_matches"
#fi
if [[ "$unamestr" == 'Linux' ]]; then
# See invoked python script below for details about this check.
extracted_wheel_dir=$(mktemp -d)
unzip -q $wheel_path -d $extracted_wheel_dir
symbols_matches=$(find $extracted_wheel_dir | grep ".so$" | xargs objdump --syms | grep GLIBCXX_3.4.)
python packaging/check_glibcxx.py "$symbols_matches"
fi

echo "ls dist"
ls dist
Loading