Skip to content

fix: quote install prefix in nvidia backend check - #5152

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/assets-quote-install-prefix-in-nvidia-backend
Open

fix: quote install prefix in nvidia backend check#5152
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/assets-quote-install-prefix-in-nvidia-backend

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in docker/build/assets.Dockerfile: quote install prefix in nvidia backend check.

Changes

  • docker/build/assets.Dockerfile: quote install prefix in nvidia backend check.

Details

--- a/docker/build/assets.Dockerfile
+++ b/docker/build/assets.Dockerfile
@@ -1,14 +1,14 @@
-# Validate that the nvidia backend was built.
-RUN source /cuda-quantum/scripts/configure_build.sh && \
-    if [ -z "$(ls $CUDAQ_INSTALL_PREFIX/targets/nvidia.yml)" ]; then \
-        echo -e "\e[01;31mError: Missing nvidia backend.\e[0m" >&2; \
-        exit 1; \
-    fi
-
-...
-
-# Validate that the nvidia backend was built.
-RUN if [ -z "$(ls /cuda-quantum/_skbuild/targets/nvidia.yml)" ]; then \
-        echo -e "\e[01;31mError: Missing nvidia backend.\e[0m" >&2; \
-        exit 1; \
-    fi
+# Validate that the nvidia backend was built.
+RUN source /cuda-quantum/scripts/configure_build.sh && \
+    if [ ! -e "$CUDAQ_INSTALL_PREFIX/targets/nvidia.yml" ]; then \
+        echo -e "\e[01;31mError: Missing nvidia backend.\e[0m" >&2; \
+        exit 1; \
+    fi
+
+...
+
+# Validate that the nvidia backend was built.
+RUN if [ ! -e "/cuda-quantum/_skbuild/targets/nvidia.yml" ]; then \
+        echo -e "\e[01;31mError: Missing nvidia backend.\e[0m" >&2; \
+        exit 1; \
+    fi

Tests

  • scripts/test_nvidia_backend_check.sh
--- /dev/null
+++ b/scripts/test_nvidia_backend_check.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# ============================================================================ #
+# Copyright (c) 2022 - 2026 NVIDIA Corporation & Affiliates.                   #
+# All rights reserved.                                                         #
+#                                                                              #
+# This source code and the accompanying materials are made available under     #
+# the terms of the Apache License 2.0 which accompanies this distribution.     #
+# ============================================================================ #
+#
+# Regression test for the nvidia backend existence check.
+# Verifies that a CUDAQ_INSTALL_PREFIX containing spaces is handled correctly.
+
+set -e
+
+CUDAQ_INSTALL_PREFIX="$(mktemp -d)/cuda quantum install"
+mkdir -p "$CUDAQ_INSTALL_PREFIX/targets"
+touch "$CUDAQ_INSTALL_PREFIX/targets/nvidia.yml"
+
+if [ ! -e "$CUDAQ_INSTALL_PREFIX/targets/nvidia.yml" ]; then
+    echo -e "\e[01;31mError: Missing nvidia backend.\e[0m" >&2
+    rm -rf "$(dirname "$CUDAQ_INSTALL_PREFIX")"
+    exit 1
+fi
+
+rm -rf "$(dirname "$CUDAQ_INSTALL_PREFIX")"
+echo "PASS"

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the build The issue related to the CUDA Quantum build label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build The issue related to the CUDA Quantum build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant