Skip to content

Commit f2e2192

Browse files
authored
Put back version symbol wheel checks (#646)
1 parent 879cae2 commit f2e2192

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packaging/check_glibcxx.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
The goal of this script is to ensure that the .so files we ship do not contain
3-
symbol versions from libstdc++ that are too recent.
3+
symbol versions from libstdc++ that are too recent. This is a very manual way of
4+
doing the checks that `auditwheel repair` would do (but using auditwheel isn't
5+
necessarily easy either).
46
57
Why this is needed: during development, we observed the following general
68
scenario in various local development setups:
@@ -25,9 +27,8 @@
2527
GLIBCXX_3.4.19, so as long as torchcodec doesn't ship a symbol that is higher
2628
than that, torchcodec should be fine.
2729
28-
Note that the easiest way to avoid recent symbols is simply to use an old-enough
29-
toolchain. In July 2024, pytorch libraries (and torchcodec) are built with gcc
30-
9.
30+
The easiest way to avoid recent symbols is simply to use an old-enough
31+
toolchain. Relying on the test-infra runners should be enough.
3132
"""
3233

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

39-
MAX_ALLOWED = (3, 4, 19)
40+
MAX_ALLOWED = (3, 4, 24)
4041

4142
symbol_matches = sys.argv[1].split("\n")
4243
all_symbols = set()

packaging/post_build_script.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ assert_not_in_wheel $wheel_path "^doc"
3737
assert_not_in_wheel $wheel_path "^benchmarks"
3838
assert_not_in_wheel $wheel_path "^packaging"
3939

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

4948
echo "ls dist"
5049
ls dist

0 commit comments

Comments
 (0)