From a96f9e303919eca9dc0e7a2e6204680275b24155 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 22 Apr 2025 13:10:57 +0100 Subject: [PATCH 1/2] Put back version symbol wheel checks --- packaging/check_glibcxx.py | 11 ++++++----- packaging/post_build_script.sh | 15 +++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packaging/check_glibcxx.py b/packaging/check_glibcxx.py index b7efd9813..0e6e95d3b 100644 --- a/packaging/check_glibcxx.py +++ b/packaging/check_glibcxx.py @@ -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: @@ -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 @@ -36,7 +37,7 @@ if len(sys.argv) != 2: raise ValueError("Wrong usage: python check_glibcxx.py .") -MAX_ALLOWED = (3, 4, 19) +MAX_ALLOWED = (3, 4, 24) symbol_matches = sys.argv[1].split("\n") all_symbols = set() diff --git a/packaging/post_build_script.sh b/packaging/post_build_script.sh index ae2d162ef..d44f359bd 100755 --- a/packaging/post_build_script.sh +++ b/packaging/post_build_script.sh @@ -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 From fcce5de798ea8f45e39bb8405c77b7f773b44218 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 22 Apr 2025 17:04:52 +0100 Subject: [PATCH 2/2] empty