-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add SGX C types #1129
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
Add SGX C types #1129
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This avoids duplicating all the common Almost empty because we have to include the |
I would personally prefer to land #1124 myself. I realize the The most common operation for Due to the nature of inheritance of APIs are you move up the module hierarchy to the root, adding a new platform is often a nontrivial task because APIs need to be duplicated into submodules as they can no longer be inherited on one platform or another. This duplication is fine, though, because it's still easy to read the crate and modify it, and all bindings are verified to be correct. Historically I've found that 100% of the time any attempt to be more clever by sharing various subsets of APIs has ended in tears long-term. Sticking to a simple rule has been tried-and-true for quite some time now with For all that I'd prefer to go the route of #1124 which preserves the current organization of |
I'd be fine with copy pasting the libc module into the submodules and remove it. But I'd prefer to have a single For example, if you move things into submodules like in #1124 , all tests pass, but we don't have any tests checking for API removal, and IIUC #1124 removes all the stuff in the In fact, looking at this PR, I think it is wrong. We need an |
Oh sorry yeah I'm not saying that we should take literally #1124, but I want to avoid adding multiple roots or multiple children for a submodule because it sets a very dangerous precedent that makes it very difficult to modify the library in the future. It's true that we don't have tests for removal of APIs, because that's a major project that requires a huge amount of effort and really doesn't have that much benefit where we can otherwise just be vigilant during reviews. |
I'm not sure I fully understand what you mean by multiple roots and multiple children, but I don't really mind the duplication either as long as it is clear where to add what for which targets.
I'll check cargo semverver out and see if I can set it up for some targets at least. Should be able to detect the most common API breaking changes. |
Er sorry, I mean that with respect to the module hierarchy. Currently for any one platform there's just a straight line of a module hierarchy, which makes it easy to know what's included, but with a PR like this there's optionally two different child nodes of the root (the ctypes/libc modules) |
I am not sure I understand. On the root there is only a We could copy paste these into each submodule, and also, in the "default" branch of the |
I think what @alexcrichton is saying is that there are multiple locations in |
Indeed yeah, but not only is it odd to have multiple The |
So I'll update this PR with that, but I would prefer not to merge until we are sure that we are not removing APIs from any cfg node. |
Ok! What do you think about landing this in the meantime and we can verify afterwards? Also FWIW I think that it's probably fine to move definitions like |
@bors: r+ I'll send a different PR moving those to the root. |
📌 Commit 5c1a6b8 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
cc @jethrogb