Skip to content

Commit

Permalink
bail out of activation if environment is not writable
Browse files Browse the repository at this point in the history
Reinstate 7c0287a

Closes #1126

Also consistently use punctionation at the end of log messages.
  • Loading branch information
h-vetinari committed Jul 28, 2023
1 parent e0b230a commit dd3c77f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit dd3c77f

Please sign in to comment.