Skip to content

Fix strip in bootstrap #1607

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 6 commits into from
Jan 31, 2019
Merged
Changes from 2 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
6 changes: 4 additions & 2 deletions pythonforandroid/bootstrap.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ def strip_libraries(self, arch):
info('Python was loaded from CrystaX, skipping strip')
return
env = arch.get_env()
strip = which('arm-linux-androideabi-strip', env['PATH'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since which is not used anymore, would you mind removing the import to please the CI 🙏

pythonforandroid/bootstrap.py:12:1: F401 'pythonforandroid.util.which' imported but unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Sorry about the CI. Thanks for your help.

strip = env['STRIP'].split(' ')[0]
if strip is None:
warning('Can\'t find strip in PATH...')
return
strip = sh.Command(strip)
strip = sh.Command(strip).bake('--strip-unneeded')

libs_dir = join(self.dist_dir, '_python_bundle',
'_python_bundle', 'modules')
Expand All @@ -278,6 +278,8 @@ def strip_libraries(self, arch):

logger.info('Stripping libraries in private dir')
for filen in filens.split('\n'):
if not filen:
continue # skip the last ''
try:
strip(filen, _env=env)
except sh.ErrorReturnCode_1:
Expand Down