Resolve the formatter in a temp project, not the runner's shared depot - #29
Merged
Merged
Conversation
sotashimozono
force-pushed
the
pin-formatter
branch
from
September 13, 2026 13:29
c5e3558 to
d9a9971
Compare
`Pkg.add(name="JuliaFormatter", version="2")` ran with no active project, so it
resolved into whatever environment the runner happened to have. The compat
bounds already sitting in that depot cap the resolve, which makes the installed
version a property of the machine rather than of this file: the same commit
resolved 2.3.2 on a self-hosted runner and 2.10.1 on a GitHub-hosted one.
Formatting differs across 2.x minors, so format-check returned a verdict on the
runner, not on the diff. A leftover ITensorFormatter in a shared depot also
pinned JuliaSyntax to 0.4 and turned the install into a hard resolve failure,
which presents as a flake because it depends on which runner you land on.
`Pkg.activate(; temp=true)` before the add is the fix, and the install and the
check are now one process so the environment cannot expire between them.
The version still floats, deliberately. A pin converts each new release into
permanent debt in every calling repo and rots while the ecosystem moves; the
answer to a release that reflows files is to adopt it and reformat. Isolation
is what this check needed to be reproducible, and it is orthogonal to the
version spec.
Added an assertion that the loaded version is the one the temp project holds.
`using` silently falls back to the depot's default environment when the active
project does not declare the package, which has bitten this fleet twice through
an env that looked right by its name.
The failure message now names the version CI resolved and gives the same
floating spec in a temp env, with `overwrite=true` and a retry loop, since
`overwrite=false` is a check rather than a fix and one pass does not always
converge.
Runs the script through `shell: julia --color=yes {0}` rather than `julia -e`,
which is how lab-sotashimozono/.github has run this check for months. The
failure message has to contain a Julia command with its own quotes, and that
does not survive nesting inside `-e '...'`. The two orgs' scripts are now
byte-identical, so a fix to one is a copy-paste to the other.
Verified locally on both arms rather than by CI round trip: a formatted tree
exits 0 with the success line, a misformatted one exits 1 with the message.
The YAML and the embedded script both parse.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sotashimozono
force-pushed
the
pin-formatter
branch
from
September 13, 2026 13:44
d9a9971 to
6ec851c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pkg.add(name="JuliaFormatter", version="2")ran with no active project, so itresolved into whatever environment the runner happened to have. The compat
bounds already sitting in that depot cap the resolve, which makes the installed
version a property of the machine rather than of this file: the same commit
resolved 2.3.2 on a self-hosted runner and 2.10.1 on a GitHub-hosted one.
Formatting differs across 2.x minors, so format-check returned a verdict on the
runner, not on the diff. A leftover ITensorFormatter in a shared depot also
pinned JuliaSyntax to 0.4 and turned the install into a hard resolve failure,
which presents as a flake because it depends on which runner you land on.
Pkg.activate(; temp=true)before the add is the fix, and the install and thecheck are now one process so the environment cannot expire between them.
The version still floats, deliberately. A pin converts each new release into
permanent debt in every calling repo and rots while the ecosystem moves; the
answer to a release that reflows files is to adopt it and reformat. Isolation
is what this check needed to be reproducible, and it is orthogonal to the
version spec.
Added an assertion that the loaded version is the one the temp project holds.
usingsilently falls back to the depot's default environment when the activeproject does not declare the package, which has bitten this fleet twice through
an env that looked right by its name.
The failure message now names the version CI resolved and gives the same
floating spec in a temp env, with
overwrite=trueand a retry loop, sinceoverwrite=falseis a check rather than a fix and one pass does not alwaysconverge.
Runs the script through
shell: julia --color=yes {0}rather thanjulia -e,which is how lab-sotashimozono/.github has run this check for months. The
failure message has to contain a Julia command with its own quotes, and that
does not survive nesting inside
-e '...'. The two orgs' scripts are nowbyte-identical, so a fix to one is a copy-paste to the other.
Verified locally on both arms rather than by CI round trip: a formatted tree
exits 0 with the success line, a misformatted one exits 1 with the message.
The YAML and the embedded script both parse.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
QAtlasHub/QAtlas.jl#795 tracks the remaining caller: its inline FormatCheck.yml pins 2.12.3 and should migrate here. Seven repos call this workflow today (AbstractQAtlas.jl, ExperimentalAPI.jl, SweepRunner.jl, TestShards.jl, DataVault.jl, ParamIO.jl, templateHPC.jl) and all resolve 2.14.0, so this changes where the formatter is installed, not which one runs.