Does cargo have any mechanism to a certain transit...
# development
w
Does cargo have any mechanism to a certain transitive dependency based on OS, or some other mechanism (other than forking the library)? One of our dependency updates just pulled in another set of libraries for redox-os support, and until we actively support that, I don't know why we would pull in this dep
There are no features to disable this at the top-level dep, or even at the lower-level dep
f
Yes. I verified with Claude but you can use this syntax in `Cargo.toml`:
Copy code
[target.'cfg(target_os = "windows")'.dependencies]
winapi = "0.3"

[target.'cfg(target_os = "linux")'.dependencies]
openssl = "0.10"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
As for removing a dependency, will have to think about that, these are about overriding or adding dependencies.
Claude doesn't see a way to exclude transitive deps.
w
Right, I knew about adding dependencies - it's the removal part I don't know
Other than forking and doing something like that
f
yeah I'm thinking we'd have to fork and try and upstream a change to the other project
What project is it?
w
scie-pants -> dirs -> dirs-sys
f
Maybe we should just replace the dep? https://github.com/dirs-dev/dirs-rs shows it as archived.
w
It was just moved to codeberg
f
ah
w
I have to look how we use it, but if we use it as I think, the dep likely shouldn't exist. Just points to system directories on multiple platforms. That's nice, but, dunno - seems trivial
Anyways, something to investigate later - it's an aside of what Im doing
Override the dependency to use this version of
dirs-sys
The upstream project has restricted the
redox_users
crate to just redox already.
and that version appears to be published as
0.5.0
w
Pretty sure that's what we're using already
still gets pulled into our lockfile though, from what I can see
f
Ah and then we still have to download the dependency and decide to not build it?
w
As far as I can see. But even still that redox_users transitively pulls in more stuff. So, trying to clean up cruft that has no business being there, or updated, or whatever. I'd have to clean my cache to be sure