From 9820863ab950a9b8f76782a215d7274ed71b2527 Mon Sep 17 00:00:00 2001 From: Anik Bhattacharjee Date: Thu, 21 Aug 2025 14:24:36 -0400 Subject: [PATCH] (fix) broken generate-manifests script for macOS Problem: The script used `realpath --relative-to` which works on Linux (GNU coreutils) but fails on macOS (BSD realpath). This caused `realpath: illegal option -- -` errors when running on macOS. Solution: Replaced GNU-specific realpath --relative-to with Python's os.path.relpath() Note: This introduces Python3 requirements for both CI environments and local development machines Also fixed SED tool selection for script: Use gsed for macOS, sed for linux. --- scripts/generate_crds_manifests.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/generate_crds_manifests.sh b/scripts/generate_crds_manifests.sh index 69a30bcd6b..b70996a694 100755 --- a/scripts/generate_crds_manifests.sh +++ b/scripts/generate_crds_manifests.sh @@ -26,7 +26,7 @@ chartdir="${tmpdir}/chart" crddir="${chartdir}/crds" crdsrcdir="${tmpdir}/operators" -SED="sed" +SED="gsed" if ! command -v ${SED} &> /dev/null; then SED="sed" fi @@ -644,7 +644,8 @@ for file in ${microshift_manifests_files}; do continue 2 fi done - echo " - $(realpath --relative-to "${ROOT_DIR}/microshift-manifests" "${file}")" >> "${ROOT_DIR}/microshift-manifests/kustomization.yaml" + relative_path=$(python3 -c "import os.path; print(os.path.relpath('${file}', '${ROOT_DIR}/microshift-manifests'))") + echo " - ${relative_path}" >> "${ROOT_DIR}/microshift-manifests/kustomization.yaml" done # Now we need to get rid of these args from the olm-operator deployment: