From d7756701c0e45ca424c7cd3810e9d88bf792e51c Mon Sep 17 00:00:00 2001 From: Paul Taylor <178183+trxcllnt@users.noreply.github.com> Date: Thu, 9 May 2024 11:00:59 -0700 Subject: [PATCH] Handle arguments with spaces in `CMAKE_ARGS` (#292) * escape quotes so arguments with spaces are handled appropriately in the CMAKE_ARGS envvar * bump feature version * actually break when user enters empty branch --- .../devcontainer-feature.json | 2 +- .../bin/generate-docstring.sh | 2 +- .../bin/pull-repositories.sh | 21 +++++++++++-------- .../bin/tmpl/cpp.install.tmpl.sh | 3 ++- .../bin/tmpl/python.build.wheel.tmpl.sh | 2 +- .../bin/tmpl/python.install.tmpl.sh | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/features/src/rapids-build-utils/devcontainer-feature.json b/features/src/rapids-build-utils/devcontainer-feature.json index 961928c3..1b10e23a 100644 --- a/features/src/rapids-build-utils/devcontainer-feature.json +++ b/features/src/rapids-build-utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "NVIDIA RAPIDS devcontainer build utilities", "id": "rapids-build-utils", - "version": "24.6.17", + "version": "24.6.18", "description": "A feature to install the RAPIDS devcontainer build utilities", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-docstring.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-docstring.sh index 86d76348..bee5dac2 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-docstring.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-docstring.sh @@ -163,7 +163,7 @@ _include_pip_wheel_options\ local -; set -euo pipefail; eval "$(_parse_args "$@" <&0)"; - echo "${ARGS[*]}"; + echo "${ARGS[*]@Q}"; } _parse_args() { diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/pull-repositories.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/pull-repositories.sh index e82d8691..27a7b11f 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/pull-repositories.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/pull-repositories.sh @@ -63,25 +63,28 @@ pull_repositories() { read -rp " ############################################################ -Branch \"${branch}\" $( -if test -n "${default_branch}"; then - echo "and \"${default_branch}\""; -fi -) not found in: +$( + test -z "${default_branch:-}" && \ + echo "Branch \"${branch}\" " || \ + echo "Branches \"${branch}\" and \"${default_branch}\" " +)\ +not found in: ${remote_info} ############################################################ Please enter a branch name to pull (or leave empty to skip): " branch /dev/null; echo -n "lib${CPP_LIB}${component:+ $component} install time:"; ) 2>&1; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh index bcdc393b..2055a479 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh @@ -94,7 +94,7 @@ build_${PY_LIB}_python_wheel() { CUDAFLAGS="${cudaflags}" \ CMAKE_GENERATOR="${G:-Ninja}" \ PARALLEL_LEVEL="${n_jobs}" \ - CMAKE_ARGS="${cmake_args[*]}" \ + CMAKE_ARGS="${cmake_args[*]@Q}" \ SKBUILD_BUILD_OPTIONS="${ninja_args[*]}" \ SKBUILD_BUILD_TOOL_ARGS="${ninja_args[*]}" \ SKBUILD_LOGGING_LEVEL="${v:+INFO}" \ diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh index fec19e98..775974e5 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh @@ -112,7 +112,7 @@ install_${PY_LIB}_python() { CUDAFLAGS="${cudaflags}" \ CMAKE_GENERATOR="${G:-Ninja}" \ PARALLEL_LEVEL="${n_jobs}" \ - CMAKE_ARGS="${cmake_args[*]}" \ + CMAKE_ARGS="${cmake_args[*]@Q}" \ SKBUILD_BUILD_OPTIONS="${ninja_args[*]}" \ SKBUILD_BUILD_TOOL_ARGS="${ninja_args[*]}" \ SKBUILD_LOGGING_LEVEL="${v:+INFO}" \