Skip to content

fix: resolve install-callgrind-tools.ps1 path via justfile_directory()#491

Open
kate-shine wants to merge 1 commit into
mainfrom
kchuranov/fix-install-tools-script-path
Open

fix: resolve install-callgrind-tools.ps1 path via justfile_directory()#491
kate-shine wants to merge 1 commit into
mainfrom
kchuranov/fix-install-tools-script-path

Conversation

@kate-shine

Copy link
Copy Markdown
Contributor

Fixes the just install-tools failure on Windows reported in AB#7477055.

Problem

The install-tools recipe is declared as [script]. Just writes script recipes to a temporary file (%TEMP%\just-XXXXXX\install-tools.ps1) before executing them with the configured interpreter. As a result, `` inside the recipe resolves to that temp directory rather than the repo, and the relative lookup \..\scripts\install-callgrind-tools.ps1 does not exist:

The term 'C:\Users\sasaares\AppData\Local\Temp\just-s8ukYf\..\scripts\install-callgrind-tools.ps1'
is not recognized as a name of a cmdlet, function, script file, or executable program.
error: recipe install-tools failed with exit code 1

Fix

Use Just's built-in {{justfile_directory()}} interpolation, which is expanded at recipe-build time and always points at the repository root — independent of where Just chooses to stage the script file.

Validation

  • Manually invoked the resolved path: Callgrind toolchain is Linux-only; skipping. (script's intended Windows behavior).
  • No changelog entry — repository convention is no changelog for build-infra fixes.

The install-tools recipe runs as a `[script]` block, which Just writes
to a temp file before executing. `` therefore expands to
the temp directory, not the repo, so the relative lookup
`\..\scripts\install-callgrind-tools.ps1` fails with
"The term '...' is not recognized as a name of a cmdlet, function,
script file, or executable program".

Use Just's `{{justfile_directory()}}` which is interpolated at recipe
build time and always points at the repository root.

AB#7477055

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 11:11
@kate-shine kate-shine marked this pull request as draft June 11, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix just install-tools failing on Windows by making the install-callgrind-tools.ps1 invocation independent of Just’s temporary staging directory for [script] recipes.

Changes:

  • Replaces $PSScriptRoot-relative script lookup with a Just interpolation-based path.
  • Attempts to resolve the scripts/install-callgrind-tools.ps1 path from the Justfile location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread justfiles/setup.just
@kate-shine kate-shine marked this pull request as ready for review June 11, 2026 11:27
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (60baaf1) to head (74985f6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #491   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         331      331           
  Lines       24717    24717           
=======================================
  Hits        24717    24717           

☔ 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.

@kate-shine kate-shine enabled auto-merge (squash) June 12, 2026 09:13
Comment thread justfiles/setup.just

# Install platform-specific benchmark toolchain (Callgrind, Linux-only).
& (Join-Path $PSScriptRoot ".." "scripts" "install-callgrind-tools.ps1")
& (Join-Path '{{justfile_directory()}}' "scripts" "install-callgrind-tools.ps1")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ox-sdk similarly afflicted or how come we did not notice it there?

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.

4 participants