Skip to content

fix: prevent RUNNER detection failure - #1647

Open
ZohebShaikh wants to merge 2 commits into
mainfrom
justfile-fix
Open

fix: prevent RUNNER detection failure#1647
ZohebShaikh wants to merge 2 commits into
mainfrom
justfile-fix

Conversation

@ZohebShaikh

Copy link
Copy Markdown
Contributor

Append || true so the justfile can still be parsed/used on systems without a container runtime like docker or podman, instead of erroring out at command substitution time.

@ZohebShaikh
ZohebShaikh requested a review from a team as a code owner August 28, 2026 15:55
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.34%. Comparing base (157b73f) to head (d55ed6e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1647   +/-   ##
=======================================
  Coverage   96.34%   96.34%           
=======================================
  Files          46       46           
  Lines        3666     3666           
=======================================
  Hits         3532     3532           
  Misses        134      134           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tpoliaw

tpoliaw commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Doesn't this just make it fail later with an arguably more cryptic compose: command not found?

It would be good to catch this though, maybe something like

RUNNER = `command -v docker || command -v podman || true`

_check-runner: 
    #!/usr/bin/env bash
    if [[ "{{ RUNNER }}" == "" ]]; then
        echo "No container runtime available - either podman or docker is required"
        exit 1
    fi

compose <... existing args ...>: _check-runner
    ...

This then fails with

$ just
No container runtime available - either podman or docker is required
error: recipe `_check-runner` failed with exit code 1

@ZohebShaikh

Copy link
Copy Markdown
Contributor Author

I was thinking of adding a check if git or uv is not available to make it more fool proof but I thought it might be a bit excessive.

@tpoliaw

tpoliaw commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

We could have a require x recipe that checked if a command was available and gave a useful error? Could then be used as something like

serve: (_require "uv")
    ...

init-example: (_require "git")
    ...

@ZohebShaikh

ZohebShaikh commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

just changed uv to uva to give a example output

/tmp/just-J4sNoQ/serve: line 19: uva: command not found
error: Recipe `serve` failed with exit code 127

Is this difficult for a software engineer to understand this ?

Append `|| true` so the justfile can still be parsed/used on systems without
a container runtime like docker or podman, instead of erroring out at command substitution time.
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.

2 participants