• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 25951830241
93%
main: 93%

Build:
Build:
LAST BUILD BRANCH: vscode2026
DEFAULT BRANCH: main
Ran 16 May 2026 03:47AM UTC
Jobs 12
Files 1737
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 May 2026 03:39AM UTC coverage: 92.89% (+0.001%) from 92.889%
25951830241

push

github

web-flow
Fix: IntrinsicError when a non-directory PATH entry is used with `system_binary` (Cherry-pick of #23327) (#23353)

Closes #21990

## Problem

Pants crashed with `IntrinsicError: Not a directory (os error 20)` when
a
`system_binary` target (or any binary lookup) included a non-directory
entry in
its search path. Two distinct shapes of the same underlying bug:

1. **`foo/bar` on PATH where `foo` is a file**. Calling
`path_metadata_request`
on `foo/bar` hits `ENOTDIR` in the OS. That error was not caught in the
Rust
   layer, so it surfaced as an uncaught `IntrinsicError`.

2. **A symlink-to-file on PATH** — the case from the issue report. The
first
`path_metadata_request` succeeds and returns
`PathMetadataKind::SYMLINK`,
but the Python code then tried to look up `symlink/binary_name`, which
also
   hits `ENOTDIR`.

## Fix

**`src/rust/fs/src/posixfs.rs`** — `path_metadata` now accepts a
`follow_symlinks`
flag. When `true`, it calls `tokio::fs::metadata` (which follows
symlinks) instead
of `tokio::fs::symlink_metadata`, so a symlink-to-directory appears as a
`Directory` rather than a `Symlink`. It also continues to treat
`ENOTDIR` as absent
(`Ok(None)`), fixing the file-component-on-PATH crash.

**`src/rust/fs/src/lib.rs`** — The `Vfs` trait's `path_metadata`
signature is
updated to accept `follow_symlinks: bool`. The in-memory `DigestTrie`
implementation
accepts but ignores the flag.

**`src/rust/engine/src/nodes/path_metadata.rs`** — `PathMetadataNode`
now carries
`follow_symlinks` and passes it through to the VFS call.

**`src/rust/engine/src/intrinsics/digests.rs`** — The
`path_metadata_request`
intrinsic reads `follow_symlinks` from the Python `PathMetadataRequest`
object and
passes it to `PathMetadataNode`.

**`src/python/pants/engine/fs.py`** — `PathMetadataRequest` gains a
`follow_symlinks: bool = False` field.

**`src/python/pants/core/util_rules/system_binaries.py`** — The initial
lookup of
each PATH entry uses `follow_symlinks=True`. A symlink... (continued)

23 of 23 new or added lines in 3 files covered. (100.0%)

1 existing line in 1 file now uncovered.

92104 of 99154 relevant lines covered (92.89%)

4.04 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
96.15
-3.85% src/python/pants/backend/tools/preamble/subsystem.py
Jobs
ID Job ID Ran Files Coverage
1 test_python_linux_x86_64_1/10 - 25951830241.1 16 May 2026 03:54AM UTC 1190
49.16
GitHub Action Run
2 test_python_linux_x86_64_0/10 - 25951830241.2 16 May 2026 03:54AM UTC 1211
56.71
GitHub Action Run
3 test_python_linux_arm64 - 25951830241.3 16 May 2026 04:15AM UTC 1175
52.3
GitHub Action Run
4 test_python_linux_x86_64_7/10 - 25951830241.4 16 May 2026 03:54AM UTC 1197
51.26
GitHub Action Run
5 test_python_linux_x86_64_5/10 - 25951830241.5 16 May 2026 03:54AM UTC 1206
59.64
GitHub Action Run
6 test_python_linux_x86_64_8/10 - 25951830241.6 16 May 2026 03:54AM UTC 1194
53.57
GitHub Action Run
7 test_python_linux_x86_64_3/10 - 25951830241.7 16 May 2026 03:54AM UTC 1191
53.97
GitHub Action Run
8 test_python_macos14_arm64 - 25951830241.8 16 May 2026 03:47AM UTC 1175
52.31
GitHub Action Run
9 test_python_linux_x86_64_4/10 - 25951830241.9 16 May 2026 03:54AM UTC 1226
59.46
GitHub Action Run
10 test_python_linux_x86_64_9/10 - 25951830241.10 16 May 2026 03:54AM UTC 1202
54.07
GitHub Action Run
11 test_python_linux_x86_64_2/10 - 25951830241.11 16 May 2026 03:54AM UTC 1194
58.62
GitHub Action Run
12 test_python_linux_x86_64_6/10 - 25951830241.12 16 May 2026 03:54AM UTC 1187
49.52
GitHub Action Run
Source Files on build 25951830241
  • Tree
  • List 1737
  • Changed 7
  • Source Changed 3
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25951830241
  • c0f83925 on github
  • Prev Build on 2.32.x (#25869747091)
  • Next Build on 2.32.x (#25989245395)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc