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

Improve make micro_release #11743

Closed
kini opened this issue Aug 25, 2011 · 8 comments
Closed

Improve make micro_release #11743

kini opened this issue Aug 25, 2011 · 8 comments

Comments

@kini
Copy link
Contributor

kini commented Aug 25, 2011

See this comment.

Depends on #10801

CC: @sagetrac-emil

Component: scripts

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/11743

@kini kini added this to the sage-5.10 milestone Aug 25, 2011
@kini kini self-assigned this Aug 25, 2011
@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 25, 2011

comment:1

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 .dylibs on Mac OS X? DLLs and .exes on Cygwin?

Also, this should be added to the Developer's Guide, perhaps also the Sage Installation Guide.

@vbraun
Copy link
Member

vbraun commented Nov 28, 2011

comment:2

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.

@dimpase
Copy link
Member

dimpase commented Nov 30, 2011

comment:3

Replying to @vbraun:

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.

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

@sagetrac-emil
Copy link
Mannequin

sagetrac-emil mannequin commented Jan 16, 2012

comment:4

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

@sagetrac-emil
Copy link
Mannequin

sagetrac-emil mannequin commented Jan 16, 2012

comment:5

make micro_release fails because it is implemented to strip all files with ending ."so", but libz.so is a symlink.

@jpflori
Copy link

jpflori commented Mar 30, 2012

comment:6

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.

@jdemeyer
Copy link

comment:7

Duplicate of #13004 I guess...

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants