You run pants fmt folder name :: just like you do every single day.
Instead of clean code, your terminal spits out a massive traceback ending in this:
IntrinsicError: Failed to execute: Process {
argv: [
"__ruff_tool/ruff-x86_64-apple-darwin/ruff",
"format",
"--force-exclude",
...
]
}
Error launching process: Os { code: 2, kind: NotFound, message: "No such file or directory" }I know, everything was working fine a few hours ago.
But, now the Pants build system is aggressively failing to format the Python code.
I hit this exact wall recently on my MacBook Pro.
Here is what is actually happening (under the hood) and the exact sequence to fix it:
Root Cause
Pants manages its own internal toolchain.
It isolates dependencies by downloading specific binaries, like the Ruff formatter, and caching them locally to speed up execution.
When you see Os { code: 2, kind: NotFound }, it means Pants is trying to execute a binary from its cached __ruff_tool directory, but the file either does not exist, got corrupted, or there is a silent architecture mismatch preventing the OS from recognizing the executable.
If you look closely at the log, it is targeting ruff-x86_64-apple-darwin.
If you are on an Apple Silicon machine, this often happens when your terminal session gets confused between native ARM execution and Rosetta x86_64 translation too.
Or it could happen that your binary is not the right binary for the new pants version (incompatibility)
Pants tries to grab the x86_64 binary, fails to execute it in the current environment context, and completely crashes the formatting goal.
You do not need to debug the internals of the Pants engine for this.
You just need to force it to drop the bad state and reinstall the correct toolchain for your current architecture.
Nuke the Caches
First, clear out the global tool cache and the local project cache. Run this in your terminal to wipe the slate clean:
rm -rf ~/Library/Caches/nce
rm -rf .pants.dCheck Architecture Consistency
Before you rebuild, verify that your terminal session is actually running under the architecture you expect.
arch
python -c "import platform; print(platform.machine())"If this shows x86_64 on an Apple Silicon machine unexpectedly, you are running in a Rosetta-translated session.
Open a native ARM terminal or correct your environment variables.
Re-run the Formatter
Once the caches are clear and your architecture is verified, trigger the formatting goal again:
pants fmt foldername ::Pants will detect the missing Ruff binary, download a fresh version matching your current environment, and execute the format seamlessly.
The error disappears and you can get back to writing actual code.
In case we are meeting for the first time, come over here, it’ll be worth the roller coaster of articles that are gonna come up in the next few weeks.
I swear tracking these updates is a job in itself, lately.
Here’s the list which I’ve built and keep adding on.
And If you need help for analyzing UFC fights, please check out BoutPredict :)