Skip to content

fix: stop using curl --fail-with-body and remove jq dependency#193

Merged
GuillaumeLagrange merged 2 commits intomainfrom
cod-2299-unable-to-install-codspeed-in-self-hosted-runners
Mar 5, 2026
Merged

fix: stop using curl --fail-with-body and remove jq dependency#193
GuillaumeLagrange merged 2 commits intomainfrom
cod-2299-unable-to-install-codspeed-in-self-hosted-runners

Conversation

@GuillaumeLagrange
Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange commented Mar 4, 2026

Fixes #192
Improves compatibility as much as possible

Switches jq use for https://github.com/actions/github-script to execute a basic nodejs script to parse the json
We also drop the fail-with-body to maximize compatibility

With older versions of curl

  ┌───────────────┬────────────────┬────────────────────────────────────────┐   
  │   Scenario    │ Before (curl   │           After (curl 7.61)            │ 
  │               │     7.61)      │                                        │   
  ├───────────────┼────────────────┼────────────────────────────────────────┤   
  │ Valid version │ Reason:        │ Success                                │   
  │               │ (empty, fails) │                                        │ 
  ├───────────────┼────────────────┼────────────────────────────────────────┤ 
  │ 404           │ Reason:        │ Reason: HTTP 404 - {"error":"Release   │
  │               │ (empty, fails) │ v99.99.99 not found"}                  │
  ├───────────────┼────────────────┼────────────────────────────────────────┤
  │ Connection    │ Reason:        │ Reason: curl: (6) Could not resolve    │
  │ failure       │ (empty, fails) │ host: ...                              │
  ├───────────────┼────────────────┼────────────────────────────────────────┤
  │ No pinned     │ Never reached  │ No pinned hash found for installer     │
  │ hash          │                │ version X                              │
  ├───────────────┼────────────────┼────────────────────────────────────────┤
  │ Hash mismatch │ Never reached  │ Installer hash mismatch for version X. │
  │               │                │  Expected: ..., Got: ...               │
  └───────────────┴────────────────┴────────────────────────────────────────┘

With newer versions of curl

  ┌──────────────┬──────────────────────────┬───────────────────────────────┐   
  │   Scenario   │   Before (curl 7.76+)    │      After (curl 7.76+)       │ 
  ├──────────────┼──────────────────────────┼───────────────────────────────┤   
  │ Valid        │ Success                  │ Success                       │ 
  │ version      │                          │                               │   
  ├──────────────┼──────────────────────────┼───────────────────────────────┤ 
  │              │ Reason: Release          │ Reason: HTTP 404 -            │ 
  │ 404          │ v99.99.99 not found      │ {"error":"Release v99.99.99   │
  │              │                          │ not found"}                   │
  ├──────────────┼──────────────────────────┼───────────────────────────────┤
  │ Connection   │ Reason: (empty)          │ Reason: curl: (6) Could not   │
  │ failure      │                          │ resolve host: ...             │
  ├──────────────┼──────────────────────────┼───────────────────────────────┤
  │ No pinned    │ No pinned hash found for │ No pinned hash found for      │
  │ hash         │  installer version X     │ installer version X           │
  ├──────────────┼──────────────────────────┼───────────────────────────────┤
  │ Hash         │ Installer hash mismatch  │ Installer hash mismatch for   │
  │ mismatch     │ for version X. Expected: │ version X. Expected: ...,     │
  │              │  ..., Got: ...           │ Got: ...                      │
  └──────────────┴──────────────────────────┴───────────────────────────────┘

@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch 4 times, most recently from d765dc1 to ed49daa Compare March 4, 2026 13:24
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch from ed49daa to 7fa35d2 Compare March 4, 2026 13:50
@GuillaumeLagrange GuillaumeLagrange requested a review from art049 March 4, 2026 13:53
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch 2 times, most recently from 78590ff to 1ac3596 Compare March 4, 2026 17:42
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch from 1ac3596 to f5e5fb3 Compare March 4, 2026 17:47
@GuillaumeLagrange
Copy link
Contributor Author

@adriencaccia re-requesting a review for the second commit

@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch from f5e5fb3 to 9e74db5 Compare March 5, 2026 11:42
This allows the path to be properly updated when installing on a minimal
system

From the generated installer by cargo-dist
```
add_install_dir_to_ci_path() {
    # Attempt to do CI-specific rituals to get the install-dir on PATH faster
    local _install_dir="$1"

    # If GITHUB_PATH is present, then write install_dir to the file it refs.
    # After each GitHub Action, the contents will be added to PATH.
    # So if you put a curl | sh for this script in its own "run" step,
    # the next step will have this dir on PATH.
    #
    # Note that GITHUB_PATH will not resolve any variables, so we in fact
    # want to write install_dir and not install_dir_expr
    if [ -n "${GITHUB_PATH:-}" ]; then
        ensure echo "$_install_dir" >> "$GITHUB_PATH"
    fi
}
```
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch from 9e74db5 to c61f6b6 Compare March 5, 2026 11:51
@GuillaumeLagrange GuillaumeLagrange merged commit c61f6b6 into main Mar 5, 2026
24 checks passed
@GuillaumeLagrange GuillaumeLagrange deleted the cod-2299-unable-to-install-codspeed-in-self-hosted-runners branch March 5, 2026 11:51
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.

Unable to install codspeed in self-hosted runners

2 participants