Skip to content

Commit

Permalink
sagemathgh-38256: configure: Check that the build directory is on a…
Browse files Browse the repository at this point in the history
… 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 sagemath#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 sagemath#12345". -->

Just another protection for users who skip reading the README

Fixes sagemath#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,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38256
Reported by: Matthias Köppe
Reviewer(s): Sébastien Labbé
  • Loading branch information
Release Manager committed Jul 20, 2024
2 parents 4263cef + df678bc commit b6a5956
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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([error creating directory $SAGE_BUILD_DIR (SAGE_BUILD_DIR)])
rm -f "$SAGE_BUILD_DIR"/conftest
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
],
[
SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
Expand Down

0 comments on commit b6a5956

Please sign in to comment.