-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove support for targets without libc #1125
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
@gnzlbg given our discussion on IRC, would you be ok closing this? |
Yes, to summarize the discussion: libc should always compile. In targets that are not supported (e.g. because they haven't been implemented yet, have no libc, etc.), the crate should just be empty. This is also what winapi-rs does. I discussed this with @retep998 as well, and this approach has pros and cons. The big pro is that if code that uses libc gets compiled to an unsupported platform, it might just work as long as the dependencies don't use libc for that platform. This is particularly important for libc because many targets have a libc of some sorts. The downsides are that libc and winapi are then downloaded and compiled on platforms in which they are not used, and their presence in the dependency tree can affect dependency resolution (e.g. TBH I don't think that these downsides are worth fixing in these crates. It is unclear which way is the right way to do things (there might not be a right way here). These fixes definitely don't add enough value in my opinion to justify the breakage they would cause. The |
@japaric correctly pointed out in #375 that the
libc
crate is for linking againstlibc
.We currently have a lot of hacks and workarounds to "support" a variety of targets that do not have a libc, are often only interested in c types and would be better served by using the
cty
crate, and that actually we don't really "support" because we don't even test that we build for these targets and technically we can't test that the ABI specified here matches that of the target'slibc
because... there isn't any.In particular, for some targets without a
libc
, currentlylibc
is empty. That's the approach that thewinapi
crate follows on linux but is not the approach thatmach
follows on osx.cc @alexcrichton @malbarbo I think we should clean up
libc
from supporting these targets and make clear in the README whatlibc
is for.The text was updated successfully, but these errors were encountered: