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

Bindgen-based build tool that creates self-contained hybrid crates from foreign libraries #2805

Closed
brson opened this issue Jul 5, 2012 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jul 5, 2012

When I build bindings to foreign libraries now I prefer to build static native libraries and link them statically into the rust crate. This is a very convenient form for foreign libraries to be in because then you don't have to worry about native dynamic linking rules - everything is a rust crate and follows rust rules. Treating foreign libraries as crates is also potentially convenient for build tools like cargo, which currently has little or no support for them.

The process of constructing this type of hybrid crate is pretty straightforward but there isn't any language or tool support for it.
What I want is a little library that, given the proper configuration, will

  • Run custom build logic to generate a static library archive file at a specific location
  • Run bindgen to generate the rust bindings
  • Output the proper set of attributes to make rust find and link to the static library

This could start out as a standalone build tool, but would need to end up compatible with cargo, and possibly even a rustc plugin that does the building, linking and bindgenating.

@catamorphism
Copy link
Contributor

far-future, I think.

@bblum
Copy link
Contributor

bblum commented Aug 16, 2013

appears to be properly classified, save to say that "bindgenating" is a great word

@emberian
Copy link
Member

emberian commented Nov 4, 2013

Visiting for triage. These seems to be a bit non-trivial, since bindgen doesn't always work 100%, and that a pure-bindgenated library often isn't the API you'd want to use (you'd usually want a safe API).

Seems like a good first step would be getting a simple shell-script to do the proper steps. Marking as E-easy, since this script should be straightforward.

@brson
Copy link
Contributor Author

brson commented Jan 13, 2015

Super-wishlist. Not an in-tree project.

@brson brson closed this as completed Jan 13, 2015
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Adds a set of scripts to automate building and installing most
dependencies in Amazon Linux 2 environments.

This will make it easier to provide ARM64 binaries for Linux (see
rust-lang#2805). The installation of dependencies isn't minimal but improves our
situation w.r.t. AL2.

Testing done manually on remote AL2 ARM64 instances, after running this
I'm able to run the regression successfully.

### Callouts
 * Hasn't been tested on AL2 x86.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants