Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTarget-specific features #1197
Comments
alexcrichton
added
the
A-features
label
Jan 20, 2015
This comment has been minimized.
This comment has been minimized.
|
cc @huonw |
randomPoison
referenced this issue
Jun 27, 2015
Closed
Simplified Target-Specific Dependencies #1758
This comment has been minimized.
This comment has been minimized.
|
Shouldn't this work? [target.'cfg(not(any(target_os = "android", target_os = "windows")))'.dependencies]
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
[target.'cfg(any(target_os = "android", target_os = "windows"))'.dependencies]
ipc-channel = {git = "https://github.com/servo/ipc-channel", features = ["inprocess"]} |
This comment has been minimized.
This comment has been minimized.
|
@nox in theory yeah that seems like it should work, but today due to the structure of I think that's a fixable bug, however, although likely quite invasive as it would require deferring calculation of features to the compilation phase rather than the resolution phase. |
added a commit
to nox/ipc-channel
that referenced
this issue
Jul 12, 2016
added a commit
to servo/ipc-channel
that referenced
this issue
Jul 12, 2016
eternaleye
referenced this issue
Sep 1, 2016
Open
[On Hold] Add support for builds without assembly. #256
nox
referenced this issue
Oct 5, 2016
Closed
Default features of dependencies get pulled in for no reason #3164
This comment has been minimized.
This comment has been minimized.
|
Ran into this extremely confusing bug today... |
gyscos
referenced this issue
Dec 16, 2016
Closed
error : note: ld: library not found for -lncursesw #89
This comment has been minimized.
This comment has been minimized.
gyscos
commented
Dec 20, 2016
•
|
Would this also allow specifying a target-specific [target.'cfg(not(target_os = "windows"))'.features]
default = ["general_feature"]
[target.'cfg(target_os = "windows")'.features]
default = ["winonly_replacement"]I suppose a workaround to get this would be an intermediate crate which depends on the actual crate with target-dependent features, but it doesn't sound very convenient. |
This comment has been minimized.
This comment has been minimized.
|
@gyscos that seems like a nifty and natural way to encode this information! I haven't though too much about the implications of target-specific features, but I don't particularly see any immediate reason to block anything. |
alexcrichton
referenced this issue
Feb 21, 2017
Closed
Cargo.toml should allow specifying different features based on target #3741
This comment has been minimized.
This comment has been minimized.
|
This isn't enough, I don't want my crate to stop working because someone used I guess one could use @retep998's trick of enabling a feature programatically from a |
This comment has been minimized.
This comment has been minimized.
|
@nox That enables features in code programmatically. It doesn't let me control dependencies, but for some people just controlling their code might be enough. The reason I even wrote that trick was due to the lack of support for cyclic features. https://github.com/retep998/winapi-rs/blob/dev/build.rs#L193 |
ashkitten
referenced this issue
Sep 20, 2017
Closed
(Optionally) work with fontconfig-sys instead of servo-fontconfig-sys #11
This comment has been minimized.
This comment has been minimized.
philn
commented
Oct 18, 2017
|
What's the status of this issue? It would be interesting to use target-specific features in gecko-media (enable pulseaudio only for linux for instance). |
This comment has been minimized.
This comment has been minimized.
|
@philn AFAIK no progress has been made |
gnzlbg
referenced this issue
Feb 4, 2018
Open
Platform specific dependencies documentation unclear #5005
This comment has been minimized.
This comment has been minimized.
praetp
commented
May 3, 2018
|
Hope we can see progress on this issue... |
added a commit
to ferjm/media
that referenced
this issue
Jul 10, 2018
This was referenced Jul 18, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 25, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 26, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 26, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 26, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 26, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 26, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 27, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 30, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 31, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 31, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 31, 2018
added a commit
to servo/servo
that referenced
this issue
Jul 31, 2018
added a commit
to lunaryorn/mdcat
that referenced
this issue
Aug 26, 2018
This comment has been minimized.
This comment has been minimized.
plyhun
commented
Oct 3, 2018
|
So is this a bug ( the |
This comment has been minimized.
This comment has been minimized.
|
@plyhun it's intended behavior that it's not supported, but it's a bug if Cargo doesn't warn you about unused keys. I'm not sure about whether or not adding the functionality requires an RFC, but if it becomes semi-large than I think it might! |
ncalexan
referenced this issue
Oct 16, 2018
Open
Make cargo build feature `dist-server` available only when targeting supported platform (Linux64) #314
added a commit
to snuk182/cargo
that referenced
this issue
Nov 8, 2018
This comment has been minimized.
This comment has been minimized.
stefandeml
commented
Nov 19, 2018
|
is there any work-around for this besides creating an intermediate crate which depends on the actual crate? - that's very ugly. |
alexcrichton commentedJan 20, 2015
It would be nice to support target-specific features for cases such as when certain functionality is only available on one platform or the default set of functionality should vary per-platform.