Skip to content
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

undefined reference to linker error when using from nightly rustc #2684

Closed
fpoli opened this issue Nov 5, 2021 · 4 comments
Closed

undefined reference to linker error when using from nightly rustc #2684

fpoli opened this issue Nov 5, 2021 · 4 comments
Labels
C-bug Category: bug. Something is wrong. This is bad!

Comments

@fpoli
Copy link

fpoli commented Nov 5, 2021

In our project we use rustc nightly-2021-10-15 and we encountered a compiler bug that prevents us upgrading from hyper 0.13, warp 0.2, reqwest 0.10, tokio 0.2 to hyper 0.14, warp 0.3, reqwest 0.11, tokio 1.2 (working, not working commit).

It seems that the cause is the C ffi:

crate-type = ["lib", "staticlib", "cdylib"]

Removing that line solves the issue: alexkornitzer@1199048

I know that this is not exactly a bug in hyper, but since the C API is unstable I wonder if there is a way to set that crate-type only in the build that generates the C library. At least, until the compiler is fixed.

@fpoli fpoli added the C-bug Category: bug. Something is wrong. This is bad! label Nov 5, 2021
@seanmonstar
Copy link
Member

Unfortunately we currently can't. There's no way for people to enable only a cdylib on-demand. But #2685 is tracking that.

@sfackler
Copy link
Contributor

sfackler commented Nov 5, 2021

Couldn't the C interface be moved to a separate crate from hyper itself?

@seanmonstar
Copy link
Member

The C interface makes uses of private details, so to use them in a separate crate would require making those "public".

@bjorn3
Copy link

bjorn3 commented Nov 5, 2021

An option would be to only expose them when a certain cfg is used. If it is something like foo and not feature = "foo" you can only set it using RUSTFLAGS and not when specifying it as dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

4 participants