dirs-dev / dirs-sys-rs Goto Github PK
View Code? Open in Web Editor NEWsystem-level helper functions for the dirs and directories crates
Home Page: https://dirs.dev
License: Apache License 2.0
system-level helper functions for the dirs and directories crates
Home Page: https://dirs.dev
License: Apache License 2.0
dirs_sys::user_dir
is only defined for Linux and Redox.
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:17:56
|
17 | pub fn audio_dir() -> Option<PathBuf> { dirs_sys::user_dir("MUSIC") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:18:56
|
18 | pub fn desktop_dir() -> Option<PathBuf> { dirs_sys::user_dir("DESKTOP") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:19:56
|
19 | pub fn document_dir() -> Option<PathBuf> { dirs_sys::user_dir("DOCUMENTS") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:20:56
|
20 | pub fn download_dir() -> Option<PathBuf> { dirs_sys::user_dir("DOWNLOAD") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:22:56
|
22 | pub fn picture_dir() -> Option<PathBuf> { dirs_sys::user_dir("PICTURES") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:23:56
|
23 | pub fn public_dir() -> Option<PathBuf> { dirs_sys::user_dir("PUBLICSHARE") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:24:56
|
24 | pub fn template_dir() -> Option<PathBuf> { dirs_sys::user_dir("TEMPLATES") }
| ^^^^^^^^ not found in `dirs_sys`
error[E0425]: cannot find function `user_dir` in module `dirs_sys`
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/dirs-2.0.0/src/lin.rs:25:56
|
25 | pub fn video_dir() -> Option<PathBuf> { dirs_sys::user_dir("VIDEOS") }
| ^^^^^^^^ not found in `dirs_sys`
If ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs
does not exist, or lacks the specified key (e.g. XDG_DOWNLOAD_DIR
), the behaviour of xdg-user-dir
the CLI program is to output $HOME
.
In the same case, the behaviour of dirs::download_dir()
(for example) is to return None
.
There's no specification as such for '"well known" user directories', but it's implied that this is the intended fall-back behaviour:
Note: To disable a directory, point it to the homedir.
https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
cf. tauri-apps/tauri#3090, xdg-rs/dirs#56 (I opened there as that's what I'm using, via tauri, but it seems to affect dirs
too, so I've copied here.)
PS C:\Users\steve> wasmer create-exe test.wasm -o test.exe --target x86_64-pc-windows-gnu --llvm
Cached tarball to cache path `C:\Users\steve\scoop\apps\wasmer\current\cache\wasmer-windows-gnu64.tar.gz`.
Compiler: llvm
Target: x86_64-pc-windows-gnu
Format: Symbols
Library Path: C:\Users\steve\scoop\apps\wasmer\current\cache\wasmer-windows-gnu64\lib\libwasmer.a
Using zig binary: C:\Users\steve\scoop\shims\zig.exe
Using zig target triple: x86_64-windows-gnu
error: error: lld-link: undefined symbol: CoTaskMemFree
>>> referenced by libwasmer.a(dirs_sys-ad4d6117404657e1.dirs_sys.3e403b3a-cgu.1.rcgu.o):(dirs_sys::target_windows::known_folder::h1663f056389cb40d)
>>> referenced by libwasmer.a(dirs_sys-ad4d6117404657e1.dirs_sys.3e403b3a-cgu.1.rcgu.o):(dirs_sys::target_windows::known_folder::h1663f056389cb40d)
>>> referenced by libwasmer.a(dirs_sys-ad4d6117404657e1.dirs_sys.3e403b3a-cgu.1.rcgu.o):(dirs_sys::target_windows::known_folder_profile::h94e80d06b999375b)
>>> referenced 21 more times
The error message leads me here
e169da7 introduced a dependency on option-ext
. That crate is licensed under the Mozilla Public License 2.0, a weak-copyleft license that is more restrictive than either MIT or Apache 2.0.
(Although MPL is a file-level license that is not "viral" to projects using it as long as the files in question are not changed, the fact remains that it's more restrictive; for example, MIT allows sublicensing and MPL 2.0 does not.)
As a result, we (zcash/zcash) cannot upgrade to dependencies using dirs-sys
0.4.1 because it would violate our licensing policy. This is particularly problematic because according to semver, 0.4.1 is supposed to be a non-breaking release from 0.4.0, which did not have the MPL dependency.
dirs-sys
0.4.1 was just released and comes w/ a new dependency option-ext
. I think this is a bit unfortunate due to two reasons:
dirs-sys
is a rather low-level crate and just pulling a unused dependency just for a bit of Option
convenience seems a bit excessive. Note that option-ext
was basically unused by the Rust ecosystem prior to this release:dirs-sys
(and all other dirs-dev
project) are licensed under Apache2 + MIT (which is the de facto default for the Rust ecosystem), option-ext
is MPL which is a copyleft license.I can file a fix PR if this is OK w/ the maintainers.
Not sure how propagating licences work, but since dirs-rs depends on dirs-sys which depends on option-ext, which is using MPL 2.0 licensce. This cannot be used in closed source projects.
I sadly have no way around this and cannot open source what I use, so I cannot use dirs-rs due to this.
Afaik rust 1.76 has inspect on option types which can replace this dependency.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.