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

[bldr-build] Add pkg_build_deps and PATH fixes. #109

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

fnichol
Copy link
Collaborator

@fnichol fnichol commented Dec 10, 2015

Build Dependencies

This change introduces a new Plan variable: pkg_build_deps, also known
as build dependencies. This is an array, similar to pkg_deps
containing a list of packages needed to build the plan, but not to
run the resulting package. For example, a Redis plan may have a
build dependency on gcc and make.

The dependency metadata is added to the package metadata and a new file
BUILD_DEPS is also created. This gives bldr packages enough metadata
to answer the following questions (previously difficult or impossible to
determine):

  • What verion of gcc was I build with?
  • What version of musl was statically compiled into me?
  • What version of Go built this service?

Remove gpg-zip Dependency

Previously, a wrapping script gpg-zip was used to tar and gpg sign the
resulting bldr package. This has been replaced with a comparable
tar ... | gpg ... form which now only requires the gpg binary being
present in the build environment. A future version of the build
environment may add a statically built gpg binary to simplify the
build dependency chain of bldr-build itself.

Build-Time PATH Calculation

This change prepends its own pkg_binary_path and all dependant build
and runtime dependencies' pkg_binary_path to the current PATH before
the build callbacks are invoked. The build dependencies' PATH entries
will be added before the runtime dependencies, which is either the
correct behavior or a future technical flaw (time will tell here).

Build Dependencies
------------------

This change introduces a new Plan variable: `pkg_build_deps`, also known
as build dependencies. This is an array, similar to `pkg_deps`
containing a list of packages needed to **build** the plan, but not to
**run** the resulting package. For example, a Redis plan may have a
build dependency on gcc and make.

The dependency metadata is added to the package metadata and a new file
`BUILD_DEPS` is also created. This gives bldr packages enough metadata
to answer the following questions (previously difficult or impossible to
determine):

* What verion of gcc was I build with?
* What version of musl was statically compiled into me?
* What version of Go built this service?

Remove gpg-zip Dependency
-------------------------

Previously, a wrapping script `gpg-zip` was used to tar and gpg sign the
resulting bldr package. This has been replaced with a comparable
`tar ... | gpg ...` form which now only requires the `gpg` binary being
present in the build environment. A future version of the build
environment may add a statically built `gpg` binary to simplify the
build dependency chain of `bldr-build` itself.

Build-Time PATH Calculation
---------------------------

This change prepends its own `pkg_binary_path` and all dependant build
and runtime dependencies' `pkg_binary_path` to the current `PATH` before
the build callbacks are invoked. The build dependencies' `PATH` entries
will be added before the runtime dependencies, which is either the
correct behavior or a future technical flaw (time will tell here).
@fnichol
Copy link
Collaborator Author

fnichol commented Dec 10, 2015

gif-keyboard-11134035180357796279

@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.

fi
done
# Insert all the package PATH fragments before the default PATH to ensure
# Bldr package binaries are used before any userland/operating system binaries
if [[ -n $path_part ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig it the most.
gif-keyboard-13471314679728295825

@adamhjk
Copy link
Contributor

adamhjk commented Dec 10, 2015

This looks great. Useful functionality, well implemented - you pass the "can write shell" test. :)

gif-keyboard-5540083876493645731

@adamhjk
Copy link
Contributor

adamhjk commented Dec 10, 2015

@delivery approve

@chef-delivery
Copy link
Contributor

Change: e38c8040-9cf4-4f2d-938b-139137eb9dc6 approved by: @adamhjk

chef-delivery added a commit that referenced this pull request Dec 10, 2015
Merged change e38c8040-9cf4-4f2d-938b-139137eb9dc6

From review branch bldr-build-updates into master

Signed-off-by: adam <[email protected]>
@chef-delivery chef-delivery merged commit 26816c4 into master Dec 10, 2015
@chef-delivery chef-delivery deleted the bldr-build-updates branch December 10, 2015 20:26
@fnichol
Copy link
Collaborator Author

fnichol commented Dec 10, 2015

Yes, party time! 🍰

Wait for the next PR though, more shell writing 😄

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.

3 participants