-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
linking problem on extern "C" fn called via trait method (on type parameter) in other crate #10543
Comments
The reason that this is happening is that generic code is instantiated in the client crate, and the client crate is not linking to ncurses. This was an explicit decision as part of 2b9c774 to stop propagating link arguments across crates. The reason for doing so is that if we unconditionally propagate linker arguments there is no way to have a build dependency that is not distributed alongside a rust library. I believe that this can be revisited after #10528 lands because that already adds back propagation to a certain degree (one which I am much more comfortable with). |
Okay, I'll assign this to myself as a reminder to double-check on it (and hopefully close it after we've landed #10528, assuming that enables reasonable propagation). |
The static linking pull request will not close this in its current incarnation. I'd want to talk about this more broadly to make sure that we want to continue to propagate dependencies, but I believe that we'll be much more amenable to it this time around rather than before. |
Closing as a dupe of #10743 |
…flip1995 Add `tests_outside_test_module` lint Adds `tests_outside_test_module` from rust-lang#10506. This PR **doesn't** close the issue, just resolves task 1. changelog: [`tests_outside_test_module`]: The lint has been added
Add `items_after_test_module` lint Resolves task *3* of rust-lang#10506, alongside *1* resolved at rust-lang#10543 in an effort to help standarize a little bit more testing modules. --- changelog:[`items_after_test_module`]: Added the lint.
While spending some time playing with a ncurses wrapper library (one of many), I encountered the following odd linking problem. I have one crate which attempts to link to the system ncurses library via
#[link_args="-lncurses"]
, and then a main program that pulls in the first crate.However, the crate that links to the system ncurses library is also exposing functionality via type-parametric methods, and something seems to go wrong with the linkage due to this, AFAICT.
Here is the example:
main crate (call it
ncurses.rs
):main program (
ncurses-intro.rs
):Invocation that works (by sidestepping type-parametricity):
Invocation that illustrates the bug (by using the desired type parametric form):
The text was updated successfully, but these errors were encountered: