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

Support compile time linking. #173

Open
wmedrano opened this issue Apr 10, 2022 · 7 comments
Open

Support compile time linking. #173

wmedrano opened this issue Apr 10, 2022 · 7 comments

Comments

@wmedrano
Copy link
Member

wmedrano commented Apr 10, 2022

It was removed in 0.10.0 in favor of manually finding the dynamic library and loading symbols.

@Be-ing

This comment was marked as resolved.

@wmedrano wmedrano changed the title Support static linking. Support compile time linking. Apr 10, 2022
@robbert-vdh
Copy link
Member

As I mentioned in #179, the jack crate now always links to libjack, even if the dynamic loading feature is enabled. If the dynamic_loading feature is enabled, then the dynamic linking modules probably shouldn't be generated and included.

@wmedrano
Copy link
Member Author

wmedrano commented Nov 7, 2022

As I mentioned in #179, the jack crate now always links to libjack, even if the dynamic loading feature is enabled. If the dynamic_loading feature is enabled, then the dynamic linking modules probably shouldn't be generated and included.

How does #180 look?

@robbert-vdh
Copy link
Member

robbert-vdh commented Nov 7, 2022

I guess that probably works. Does functions::dynamic_loading always need to be re-exported (or be available even) even when using compile-time dynamic linking?

@andrewbaxter
Copy link

In Nix, I think the Cargo package wrapper uses patchelf to change dynamically linked paths to the correct place on the built system. I think this essentially operates on the information displayed by ldd.

Because libjack2.so.0 is runtime (? manually? programmatically?) linked it's not discovered and updated, and it fails to start at runtime.

I realize Nix users might be minor, but I think there's many other tools that rely on ldd information and libjack may be used in a wide variety of software, some of which may be impacted.

@wmedrano
Copy link
Member Author

  1. @andrewbaxter do you know if things can work with default-features = false? This should disable the dynamic loading.
  2. libjack2.so.0 is hardcoded, I think. We can allow injecting it but I'm not even sure that is very Nix like.
  3. For nix, I'm sorry but it isn't something I run or want to spend time looking into. 🙃 However, if you have some examples on how to make a GitHub action setup for testing nix stuff we can try to include it to make supporting and not breaking nix a bit better.

@andrewbaxter
Copy link

Thanks for the gracious offer!

To be clear, I wasn't asking for nix support. I was just adding a use case where having compile time linking vs dlopen. If compile time linking is supported then nix should be fine, as long as that's used.

  1. do you know if things can work with default-features = false? This should disable the dynamic loading.

Sorry, I'm not sure I'm entirely following. In your first post you said

It was removed in 0.10.0

Was it re-added afterward? In that case maybe this issue could be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants