Skip to content

Commit

Permalink
sagemathgh-36839: Remove most spkg-legacy-uninstall scripts
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

Most normal SPKGs are installed by staging in `DESTDIR`. When copying to
the final install location in `SAGE_LOCAL`, an installation record is
created, which is used later in package uninstallation.

However, when SPKG installation was switched to using staging in
`DESTDIR` (Meta-ticket sagemath#24024), the parts of `spkg-install` scripts that
used to be responsible for removing an old version of the installed
package were either kept in place or moved to `spkg-legacy-uninstall`
scripts. This was done to enable incremental builds from older
installations.

By passage of time, this is no longer needed.

Some of the removals are a partial cherry-pick from sagemath#25140 by @embray.

We also switch `frobby` to `DESTDIR` staging and *add* an `spkg-legacy-
uninstall` script.

Resolves sagemath#25140.
Resolves sagemath#30480.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36778 (merged here to resolve merge conflict)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36839
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 17, 2023
2 parents 4adecd8 + d8dd0ec commit 340cf1e
Show file tree
Hide file tree
Showing 37 changed files with 6 additions and 245 deletions.
2 changes: 0 additions & 2 deletions build/pkgs/boost_cropped/spkg-legacy-uninstall

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/brial/spkg-legacy-uninstall

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/cvxopt/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ sdh_pip_install .

if [ "x$SAGE_SPKG_INSTALL_DOCS" = xyes ] ; then
cd doc
# checking to see if there is previously installed documentation.
if [ -d $SAGE_LOCAL/share/doc/cvxopt/html ] ; then
rm -rf $SAGE_LOCAL/share/doc/cvxopt/html
fi
mkdir -p "${SAGE_DESTDIR}${SAGE_LOCAL}/share/doc/cvxopt/html"
cp -r html/* "${SAGE_DESTDIR}${SAGE_LOCAL}/share/doc/cvxopt/html/"
fi
Expand Down
6 changes: 0 additions & 6 deletions build/pkgs/ecl/spkg-legacy-uninstall

This file was deleted.

11 changes: 0 additions & 11 deletions build/pkgs/eclib/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ CXXFLAGS="$CXXFLAGS_O3_NON_NATIVE"

export CFLAGS CXXFLAGS


echo "Deleting old versions of eclib libraries, which"
echo "would interfere with new builds..."
# Delete any pre-autotools libraries:
rm -f "$SAGE_LOCAL"/lib/lib{curvesntl,g0nntl,jcntl,rankntl,mwrank}.*
# Delete autotools libraries:
rm -f "$SAGE_LOCAL"/lib/lib{e,j}c.*
echo "Deleting old include directory..."
rm -rf "$SAGE_LOCAL"/include/eclib/


cd src/

#############################################################
Expand Down
11 changes: 0 additions & 11 deletions build/pkgs/ecm/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,6 @@ sdh_configure $SAGE_CONFIGURE_GMP $ECM_CONFIGURE

sdh_make

###############################################################################
# Remove old executable/header/libraries/manpage:
###############################################################################

echo
echo "Build succeeded. Now removing old binary, header file, manual page and libraries..."
rm -f "$SAGE_LOCAL"/bin/ecm
rm -f "$SAGE_LOCAL"/lib/libecm.*
rm -f "$SAGE_LOCAL"/include/ecm.h
rm -f "$SAGE_LOCAL"/share/man/man1/ecm.1

###############################################################################
# Now install ECM:
###############################################################################
Expand Down
4 changes: 0 additions & 4 deletions build/pkgs/fplll/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ export CXX="$CXX"
sdh_configure $CONFIGUREFLAGS
sdh_make
sdh_make_install

# Pretend that the "libfplll" package is not installed. This is needed to
# support renaming libfplll -> fplll done on Trac #24042
rm -f "$SAGE_SPKG_INST/"libfplll-*
6 changes: 0 additions & 6 deletions build/pkgs/freetype/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ cd src
GNUMAKE=${MAKE} sdh_configure --enable-freetype-config $FREETYPE_CONFIGURE
sdh_make
sdh_make_install

# The following file may be present from old builds of freetype, and
# its presence can break the matplotlib build. So remove it. (The
# current version is $SAGE_LOCAL/include/freetype2/ftbuild.h.)

rm -f "$SAGE_LOCAL/include/ft2build.h"
13 changes: 1 addition & 12 deletions build/pkgs/frobby/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
rm -rf "$SAGE_LOCAL/bin/frobby"

GMP_INC_DIR="$SAGE_LOCAL/include"; export GMP_INC_DIR
ldflags="-Wl,-rpath,$SAGE_LOCAL/lib -L$SAGE_LOCAL/lib/ -lgmpxx -lgmp"; export ldflags
Expand All @@ -12,14 +11,4 @@ if [ $? -ne 0 ]; then
exit 1
fi

if [ ! -f bin/release/frobby ]; then
echo "Frobby executable not found."
exit 1
fi

$CP bin/release/frobby "$SAGE_LOCAL/bin/"

if [ ! -f "$SAGE_LOCAL/bin/frobby" ]; then
echo "Frobby executable not copied."
exit 1
fi
sdh_install bin/release/frobby "$SAGE_LOCAL/bin"
2 changes: 2 additions & 0 deletions build/pkgs/frobby/spkg-legacy-uninstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
rm -f "$SAGE_LOCAL/bin/frobby"
11 changes: 0 additions & 11 deletions build/pkgs/gap/spkg-legacy-uninstall

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/gf2x/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
echo "Deleting old gf2x files."
rm -f "$SAGE_LOCAL"/lib/libgf2x*
rm -rf "$SAGE_LOCAL"/include/gf2x*

cd src

# Use newer version of config.guess and config.sub (see Trac #19727)
Expand Down
3 changes: 0 additions & 3 deletions build/pkgs/gfan/spkg-legacy-uninstall

This file was deleted.

18 changes: 0 additions & 18 deletions build/pkgs/giac/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ sdh_configure --disable-gui --disable-ao "$DISABLENLS" --enable-png=no --disable

sdh_make

#############################################################
# Clean old install
#############################################################
echo "Cleaning giac..."
rm -f ${SAGE_LOCAL}/lib/libgiac*
rm -f ${SAGE_LOCAL}/bin/icas
rm -f ${SAGE_LOCAL}/bin/xcas
rm -f ${SAGE_LOCAL}/bin/cas_help
rm -f ${SAGE_LOCAL}/bin/pgiac
rm -f ${SAGE_LOCAL}/bin/en_cas_help
rm -f ${SAGE_LOCAL}/bin/es_cas_help
rm -f ${SAGE_LOCAL}/bin/fr_cas_help
rm -f ${SAGE_LOCAL}/bin/giac
rm -f ${SAGE_LOCAL}/bin/xcasnew
rm -rf ${SAGE_LOCAL}/share/giac
rm -rf ${SAGE_LOCAL}/share/doc/giac
rm -rf ${SAGE_LOCAL}/include/giac

#############################################################
# Install
#############################################################
Expand Down
4 changes: 0 additions & 4 deletions build/pkgs/glpk/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ export CFLAGS LDFLAGS CPPFLAGS
sdh_configure --with-gmp --disable-static
sdh_make

# Remove old libraries to make sure we can downgrade it if needed.
# See https://github.com/sagemath/sage/issues/23596#comment:4 and later.
rm -f "$SAGE_LOCAL"/lib/libglpk.*

sdh_make_install
3 changes: 0 additions & 3 deletions build/pkgs/gsl/spkg-legacy-uninstall

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/ipython/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Old installations of ipython can leave a symlink which can interfere
# with proper installation.
rm -f "$SAGE_LOCAL"/bin/ipython

cd src

sdh_pip_install .
5 changes: 0 additions & 5 deletions build/pkgs/jmol/spkg-legacy-uninstall

This file was deleted.

2 changes: 0 additions & 2 deletions build/pkgs/lcalc/spkg-legacy-uninstall

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/libgd/spkg-legacy-uninstall

This file was deleted.

3 changes: 0 additions & 3 deletions build/pkgs/m4ri/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ else
DISABLE_SSE2=""
fi

# otherwise we might run into problems with old headers
rm -rf "$SAGE_LOCAL/include/m4ri"

cd src

# Configure and build M4RI
Expand Down
6 changes: 0 additions & 6 deletions build/pkgs/m4rie/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ export CFLAGS
export CPPFLAGS
export LDFLAGS

# otherwise we might run into problems with old headers

if [ -d "$SAGE_LOCAL/include/m4rie" ]; then
rm -rf "$SAGE_LOCAL/include/m4rie"
fi

# build M4RIE

cd $ROOT_DIR/src/
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/mathjax/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
TARGET="${SAGE_SHARE}/mathjax"
# Cleanup installed version
rm -rf "${TARGET}"
sdh_install src/* "${TARGET}"
14 changes: 0 additions & 14 deletions build/pkgs/meataxe/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Delete old (Shared)MeatAxe libraries. This ensures a sane state if
# installation of this package fails: the mtx library should exist if
# and only if meataxe is installed. In detail: the build-time check in
# src/setup.py checks whether or not the "meataxe" package is
# marked as installed but the run-time check for the matrix_gfpn_dense
# module checks whether it can be imported. We need to ensure that these
# two conditions are equivalent, otherwise strange things can happen.
# See also https://github.com/sagemath/sage/issues/24359#comment:154
#
# This also deletes the static library left behind from the installation
# of MeatAxe (as opposed to SharedMeatAxe).
rm -f "$SAGE_LOCAL"/lib/libmtx.*

# Directory where executables are installed.
export MTXBIN="$SAGE_LOCAL"/bin

Expand All @@ -34,4 +21,3 @@ sdh_make_install
if [ "$SAGE_SPKG_INSTALL_DOCS" = yes ] ; then
$MAKE doc || sdh_die "Error documenting SharedMeatAxe"
fi

8 changes: 0 additions & 8 deletions build/pkgs/mpc/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,5 @@ EXTRA=""
sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR $EXTRA
sdh_make

# Cleaning
echo "Deleting old headers"
rm -f "$SAGE_LOCAL"/include/mpc.h
# Do not delete old libraries as this causes gcc to break during
# parallel builds.
# echo "Deleting old libraries"
# rm -f "$SAGE_LOCAL"/lib/libmpc.*

# Installing
sdh_make_install
8 changes: 0 additions & 8 deletions build/pkgs/mpfr/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,6 @@ mpfr_build()
{
mpfr_configure
sdh_make

echo
echo "Building MPFR succeeded. Now deleting old headers..."
rm -f "$SAGE_LOCAL"/include/*mpfr*
# Do not delete old libraries as this causes gcc to break during
# parallel builds.
# rm -f "$SAGE_LOCAL"/lib/libmpfr.*

sdh_make_install
}

Expand Down
4 changes: 0 additions & 4 deletions build/pkgs/mpfrcx/spkg-legacy-uninstall

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/ntl/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ ntl_build()

ntl_install()
{
echo
echo "Removing old NTL files."
rm -rf "$SAGE_LOCAL"/lib/libntl*
rm -rf "$SAGE_LOCAL"/include/NTL

echo
echo "Installing NTL."

Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/numpy/spkg-legacy-uninstall

This file was deleted.

3 changes: 0 additions & 3 deletions build/pkgs/openblas/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ if ! (sdh_make libs $OPENBLAS_CONFIGURE && sdh_make netlib $OPENBLAS_CONFIGURE &
fi
fi

# See https://github.com/sagemath/sage/issues/30335
rm -f "$SAGE_LOCAL/lib/pkgconfig/cblas.pc" "$SAGE_LOCAL/lib/pkgconfig/blas.pc" "$SAGE_LOCAL/lib/pkgconfig/lapack.pc"

sdh_make_install PREFIX="$SAGE_LOCAL" NO_STATIC=1 $OPENBLAS_CONFIGURE
cd ..
./write_pc_file.py
Expand Down
2 changes: 2 additions & 0 deletions build/pkgs/openblas/spkg-preinst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See https://github.com/sagemath/sage/issues/30335
rm -f "$SAGE_LOCAL/lib/pkgconfig/cblas.pc" "$SAGE_LOCAL/lib/pkgconfig/blas.pc" "$SAGE_LOCAL/lib/pkgconfig/lapack.pc"
11 changes: 0 additions & 11 deletions build/pkgs/python3/spkg-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ fi
# common in Cython-generated code.
export EXTRA_CFLAGS="`testcflags.sh -Wno-unused $OLD_CFLAGS`"

# Remove old symbolic link: it is not needed and its presence can
# interfere with the Python build.
rm -f "$SAGE_LOCAL/lib/python"

# Remove old libraries. We really need to do this before building Python
# since Python tries to import some modules (e.g. ctypes) at build-time.
# We need to make sure that the old installed libraries in local/lib are
# not used for that. See https://github.com/sagemath/sage/issues/24605
rm -f "$SAGE_LOCAL"/lib/lib"$PKG_BASE"*


# Note: --without-ensurepip ensures that setuptools+pip are *not* installed
# automatically when installing python3. They will be installed instead by
# the separate setuptools and pip packages; see
Expand Down
5 changes: 0 additions & 5 deletions build/pkgs/qhull/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ sdh_cmake -DCMAKE_VERBOSE_MAKEFILE=ON \

sdh_make

# clean old install
rm -rf "${SAGE_LOCAL}"/include/libqhull
rm -rf "${SAGE_LOCAL}"/include/qhull
rm -rf "${SAGE_LOCAL}"/lib/libqhull*

sdh_make_install
10 changes: 0 additions & 10 deletions build/pkgs/readline/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ sdh_configure --with-curses --enable-shared --disable-static
echo "Now building static and shared readline libraries..."
sdh_make

echo "Build succeedeed. Deleting old readline headers and libs"
echo "before installing the new ones..."
# (Note; Actually also readline does this by itself, but doing it
# here, too, doesn't hurt either.)
rm -rf "$SAGE_LOCAL"/include/readline/ "$SAGE_LOCAL"/lib/libreadline.*
if [[ $? -ne 0 ]]; then
echo >&2 "Error removing old version of readline."
exit 1
fi

echo "Now installing the new readline headers and libraries..."
sdh_make_install

Expand Down
3 changes: 0 additions & 3 deletions build/pkgs/sagetex/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
cd src

sdh_pip_install .

echo "Removing old SageTex version(s)"
rm -rf $SAGE_LOCAL/share/texmf/tex/generic/sagetex
Loading

0 comments on commit 340cf1e

Please sign in to comment.