Skip to content

Add code to regenerate RECORD file for the wheel after we use patchelf #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2017
Merged
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
18 changes: 18 additions & 0 deletions manywheel/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,24 @@ for whl in /$WHEELHOUSE_DIR/torch*manylinux*.whl; do
# libshm
patchelf --set-rpath '$ORIGIN' torch/lib/libshm.so

# regenerate the RECORD file with new hashes
record_file=`echo $(basename whl) | sed -e 's/-cp.*$/.dist-info\/RECORD/g'`
new_record_file="$record_file"_new
while read -r line
do
record_item="$line"
IFS=, read -r filename digestmethod digest size <<< "$record_item"
if [ $filename == $record_file ]
then
echo "$line" >> $new_record_file
else
new_digest=`openssl dgst -sha256 -binary $filename | openssl base64 | sed -e 's/+/-/g' | sed -e 's/\//_/g' | sed -e 's/=//g'`
new_size=`ls -nl $filename | awk '{print $5}'`
echo $filename,$digestmethod,$new_digest,$new_size >> $new_record_file
fi
done < "$record_file"
mv $new_record_file $record_file

# zip up the wheel back
zip -r $(basename $whl) torch*

Expand Down