Skip to content

Commit de9862a

Browse files
committed
fix: Cover required vs optional shebang
1 parent d2fc291 commit de9862a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

text/3503-frontmatter.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ Like with Python, this allows any file in a package (with the correct deps and `
109109

110110
As for the hard-coded infostring used by cargo, that is a decision for [RFC 3502].
111111

112+
## Required vs Optional Shebang
113+
114+
We could require the shebang to be present for all cargo-scripts.
115+
This would most negatively impact Windows users as the shebang is a no-op.
116+
We still care about Windows because cargo-scripts can still be used for exploration and prototyping,
117+
even if they can't directly be used as drop-in utilities.
118+
119+
The main reason to require a shebang is to positively identify the associated "interpreter".
120+
However, statically analyzing a shebang is [complicated](https://stackoverflow.com/questions/38059830/how-does-perl-avoid-shebang-loops)
121+
and we are wanting to avoid it in the core workflow.
122+
This isn't to say that tools like rust-analyzer might choose to require it to help their workflow.
123+
112124
## Syntax
113125

114126
[RFC 3502] lays out some design principles, including

0 commit comments

Comments
 (0)