Skip to content
Draft
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
29 changes: 23 additions & 6 deletions manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# so manually do the work of copying dependency libs and patchelfing
# and fixing RECORDS entries correctly
######################################################################

PLATFORM="manylinux_2_28_x86_64"
fname_with_sha256() {
HASH=$(sha256sum $1 | cut -c1-8)
DIRNAME=$(dirname $1)
Expand Down Expand Up @@ -152,6 +152,16 @@ for pkg in /$WHEELHOUSE_DIR/torch_no_python*.whl /$WHEELHOUSE_DIR/${WHEELNAME_MA
$PATCHELF_BIN --set-rpath ${LIB_SO_RPATH:-'$ORIGIN'} ${FORCE_RPATH:-} $sofile
$PATCHELF_BIN --print-rpath $sofile
done
# create Manylinux 2_28 tag this needs to happen before regenerate the RECORD
if [[ "$PLATFORM" == "manylinux_2_28_x86_64" ]]; then
# Pick the right WHEEL file, even when the dist-info dir was renamed
if [[ -n "${WHEELNAME_MARKER}" ]]; then
wheel_file="${new_dist_info_dir}/WHEEL"
else
wheel_file=$(basename "$pkg" | sed -e 's/-cp.*$/.dist-info\/WHEEL/')
fi
sed -i -e "s#linux_x86_64#${PLATFORM}#" "$wheel_file"
fi

# regenerate the RECORD file with new hashes
# record_file=$(echo $(basename $pkg) | sed -e 's/-cp.*$/.dist-info\/RECORD/g')
Expand Down Expand Up @@ -197,13 +207,20 @@ for pkg in /$WHEELHOUSE_DIR/torch_no_python*.whl /$WHEELHOUSE_DIR/${WHEELNAME_MA

popd
fi
# Rename wheel for Manylinux 2_28
if [[ "$PLATFORM" == "manylinux_2_28_x86_64" ]]; then
new_pkg=$(echo "$pkg" | sed "s#linux_x86_64#${PLATFORM}#")
if [[ "$pkg" != "$new_pkg" ]]; then
pkg="$new_pkg"
fi
fi

# zip up the wheel back
zip -rq $(basename $pkg) $PREIX*
# Re-zip the edited tree into the wheel
zip -rq "$(basename "$pkg")" "${PREFIX}"*

# replace original wheel
rm -f $pkg
mv $(basename $pkg) $pkg
# Replace the original wheel with the one we just built
rm -f "$pkg"
mv "$(basename "$pkg")" "$pkg"
# Rename wheel to reflect lightweight/heavyweight
if [[ -n "${WHEELNAME_MARKER}" ]]; then
# Rename wheel to match metadata in dist-info
Expand Down
1 change: 1 addition & 0 deletions manywheel/build_torch_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
retry yum install -q -y zip openssl
elif [[ "$OS_NAME" == *"AlmaLinux"* ]]; then
retry yum install -q -y zip openssl
PLATFORM="manylinux_2_28_x86_64"
elif [[ "$OS_NAME" == *"Red Hat Enterprise Linux"* ]]; then
retry dnf install -q -y zip openssl
elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then
Expand Down
Loading