Skip to content

Commit b6a5956

Browse files
author
Release Manager
committed
gh-38256: `configure`: Check that the build directory is on a normal writable file system <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Just another protection for users who skip reading the README Fixes #38246 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] 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 and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38256 Reported by: Matthias Köppe Reviewer(s): Sébastien Labbé
2 parents 4263cef + df678bc commit b6a5956

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

configure.ac

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,19 @@ AC_CONFIG_COMMANDS(mkdirs,
537537
AC_MSG_NOTICE([[creating symbolic link lib64 -> lib]])
538538
ln -s lib "$SAGE_LOCAL/lib64"
539539
fi
540+
dnl Check that the file system is sufficiently functional
541+
if test -z "$SAGE_BUILD_DIR"; then
542+
SAGE_BUILD_DIR="$SAGE_LOCAL/var/tmp/sage/build"
543+
fi
544+
AC_MSG_NOTICE([creating directory $SAGE_BUILD_DIR])
545+
mkdir -p "$SAGE_BUILD_DIR" || AC_MSG_ERROR([error creating directory $SAGE_BUILD_DIR (SAGE_BUILD_DIR)])
546+
rm -f "$SAGE_BUILD_DIR"/conftest
547+
touch "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([error creating a file in $SAGE_BUILD_DIR])
548+
chmod +x "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([error setting file permissions +x in $SAGE_BUILD_DIR])
549+
test -x "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([file permissions +x did not persist in $SAGE_BUILD_DIR])
550+
chmod -x "$SAGE_BUILD_DIR"/conftest || AC_MSG_ERROR([error setting file permissions -x in $SAGE_BUILD_DIR])
551+
test -x "$SAGE_BUILD_DIR"/conftest && AC_MSG_ERROR([file permissions -x did not persist in $SAGE_BUILD_DIR])
552+
rm -f "$SAGE_BUILD_DIR"/conftest
540553
],
541554
[
542555
SAGE_LOGS="$SAGE_ROOT/logs/pkgs"

0 commit comments

Comments
 (0)