From 7783fa8fbd6a58b8896ccf90dabac173f9ee600c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 21 Jun 2024 21:46:19 -0700 Subject: [PATCH 1/3] configure: Check that the build directory is writable and on a normal file system --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 4848a8f4b21..c13b8e5630e 100644 --- a/configure.ac +++ b/configure.ac @@ -537,6 +537,19 @@ AC_CONFIG_COMMANDS(mkdirs, AC_MSG_NOTICE([[creating symbolic link lib64 -> lib]]) ln -s lib "$SAGE_LOCAL/lib64" fi + dnl Check that the file system is sufficiently functional + if test -z "$SAGE_BUILD_DIR"; then + SAGE_BUILD_DIR="$SAGE_LOCAL/var/tmp/sage/build" + fi + AC_MSG_NOTICE([creating directory $SAGE_BUILD_DIR]) + mkdir -p "$SAGE_BUILD_DIR" || AC_MSG_ERROR([could not create $SAGE_BUILD_DIR]) + rm -f "$SAGE_BUILD_DIR"/conftest + touch "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not create a file in $SAGE_BUILD_DIR]) + chmod -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions in $SAGE_BUILD_DIR]) + test -w "$SAGE_BUILD_DIR"/conftest && AC_MSG_ERROR([file permissions did not persist in $SAGE_BUILD_DIR]) + chmod +w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions in $SAGE_BUILD_DIR]) + test -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([file permissions did not persist in $SAGE_BUILD_DIR]) + rm -f "$SAGE_BUILD_DIR"/conftest ], [ SAGE_LOGS="$SAGE_ROOT/logs/pkgs" From d6be2c1c3c994c475b789af0056fe65ec07908be Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 22 Jun 2024 10:33:14 -0700 Subject: [PATCH 2/3] More verbosity --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index c13b8e5630e..b4a3d63d1d3 100644 --- a/configure.ac +++ b/configure.ac @@ -545,10 +545,10 @@ AC_CONFIG_COMMANDS(mkdirs, mkdir -p "$SAGE_BUILD_DIR" || AC_MSG_ERROR([could not create $SAGE_BUILD_DIR]) rm -f "$SAGE_BUILD_DIR"/conftest touch "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not create a file in $SAGE_BUILD_DIR]) - chmod -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions in $SAGE_BUILD_DIR]) - test -w "$SAGE_BUILD_DIR"/conftest && AC_MSG_ERROR([file permissions did not persist in $SAGE_BUILD_DIR]) - chmod +w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions in $SAGE_BUILD_DIR]) - test -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([file permissions did not persist in $SAGE_BUILD_DIR]) + chmod -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions -w in $SAGE_BUILD_DIR]) + test -w "$SAGE_BUILD_DIR"/conftest && AC_MSG_ERROR([file permissions -w did not persist in $SAGE_BUILD_DIR]) + chmod +w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions +w in $SAGE_BUILD_DIR]) + test -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([file permissions +w did not persist in $SAGE_BUILD_DIR]) rm -f "$SAGE_BUILD_DIR"/conftest ], [ From df678bc1ad59c2dd11f8f4b670c0c9d4c9faaed2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 28 Jun 2024 20:48:25 -0700 Subject: [PATCH 3/3] configure.ac: Check the executable bit instead of the write bit --- configure.ac | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index b4a3d63d1d3..df6a785251e 100644 --- a/configure.ac +++ b/configure.ac @@ -542,13 +542,13 @@ AC_CONFIG_COMMANDS(mkdirs, SAGE_BUILD_DIR="$SAGE_LOCAL/var/tmp/sage/build" fi AC_MSG_NOTICE([creating directory $SAGE_BUILD_DIR]) - mkdir -p "$SAGE_BUILD_DIR" || AC_MSG_ERROR([could not create $SAGE_BUILD_DIR]) + mkdir -p "$SAGE_BUILD_DIR" || AC_MSG_ERROR([error creating directory $SAGE_BUILD_DIR (SAGE_BUILD_DIR)]) rm -f "$SAGE_BUILD_DIR"/conftest - touch "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not create a file in $SAGE_BUILD_DIR]) - chmod -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions -w in $SAGE_BUILD_DIR]) - test -w "$SAGE_BUILD_DIR"/conftest && AC_MSG_ERROR([file permissions -w did not persist in $SAGE_BUILD_DIR]) - chmod +w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([could not set file permissions +w in $SAGE_BUILD_DIR]) - test -w "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([file permissions +w did not persist in $SAGE_BUILD_DIR]) + touch "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([error creating a file in $SAGE_BUILD_DIR]) + chmod +x "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([error setting file permissions +x in $SAGE_BUILD_DIR]) + test -x "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([file permissions +x did not persist in $SAGE_BUILD_DIR]) + chmod -x "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([error setting file permissions -x in $SAGE_BUILD_DIR]) + test -x "$SAGE_BUILD_DIR"/conftest && AC_MSG_ERROR([file permissions -x did not persist in $SAGE_BUILD_DIR]) rm -f "$SAGE_BUILD_DIR"/conftest ], [