Skip to content

fix(scripts): replace GNU-only find -printf with POSIX-compliant alternative#4

Open
smoparth wants to merge 1 commit into
mainfrom
ambient/session-7343b666-4212-48ed-9657-2edbbd8ee60c
Open

fix(scripts): replace GNU-only find -printf with POSIX-compliant alternative#4
smoparth wants to merge 1 commit into
mainfrom
ambient/session-7343b666-4212-48ed-9657-2edbbd8ee60c

Conversation

@smoparth
Copy link
Copy Markdown
Owner

Summary

  • Replace GNU-only find -printf with POSIX-compliant -exec basename {} \; in generate-containerfile.sh and CI workflow
  • Add regression test to prevent reintroduction of non-portable find flags

Details

find_latest_version() in scripts/generate-containerfile.sh used find -printf '%f\n', a GNU extension not available on macOS BSD find. This caused app.conf generation to silently fail on macOS, producing only a Containerfile without the companion config file.

Files changed

  • scripts/generate-containerfile.sh — replaced -printf '%f\n' with -exec basename {} \; (lines 96, 99)
  • .github/workflows/check-cuda-versions.yml — same fix for consistency (line 50)
  • tests/test_generate_containerfile.sh — new regression test (7 tests)

Test plan

  • bash tests/test_generate_containerfile.sh — all 7 tests pass
  • End-to-end: ./scripts/generate-containerfile.sh cuda 14.0 generates both Containerfile and app.conf
  • (Manual) Verify on macOS if available

Fixes opendatahub-io#143

🤖 Generated with Claude Code

…rnative

Replace `find -printf '%f\n'` with `find -exec basename {} \;` in
generate-containerfile.sh and check-cuda-versions.yml to fix macOS
compatibility. BSD find (default on macOS) does not support -printf,
causing app.conf generation to silently fail.

Adds regression test to prevent reintroduction of non-portable find flags.

Fixes opendatahub-io#143

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: generate-containerfile.sh fails on macOS due to GNU-only find -printf

1 participant