Make the 'rawfd' feature a NOP on Windows#373
Conversation
|
I can make this a bit more clear using cfg_aliases, so instead of #[cfg(all(feature = "rawfd", not(target_os = "windows")))]we can use something like #[cfg("rawfd")] |
|
I don’t like it very much that this way, on Windows, the feature will still be enabled, but silently just not do anything. I know that is a very lukewarm stance and a problem you have probably already considered, but it is not weighed on in the commit message, hence me commenting on it. So: There is no other way, right? To change the default-features list only on Windows, or at least any way to detect the feature being enabled explicitly, and fail then. (In any case, CHANGELOG.md should get an entry, I think.) |
Yes, I'm not happy too, but I don't see another way without breaking the default behavior on linux
I'm not aware of another way, sadly there is nothing like
Ok, I'll explain the problem in the commit msg and add and changelog entry |
Maybe (not sure, I never used it) I can use cargo_metadata to do some heuristic inside a |
4652699 to
1f96b9f
Compare
It seems it will not work for this purpose. |
|
I did this to keep the SemVer compatibility, but since the next 0.18.0 version already includes a major change in the API, I can just remove the |
0.18.0 has already been released, unfortunately. |
Ops my mistake I'll change the CHANGELOG then |
Signed-off-by: German Maglione <gmaglione@redhat.com>
When `rawfd' feature was introduced on commit 0b7a437, it was enabled by default to avoid breaking the default behavior on linux. So, on Windows, vm-memory must be included with 'default-features = false' otherwise it fails to compile. This is problematic for projects that depend indirectly on vm-memory and fail if their dependencies don't set 'default-features = false'. Since there is no current way to set the default feature set for a specific target OS, let's make the 'rawfd' feature a NOP for Windows builds, the feature will still be enabled, but silently just not do anything. Signed-off-by: German Maglione <gmaglione@redhat.com>
1f96b9f to
f7e90d7
Compare
Summary of the PR
When `rawfd' feature was introduced on commit 0b7a437, it was enabled
by default to avoid breaking the default behavior on linux. So, on
Windows, vm-memory must be included with 'default-features = false'
otherwise it fails to compile. This is problematic for projects that
depend indirectly on vm-memory and fail if their dependencies don't
set 'default-features = false'.
Since there is no current way to set the default feature set for a
specific target OS, let's make the 'rawfd' feature a NOP for Windows
builds, the feature will still be enabled, but silently just not do
anything.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.