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 a statically built hab binary for use in the build toolchain for artifact signing #389

Merged
merged 20 commits into from
Apr 14, 2016

Conversation

fnichol
Copy link
Collaborator

@fnichol fnichol commented Apr 14, 2016

We did it, gang! A ~6mb static binary called hab which works for signing artifacts!

gif-keyboard-7346846609960770141

Why do I put it this way? I fear there are a few issues to iron out in the install logic as musl has a very small stack size by default (80k). This PR includes a patch which grows this to 2mb, but it's also a temporary fix. (References: musl git, musl wiki, example project failure, openvswitch mailing list).

Details aside though,

gif-keyboard-10064698851103045687

Namely, this adds support for the x86_64-unknown-linux-musl rustc
target. If more targets are required in the future, it's all just
arrays, yay!
@reset
Copy link
Collaborator

reset commented Apr 14, 2016

@fnichol just like with studio, this is exactly how I wanted it to turn out but wasn't sure if we'd be able to get there 100%. Just like with studio - we did!

gif-keyboard-298913849211777283

Merge after your rebase :)

fnichol added 9 commits April 14, 2016 14:59
This crate is no longer used anywhere in code and brings in more build
dependencies than we need.
This change ensures that we can build all crates and also only build the
binary targets. The default Makefile target will be `make bin` and `make
all` will compile all crates. Similarly, the `make clean` has been
augmented to clean all crates.
This was, frankly, a mistake when I was extracting and refactoring the
code; we really want these error cases.
fnichol added 10 commits April 14, 2016 15:01
This strips the dependency on `hab` until we either add it to the
`hab-bpm` Plan or replace `hab-bpm` altogether with `hab` itself.
This change is necessary as this release adds static compilation support
to the crate.
This change introduces a new Plan (under `components/hab/static`) which
uses a musl-based libc chain of dependencies and produces a ~6.0mb
statically built binary which should be portable enough to work in our
stage1 Studios and potentially on third-party 64-bit Linux operating
systems.

As a hedge on not getting everything totally right the first time, the
default build is an improved glibc-based, dynamic binary as before,
although using the `cargo build --release` flag for a tighter resulting
binary.
Note that the `pkg_gpg_key` still remains in `hab-plan-build` as we
haven't yet cut over to the new signing.
@fnichol fnichol force-pushed the fnichol/portable-hab branch from d61723c to dd7c7b2 Compare April 14, 2016 21:32
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

@bookshelfdave
Copy link
Contributor

gif-keyboard-14537891374303162381

@bookshelfdave
Copy link
Contributor

@delivery approve

@chef-delivery chef-delivery merged commit ce49a28 into master Apr 14, 2016
@chef-delivery
Copy link
Contributor

Change: f36c3b9c-953b-4a63-b6e5-834ad4906b43 approved by: @metadave

@chef-delivery chef-delivery deleted the fnichol/portable-hab branch April 14, 2016 21:47
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

Successfully merging this pull request may close these issues.

4 participants