Comments (4)
If a path is longer than 260 characters,
\\?\
is the only way to refer to it.
This is only true when calling OS APIs (and only if longpathaware
isn't enabled). Paths can be stored and passed around as a user path then converted to a verbatim path at the point of use. The std will even do the latter for you.
from cargo.
I would just add that for a long time now PathBuf::push
, etc should work fine if pushing like a/b
to a verbatim path. It will convert the separator for you. It's just naively appending strings which doesn't work. The problem, as the OP says, is that there isn't a path API for include!
.
from cargo.
This is only true when calling OS APIs (and only if
longpathaware
isn't enabled). Paths can be stored and passed around as a user path then converted to a verbatim path at the point of use. The std will even do the latter for you.
Since Cargo has set longpathaware
and std handles for us, does it mean it's generally safe for cargo to take advantage of non-UNC paths via dunce
?
from cargo.
Hm, I don't think that's used for build scripts? But in any case, when using Rust's std
APIs it should work out fine either way.
The issue with dunce is that it intentionally won't work in a number of cases, including for long paths and \\?\UNC\
style paths. Nushell ran into issues with this so I created omnipath
which they've been using successfully for awhile now. Essentially the philosophy of omnipath
is to have a distinction between "user" paths and "verbatim" paths where converting between the two is always fine so long as it's possible to round-trip (e.g. converting to verbatim->user->verbatim will return the same path). The only downside is that it needs to use OS APIs to be sure it can round-trip the path. So it is slower.
from cargo.
Related Issues (20)
- omitting edition produces unexpected errors HOT 3
- Registry Authentication does not mention non-globle credential-provider
- Make `bench` profile set `debug = true` by default HOT 2
- `debug-assertions` are implicitly disabled when running `cargo test` with `opt-level=3` set from `rustflags` HOT 3
- `cargo vendor` misses some files HOT 4
- Export environment `OUT_DIR` to proc-macro. HOT 1
- Port from bespoke assertions of snapbox HOT 7
- Tests fail if directory contains special characters HOT 2
- Get cargo environment without running code
- Build scripts only get `RUSTFLAGS` when not passing `--target` HOT 2
- Optionally generate "dep-info for external build system integration" for test and example binaries HOT 7
- Sharing TARGET_DIR leads to spurious missing items HOT 2
- `cargo --list` shows blank explanation for the `miri` command on windows HOT 3
- Cargo incorrectly identifies transitive dependency versions when compiling new dependencies HOT 2
- Allow "--extern" rustc flags in build script HOT 8
- error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101 HOT 1
- Failing to build cargo latest with cargo latest HOT 3
- Cannot `cargo install --path .` HOT 3
- On Windows's are not trimmed from authentication tokens during publish. HOT 1
- test: `with_stderr_(data|contains)` has no effect when chained with `run_expect_error()` HOT 2
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 cargo.