There is a rare race condition associated to sage-make_relative
: when a file is open for writing, it cannot be executed (you get a "Text file busy" error). Since the sage-make_relative
Python script opens all files in $SAGE_LOCAL/bin
for writing, it can happen that a Sage build fails.
Example from install.log
of a failed parallel build:
sage_fortran -fPIC -c sposv.f -o sposv.o
sage_fortran -fPIC -c sposvx.f -o sposvx.o
sage_fortran -fPIC -c spotf2.f -o spotf2.o
Making Python scripts relocatable...
sage_fortran -fPIC -c spotrf.f -o spotrf.o
sage_fortran -fPIC -c spotri.f -o spotri.o
sage_fortran -fPIC -c spotrs.f -o spotrs.o
sage_fortran -fPIC -c sppcon.f -o sppcon.o
make[2]: execvp: sage_fortran: Text file busy
make[2]: *** [sppcon.o] Error 127
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/buildbot/build/sage/lena-1/lena_upgrade_4.7.1/build/sage-5.3.rc1/spkg/build/lapack-20071123.p2/src/SRC'
make[1]: *** [lapacklib] Error 2
make[1]: Leaving directory `/home/buildbot/build/sage/lena-1/lena_upgrade_4.7.1/build/sage-5.3.rc1/spkg/build/lapack-20071123.p2/src'
Error compiling lapack.
The best solution is to move sage-make_relative
to sage-location
: the latter script is intented precisely to fix relocation issues. It would also be faster, as currently every file in $SAGE_LOCAL/bin
is checked after every package is installed. It also means we need a mechanism to force a sage-location
run even when the installation tree hasn't moved. For this, I propose to use the existence of the file
$SAGE_LOCAL/lib/sage-force-relocate.txt
Apply:
- 13407_make_relative.patch to the scripts repository.
- 13407_spkg.patch to the
SAGE_ROOT
repository.
all seems to make sense, and it does work.