From dd3c77f91e32bb6efe1b117a9639837ac27f3e55 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 29 Jul 2023 01:19:52 +1100 Subject: [PATCH] bail out of activation if environment is not writable Reinstate 7c0287a84ba8303b12c97e397f2b24a0239b6b46 Closes #1126 Also consistently use punctionation at the end of log messages. --- recipe/activate.sh | 12 +++++++++--- recipe/meta.yaml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/recipe/activate.sh b/recipe/activate.sh index 875761278..ebdc8a416 100755 --- a/recipe/activate.sh +++ b/recipe/activate.sh @@ -23,6 +23,12 @@ _la_log "Beginning libarrow activation." # where the GDB wrappers get installed _la_gdb_prefix="$CONDA_PREFIX/share/gdb/auto-load" +# If the directory is not writable, nothing can be done +if [ ! -w "$_la_gdb_prefix" ]; then + _la_log 'No rights to modify $_la_gdb_prefix, cannot create symlink!' + return +fi + # this needs to be in sync with ARROW_GDB_INSTALL_DIR in build.sh _la_placeholder="replace_this_section_with_absolute_slashed_path_to_CONDA_PREFIX" # the paths here are intentionally stacked, see #935, resp. @@ -44,7 +50,7 @@ for _la_target in "$_la_orig_install_dir/"*.py; do # If the file doesn't exist, skip this iteration of the loop. # (This happens when no files are found, in which case the # loop runs with target equal to the pattern itself.) - _la_log 'Folder $_la_orig_install_dir seems to not contain .py files, skipping' + _la_log 'Folder $_la_orig_install_dir seems to not contain .py files, skipping.' continue fi _la_symlink="$_la_symlink_dir/$(basename "$_la_target")" @@ -54,12 +60,12 @@ for _la_target in "$_la_orig_install_dir/"*.py; do _la_log 'symlink $_la_symlink already exists and points to $_la_target, skipping.' continue fi - _la_log 'Creating symlink $_la_symlink pointing to $_la_target' + _la_log 'Creating symlink $_la_symlink pointing to $_la_target.' mkdir -p "$_la_symlink_dir" || true # this check also creates the symlink; if it fails, we enter the if-branch. if ! ln -sf "$_la_target" "$_la_symlink"; then echo -n "${BASH_SOURCE[0]} ERROR: Failed to create symlink from " - echo -n "'$_la_target' to '$_la_symlink'" + echo -n "'$_la_target' to '$_la_symlink'!" echo continue fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8709f46ed..a1be83f1a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -21,7 +21,7 @@ source: folder: testing build: - number: 6 + number: 7 # for cuda support, building with one version is enough to be compatible with # all later versions, since arrow is only using libcuda, and not libcudart. skip: true # [cuda_compiler_version not in ("None", cuda_compiler_version_min)]