Opened 10 years ago
Closed 9 years ago
#11743 closed enhancement (duplicate)
Improve `make micro_release`
Reported by: | kini | Owned by: | kini |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | scripts | Keywords: | |
Cc: | emil | Merged in: | |
Authors: | Reviewers: | Jeroen Demeyer | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #10801 | Stopgaps: |
Description
See this comment.
Change History (7)
comment:1 Changed 10 years ago by
comment:2 follow-up: ↓ 3 Changed 10 years ago by
The stripping has issues as it is currently implemented: $SAGE_LOCAL/lib/libpython2.6.so
is installed read-only, which makes make micro-release
fail:
[sage@sage sage]$ ll local/lib/libpython2.6.so.1.0 -r-xr-xr-x. 1 sage sage 4459077 Nov 7 15:17 local/lib/libpython2.6.so.1.0 [sage@sage sage]$ strip local/lib/libpython2.6.so.1.0 strip: unable to copy file 'local/lib/libpython2.6.so.1.0'; reason: Permission denied [sage@sage sage]$ strip local/lib/libpython2.6.so strip: unable to copy file 'local/lib/libpython2.6.so'; reason: Permission denied
If I change the permissions manually then I can strip it, of course, but then the Python script sage-micro_release
segfaults while stripping libpython2.6.so
. You must not modify the library that your script is depending on while running.
comment:3 in reply to: ↑ 2 Changed 10 years ago by
- Status changed from new to needs_info
Replying to vbraun:
The stripping has issues as it is currently implemented:
$SAGE_LOCAL/lib/libpython2.6.so
is installed read-only, which makesmake micro-release
fail:[sage@sage sage]$ ll local/lib/libpython2.6.so.1.0 -r-xr-xr-x. 1 sage sage 4459077 Nov 7 15:17 local/lib/libpython2.6.so.1.0 [sage@sage sage]$ strip local/lib/libpython2.6.so.1.0 strip: unable to copy file 'local/lib/libpython2.6.so.1.0'; reason: Permission denied [sage@sage sage]$ strip local/lib/libpython2.6.so strip: unable to copy file 'local/lib/libpython2.6.so'; reason: Permission deniedIf I change the permissions manually then I can strip it, of course, but then the Python script
sage-micro_release
segfaults while strippinglibpython2.6.so
. You must not modify the library that your script is depending on while running.
What about: make a writeable copy of libpython2.6.so, strip the copy, move the copy to the original; the latter should be done in the proper kamikaze way (the script should go down with a smile, not with a segfault) --- perhaps passing control to a shell script and then exit...
And by the way: permissions fixed after discussion
comment:4 Changed 10 years ago by
- Cc emil added
I get this error if I execute make micro_release of sage 4.7.2 on a fresh debian_live install:
root@meow:/media/sda6/sage-4.7.2# make micro_release . local/bin/sage-env && local/bin/sage-micro_release Stripping .so files in local/lib strip "/media/sda6/sage-4.7.2/local/lib/libz.so" Bus error Error executing command. Failed with exit status 34560. make: * [micro_release] Error 1
I don't know if this may help with anything, but these are the strip commands on the whole sage tree I already successfully used (executed in $SAGE_HOME):
# Step 1) for executables
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : |
xargs strip --strip-unneeded 2> /dev/null # Step 2) for shared libraries
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
Comparison: Step 1 got -50 MB Step 2 got -250 MB
In the sage-micro_relase script stripping is performed only for selected libraries with 'strip "%s"'%filename (.i.e without the flag --strip-unneeded. This can lead to problems for libraries - I *think* the --strip-unneeded flag is recommended).
Just for the record, info about my manual "stripping" experience here http://boxen.math.washington.edu/home/emil/sagelithe/strippingI.txt http://boxen.math.washington.edu/home/emil/sagelithe/strippingII.txt
comment:5 Changed 10 years ago by
make micro_release fails because it is implemented to strip all files with ending ."so", but libz.so is a symlink.
comment:6 Changed 10 years ago by
On my sage-4.8 and 5.0.beta* "make micro_release" might fail for two reasons:
- segfault while trying to strip libpython
- permission error while trying to strip system atlas libraries.
comment:7 Changed 9 years ago by
- Component changed from packages: standard to scripts
- Milestone changed from sage-5.10 to sage-duplicate/invalid/wontfix
- Resolution set to duplicate
- Reviewers set to Jeroen Demeyer
- Status changed from needs_info to closed
Duplicate of #13004 I guess...
Also
s/Striping/Stripping/
once... ;-)spkg/build/
should also be deleted (if present).There are some static libraries in subdirectories, too, and we should also delete libtool's
.la
files. Strip.dylib
s on Mac OS X? DLLs and.exe
s on Cygwin?Also, this should be added to the Developer's Guide, perhaps also the Sage Installation Guide.