Skip to content
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

Fix it #58923

Merged
merged 4 commits into from
Nov 14, 2023
Merged

Fix it #58923

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
7 changes: 6 additions & 1 deletion python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import fnmatch
import errno
import platform
import glob
import shlex

from contextlib import contextmanager
from setuptools import Command
Expand Down Expand Up @@ -912,7 +913,11 @@ with open("@PADDLE_BINARY_DIR@/python/paddle/README.md", "r", encoding='UTF-8')

# strip *.so to reduce package size
if '${WITH_STRIP}' == 'ON':
command = 'find ${PADDLE_BINARY_DIR}/python/paddle -name "*.so" | xargs -i strip {}'
command = (
'find '
+ shlex.quote('${PADDLE_BINARY_DIR}')
+ '/python/paddle -name "*.so" | xargs -i strip {}'
)
if os.system(command) != 0:
raise Exception("strip *.so failed, command: %s" % command)

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import os
import platform
import re
import shlex
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -1699,7 +1700,7 @@ def main():
if env_dict.get("WITH_STRIP") == 'ON':
command = (
'find '
+ paddle_binary_dir
+ shlex.quote(paddle_binary_dir)
+ '/python/paddle -name "*.so" | xargs -i strip {}'
)
if os.system(command) != 0:
Expand Down