Skip non-executable files when searching PATH for build tools
Problem
The shared which helper accepts any regular file. An earlier non-executable file shadows a later working tool and causes build/provisioning to fail.
Reproduction and evidence
Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.
Executed a disposable PATH with first/audit-tool (mode 0644, non-executable) and second/audit-tool (mode 0755, valid shell script). package::which("audit-tool") returns first/audit-tool. The expected PATH candidate is second/audit-tool. No system PATH files were changed.
Scope
Apply the host executable-search rules while preserving ordered lookup, direct paths and Windows executable suffix behavior.
Starting points: tools/src/package.rs:10.
Completion criteria
- [ ] Earlier non-executable files/directories do not hide a usable later PATH tool.
- [ ] A genuinely missing/unusable tool yields a clear failure.
- [ ] Add Unix permission and platform-appropriate direct-path controls.
This is a bounded newcomer task with the starting point and focused negative/positive checks above.
Related: #594. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.
Hey @LunaStev , I'd like to work on this issue. Could you please assign it to me?
Hey @LunaStev , I'd like to work on this issue. Could you please assign it to me?
Ok