Skip to content

fix: resolve symlinked /bin/python3 as LinuxGlobal (Fixes #405)#413

Draft
karthiknadig wants to merge 1 commit intomainfrom
bug/issue-405
Draft

fix: resolve symlinked /bin/python3 as LinuxGlobal (Fixes #405)#413
karthiknadig wants to merge 1 commit intomainfrom
bug/issue-405

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

When /bin is a symlink to /usr/bin (common on modern Linux distros), find_cached() canonicalizes /bin/usr/bin and only caches entries under /usr/bin. A subsequent try_from call with /bin/python3 fails the direct cache lookup and returns None, causing the environment to be reported as Unknown.

Fix: In try_from, after a cache miss, canonicalize the executable path and retry the lookup. When found via the canonical path, add the original path as a symlink and update both cache entries for consistency.

  • Canonicalize executable once, use for both path guard and cache fallback
  • Path guard accepts executables whose canonical path resolves to a known bin dir
  • Cache fallback adds the original path as a symlink for complete metadata
  • Both canonical and original cache entries updated to keep symlink lists consistent

Fixes #405

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 73.4%
Base Branch Coverage 73.5%
Delta -.1% ❌

Coverage decreased. Please add tests for new code.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Performance Report (Linux) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 71ms 270ms 79ms -8ms -10.0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 57ms 492ms 87ms -30ms
Full Refresh 128ms 26124ms 163ms -35ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Performance Report (Windows) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 11ms 9ms 0ms 0%
Full Refresh 150ms 1531ms 146ms 4ms 2.7%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 69.61%
Base Branch Coverage 69.73%
Delta -0.12% ❌

Coverage decreased. Please add tests for new code.

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.

Bug: /bin/python3 reported as Unknown when it symlinks to /usr/bin/python3 (LinuxGlobal)

1 participant