Skip to content

Commit 8d6aae1

Browse files
committed
fix: Expand on precedence
1 parent 15bb6a8 commit 8d6aae1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

text/3502-cargo-script.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ users might not be aware that they are using old dependencies.
435435
The precedence schema for `cargo foo` has limitations
436436
- If your script has the same name as a built-in subcommand, then you have to prefix it with `./`
437437
- If you browse a random repo and try to run one of your aliases or third-party commands, you could unintentionally get a local script instead.
438+
- Similarly, new cargo commands could shadow user scripts
438439
- If `PATH` is unset or set to an empty string, then running `build` will run `cargo build` and run the built-in `build` command rather than your script
440+
- The likelihood of a script named the same as a cargo subcommand that is in the PATH or called in a strange way seems unlikely
439441
- Calls to `execve` (and similar functions) don't rely on resolving via `PATH` so a call with `build` will run `cargo build` and run the built-in `build` command rather than your script
440442

441443
This increases the maintenance and support burden for the cargo team, a team
@@ -948,7 +950,7 @@ See also [Single-file scripts that download their dependencies](https://dbohdan.
948950
# Unresolved questions
949951
[unresolved-questions]: #unresolved-questions
950952

951-
- Whether `version` should may be unset or defaulted to `0.0.0`
953+
- Considering taking [AT_EXECFN](https://www.man7.org/linux/man-pages/man3/getauxval.3.html) into account when determining precedence
952954

953955
# Future possibilities
954956
[future-possibilities]: #future-possibilities

0 commit comments

Comments
 (0)