-
Notifications
You must be signed in to change notification settings - Fork 689
Add a conditional compilation system to allow features available only on some platforms. #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Well, I'd say it's an unrelated issue in regards to my proposal toward libstd, which is more about defining an abstraction layer over the OS for libstd to use. libstd has a lot of That said, moving all the
Not sure I understand what you mean by that, what's hard? Most items are |
Ah I see. Maybe I actually meant a file layout more like libc's then. A way to have a hierarchy of related systems, so that there's a clear place to put definitions. Then we can use conditional module imports instead of conditional definitions. It seems like less mental effort to me in terms of where to put things. |
Here's the section describing it in the libc RFC: https://github.com/alexcrichton/rfcs/blob/pomote-libc/text/0000-promote-libc.md#internal-structure |
Currently, I am against this change. libc has this structure and it fits with its concept. For us, I do not see the advantage, but am rather afraid it would lead to a lot of code duplication. This is the case in libc, and I do not see a way around that there. However, we can use that libc hides that fact, by using their constants and function declarations. This would leave us with configuring a few functions and certain constants in bitflags and enums in and out depending on platform. |
This makes sense. We should get fully onto libc definitions (#264) first, then see what it looks like. |
I think the current consensus is to defer on this. Should I close this issue and it can be revisited if necessary? |
681: Remove feature flags r=Susurrus These are vestiges of the initial push to get this working on Rust 1.0. These feature flags are undocumented and so hard to discover (only learned about them today!), prevent functions being included that should be and this also affects documentation on docs.rs, and none of the features are tested in CI and the `execvpe` has been broken for forever. The solution is to conditionally compile everything supported for a given platform and do away completely with the feature flags. The `execvpe` function is completely removed as it's not available for *nix platforms in libc and is already broken, so no loss removing it. We'll add it back once it's back in libc (rust-lang/libc#670). Closes #98. Closes #206. Closes #306. Closes #308.
681: Remove feature flags r=Susurrus These are vestiges of the initial push to get this working on Rust 1.0. These feature flags are undocumented and so hard to discover (only learned about them today!), prevent functions being included that should be and this also affects documentation on docs.rs, and none of the features are tested in CI and the `execvpe` has been broken for forever. The solution is to conditionally compile everything supported for a given platform and do away completely with the feature flags. The `execvpe` function is completely removed as it's not available for *nix platforms in libc and is already broken, so no loss removing it. We'll add it back once it's back in libc (rust-lang/libc#670). Closes #98. Closes #206. Closes #306. Closes #308.
I removed a number of bindings that were not generally portable in order to get everything compiling on Rust 1.0 beta. These should be brought back.
The text was updated successfully, but these errors were encountered: