Comments (6)
I think we definitely do need to flesh out our documentation. But I'd also like to explicitly decide what our behaviour should be rather than just documenting behaviour which is mostly accidental. Even if that decision ends up being to keep doing what we're currently doing, I'd rather that was a conscious choice.
from rust.
Rust's std does not use PATHEXT
and nor does the underlying CreateProcess
API. I did once make an issue about Command
running scripts but most felt this was better done in a crate (see #94743)
from rust.
https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/ says:
However, since Windows includes .bat and .cmd files in the PATHEXT environment variable by default, some runtimes execute batch files against the developers’ intention if there is a batch file with the same name as the command that the developer intended to execute
does libstd ignore PATHEXT? or is it possible that Command::new("script")
could have the same effect as Command::new("script.bat")
? in the latter case i don't see much point in disallowing .bat specifically (although it might be reasonable for clippy to lint on it).
from rust.
FWIW, I was previously confused about PATHEXT
too: #50870 (comment)
Other relevant issues for cross reference: #37519 #87945 #93124
from rust.
This was discussed in the libs-api meeting. There was no consensus on dropping this behaviour.
However there's also not currently a consensus on documenting this behaviour, rather than just keeping some degree of hidden support for compatibility reasons but not actively advertising it (maybe with a lint on static strings passed to Command::new
that contain .bat
or .cmd
extensions).
from rust.
This was again discussed in the latest libs-api meeting. It was felt that keeping our current behaviour was worth it for the sake of compatibility. So I'll close this.
I'll add that our documentation does now have warnings around bat use. Improved documentation for Windows specific issues can of course be added but that's a separate issue.
from rust.
Related Issues (20)
- Clean up implicit const promotion behavior
- Unable to run rustc -v on Mac HOT 5
- modifying immutable refenrences via unsafe no longer works, when building a nightly release HOT 3
- ICE with anonymous_lifetime_in_impl_trait feature: "called `Option::unwrap()` on a `None` value" HOT 1
- ICE: late diagnostics: `no entry found for key` HOT 3
- Missed Optimization: Inefficient Handling of Mutable Reference in Simple Conditional Assignment HOT 5
- ICE: rustc_ast_lowering: `no entry found for key` HOT 2
- ICE: `interpret const eval failure of Unevaluated(UnevaluatedConst ... which is not in required_consts` HOT 5
- Iterating all `char`s blocks dead code elimination HOT 9
- ICE: `entered unreachable code: encountered 'Item(Item.. due to Some(ObligationCause .. ` HOT 5
- ICE: `None` in `rustc_hir_typeck` due to malformed attribute HOT 6
- Nondeterminism encountered in metadata for doc_link_resolutions HOT 8
- compiletest: Support aux-bin with cross compilation
- ICE: rustdoc: `line.len() >= frag.indent` HOT 1
- Differences between LLVM const-eval of floats and runtime behaviour can cause miscompilations HOT 14
- Incorrect direction/place for "returning this value requires that `<variable>` is borrowed for `'static`" for E0597
- `-C instrument-coverage` does not work with `crate-type = ["dylib"]` dependency on windows-msvc HOT 2
- ICE: codegen: `index out of bounds: the len is 3 but the index is 4`
- Module docs for std::os::unix::io inconsistent with I/O Safety discussion in std::io HOT 2
- `obligations_for_self_ty` leaks placeholders
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.