diff --git a/components/depot/habitat/plan.sh b/components/depot/habitat/plan.sh index 1282b64414..355bcad316 100644 --- a/components/depot/habitat/plan.sh +++ b/components/depot/habitat/plan.sh @@ -4,8 +4,8 @@ pkg_version=0.6.0 pkg_maintainer="The Habitat Maintainers " pkg_license=('apachev2') pkg_source=nosuchfile.tar.gz -pkg_deps=(core/glibc core/gcc-libs core/libarchive core/libsodium core/openssl) -pkg_build_deps=(core/coreutils core/cacerts core/rust core/gcc) +pkg_deps=(core/glibc core/gcc-libs core/libarchive core/libsodium core/openssl core/zeromq) +pkg_build_deps=(core/coreutils core/cacerts core/rust core/gcc core/pkg-config) pkg_bin_dirs=(bin) srv_bin="hab-depot" pkg_svc_run="bin/$srv_bin start -c ${pkg_svc_path}/config.toml" @@ -27,6 +27,7 @@ do_prepare() { export OPENSSL_LIB_DIR=$(pkg_path_for openssl)/lib export OPENSSL_INCLUDE_DIR=$(pkg_path_for openssl)/include export SODIUM_LIB_DIR=$(pkg_path_for libsodium)/lib + export LIBZMQ_PREFIX=$(pkg_path_for zeromq) } do_build() { diff --git a/components/hab/install.sh b/components/hab/install.sh index bc94b5bd38..74fb433c50 100755 --- a/components/hab/install.sh +++ b/components/hab/install.sh @@ -6,7 +6,7 @@ set -eu if [ -n "${DEBUG:-}" ]; then set -x; fi # Download URL for a `core/hab` Habitat slim archive -_url="https://s3-us-west-2.amazonaws.com/habitat-initial-hab/hab-0.6.0-20160610173900-x86_64-linux.tar.gz" +_url="https://s3-us-west-2.amazonaws.com/habitat-initial-hab/hab-0.6.0-20160612014820-x86_64-linux.tar.gz" _q="" # _url='https://api.bintray.com/content/habitat/stable/linux/x86_64/hab-$latest-x86_64-linux.tar.gz' # _q="?bt_package=hab-x86_64-linux" diff --git a/components/plan-build/bin/hab-plan-build.sh b/components/plan-build/bin/hab-plan-build.sh index cff3a4a143..ed20f7658b 100755 --- a/components/plan-build/bin/hab-plan-build.sh +++ b/components/plan-build/bin/hab-plan-build.sh @@ -453,6 +453,7 @@ _ensure_origin_key_present() { # The following variables are set which contain an absolute path to the desired # command: # +# * `$_hab_cmd` (hab cli for signing, hashing, and possibly installing) # * `$_sort_cmd` (GNU version from coreutils) # * `$_wget_cmd` (wget on system) # * `$_shasum_cmd` (either gsha256sum or sha256sum on system) @@ -596,10 +597,9 @@ _resolve_dependency() { } # **Internal** Attempts to download a package dependency. If the value of the -# `$HAB_BIN` variable is not set or the value does not resolve to an -# executable binary, then no installation will be attempted. If an installation -# is attempted but there is an error, this function will still return with `0` -# and is intended to be "best effort". +# `$NO_INSTALL_DEPS` variable is set, then no package installation will occur. +# If an installation is attempted but there is an error, this function will +# still return with `0` and is intended to be "best effort". # # ``` # _install_dependency acme/zlib @@ -607,7 +607,7 @@ _resolve_dependency() { # _install_dependency acme/zlib/1.2.8/20151216221001 # ``` _install_dependency() { - if [[ -x "$HAB_BIN" ]]; then + if [[ -z "${NO_INSTALL_DEPS:-}" ]]; then $HAB_BIN install -u $HAB_DEPOT_URL "$dep" || true fi return 0 @@ -698,25 +698,25 @@ _attach_whereami() { } # **Internal** Determines what command/binary to use for installation of -# package dependencies. The `$HAB_BIN` variable will either be set or emptied -# according to the following criteria (first match wins): +# package dependencies, signing, and hashing files. The `$HAB_BIN` variable +# will either be set or emptied according to the following criteria (first +# match wins): # -# * If a `$NO_INSTALL_DEPS` environment variable is set, then set `$HAB_BIN` -# to an empty/unset value. # * If a `$HAB_BIN` environment variable is set, then use this as the absolute # path to the binary. # * Otherwise `$_hab_cmd` is used, set in the `_find_system_commands()` # function -_determine_pkg_installer() { +_determine_hab_bin() { if [ -n "${NO_INSTALL_DEPS:-}" ]; then - HAB_BIN= build_line "NO_INSTALL_DEPS set: no package dependencies will be installed" - elif [ -n "${HAB_BIN:-}" ]; then + fi + + if [[ -n "${HAB_BIN:-}" ]]; then HAB_BIN=$HAB_BIN - build_line "Using set HAB_BIN=$HAB_BIN for dependency installs" else HAB_BIN="$_hab_cmd" fi + build_line "Using HAB_BIN=$HAB_BIN for installs, signing, and hashing" } # **Internal** Validates that the computed dependencies are reasonable and that @@ -2231,7 +2231,7 @@ _find_system_commands # Enure that the origin key is available for package signing _ensure_origin_key_present -_determine_pkg_installer +_determine_hab_bin # Download and resolve the depdencies _resolve_dependencies diff --git a/components/studio/libexec/hab-studio-type-stage1.sh b/components/studio/libexec/hab-studio-type-stage1.sh index aa05cebbc2..efd7e31452 100644 --- a/components/studio/libexec/hab-studio-type-stage1.sh +++ b/components/studio/libexec/hab-studio-type-stage1.sh @@ -8,7 +8,7 @@ studio_build_command= studio_run_environment= studio_run_command= -: ${STAGE1_TOOLS_URL:=http://s3-us-west-2.amazonaws.com/fnichol-lfs-tools/lfs-tools-20160424150124.tar.xz} +: ${STAGE1_TOOLS_URL:=https://s3-us-west-2.amazonaws.com/habitat-studio-stage1/habitat-studio-stage1-20160612022150.tar.xz} : ${TAR_DIR:=/tmp} finish_setup() { diff --git a/plans/build-base-plans.sh b/plans/build-base-plans.sh index eb6ef0f784..7b11c7e08f 100755 --- a/plans/build-base-plans.sh +++ b/plans/build-base-plans.sh @@ -248,10 +248,10 @@ cat <<_PLANS_ | while read plan; do _build $plan; done openssl wget unzip - busybox-static rust linux-headers-musl musl + busybox-static zlib-musl bzip2-musl xz-musl diff --git a/plans/build_order.rb b/plans/build_order.rb index c4494587f1..888b6c223f 100755 --- a/plans/build_order.rb +++ b/plans/build_order.rb @@ -63,12 +63,15 @@ def tsort_each_child(node, &block) bash_prog.close all_deps = Sortable.new({}) +ident_to_plan = {} ARGF.each_line do |file| raw = `bash #{bash_prog.path} #{file}`.chomp ident, _, deps_str = raw.partition(/\n/) if ident.start_with?('core/') all_deps.add(ident, deps_str.split(' ') .map { |d| d.split('/').first(2).join('/') }) + ident_to_plan[ident] = \ + file.chomp.sub(%r{/habitat/plan.sh$}, '').sub(%r{/plan.sh}, '') end end @@ -87,4 +90,6 @@ def tsort_each_child(node, &block) sorted_deps.delete_if { |dep| base_deps.include?(dep) } end -puts sorted_deps +sorted_deps.each do |ident| + puts "#{ident} #{ident_to_plan[ident]}" +end diff --git a/plans/openssl-0.9.8/plan.sh b/plans/openssl-0.9.8/plan.sh deleted file mode 100644 index 1260aa6df4..0000000000 --- a/plans/openssl-0.9.8/plan.sh +++ /dev/null @@ -1,28 +0,0 @@ -pkg_origin=core -pkg_name=openssl-0.9.8 -pkg_version=0.9.8zg -pkg_license=('BSD') -pkg_source=http://openssl.org/source/openssl-${pkg_version}.tar.gz -pkg_dirname=openssl-0.9.8zg -pkg_shasum=06500060639930e471050474f537fcd28ec934af92ee282d78b52460fbe8f580 -pkg_deps=(core/glibc core/zlib core/cacerts) -pkg_bin_dirs=(bin) -pkg_lib_dirs=(lib) -pkg_include_dirs=(include) - -do_build() { - ./config \ - --prefix=${pkg_prefix} \ - no-idea \ - no-mdc2 \ - no-rc5 \ - zlib \ - shared \ - disable-gost \ - $CFLAGS \ - $LDFLAGS \ - -Wl,-rpath,$LD_RUN_PATH - make depend - make -} - diff --git a/plans/radiant/hooks/init b/plans/radiant/hooks/init deleted file mode 100644 index 3d0aa700c2..0000000000 --- a/plans/radiant/hooks/init +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -export RADIANT_HOME="{{pkg.path}}" -export RADIANT_DATA="{{pkg.svc_data_path}}" - -echo "Removing previous version deployed at ${RADIANT_DATA}" -rm -rf ${RADIANT_DATA}* - -echo "Deploying new version from ${RADIANT_HOME} to ${RADIANT_DATA}" -cp -a ${RADIANT_HOME}/dist ${RADIANT_DATA} - -# echo "Linking radiant.conf" -# ln -s {{pkg.svc_config_path}}/radiant.conf ${RADIANT_DATA}/dist/config/radiant.conf - -export GEM_HOME="${RADIANT_DATA}/dist/vendor/bundle" -export GEM_PATH="$(hab-bpm pkgpath core/bundler)" -export LD_LIBRARY_PATH="$(hab-bpm pkgpath core/gcc-libs)/lib" -export PATH="$PATH:${RADIANT_DATA}/dist/bin" -export RAILS_ENV="production" - -# mkdir -p ${RADIANT_DATA}/dist/log -# touch ${RADIANT_DATA}/dist/log/production.log - -chown -R hab:hab ${RADIANT_DATA}/dist -cd ${RADIANT_DATA}/dist - -exec 2>&1 - -if [[ ! -f ${RADIANT_DATA}/.migrations_complete ]]; then - echo "Running 'rake db:create db:migrate' in ${PWD}" - exec chpst -u hab bin/rake db:create db:migrate && touch $RADIANT_DATA/.migrations_complete -fi diff --git a/plans/radiant/hooks/run b/plans/radiant/hooks/run deleted file mode 100644 index b2ad213b5f..0000000000 --- a/plans/radiant/hooks/run +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -export RADIANT_DATA="{{pkg.svc_data_path}}" -export GEM_HOME="${RADIANT_DATA}/dist/vendor/bundle/ruby/2.3.0" -export GEM_PATH="$(hab-bpm pkgpath core/ruby)/lib/ruby/gems/2.3.0:$(hab-bpm pkgpath core/bundler):$GEM_HOME" -export LD_LIBRARY_PATH="$(hab-bpm pkgpath core/gcc-libs)/lib" -export PATH="$PATH:${RADIANT_DATA}/dist/bin" -export RAILS_ENV="production" - -cd $RADIANT_DATA/dist - -exec 2>&1 -exec chpst -u hab ./bin/rails server diff --git a/plans/radiant/plan.sh b/plans/radiant/plan.sh deleted file mode 100644 index 69bb551940..0000000000 --- a/plans/radiant/plan.sh +++ /dev/null @@ -1,110 +0,0 @@ -pkg_name=radiant -pkg_version=2.0.0-alpha-jt - -pkg_origin=core -pkg_maintainer="The Habitat Maintainers " -pkg_license=('mit') - -pkg_source=https://github.com/jtimberman/radiant/archive/${pkg_version}.tar.gz -pkg_shasum=24e6527eec98df16f3857f3d0cdf630729b0b833117589c32b98b0078f1bea05 - -pkg_deps=( - core/bundler - core/cacerts - core/glibc - core/libffi - core/libxml2 - core/libxslt - core/libyaml - core/openssl - core/postgresql - core/ruby - core/sqlite - core/zlib -) - -pkg_build_deps=( - core/coreutils - core/gcc - core/make -) - -pkg_lib_dirs=(lib) -pkg_include_dirs=(include) -pkg_expose=(80 443 3000) - -# do_download() { -# export GIT_SSL_CAINFO="$(pkg_path_for cacerts)/ssl/certs/cacert.pem" -# git clone https://github.com/jtimberman/radiant -# pushd radiant -# git checkout $radiant_git_shasum -# popd -# tar -cjvf $HAB_CACHE_SRC_PATH/${pkg_name}-${pkg_version}.tar.bz2 \ -# --transform "s,^\./radiant,radiant-${pkg_version}," ./radiant \ -# --exclude radiant/.git --exclude radiant/spec -# pkg_shasum=$(trim $(sha256sum $HAB_CACHE_SRC_PATH/${pkg_filename} | cut -d " " -f 1)) -# } - -# The configure scripts for some RubyGems that build native extensions -# use `/usr/bin` paths for commands. This is not going to work in a -# studio where we don't have any of those commands. But we're kind of -# stuck because the native extension is going to be built during -# `bundle install`. -# -# We clean this link up in `do_install`. -do_prepare() { - # build_line "Setting link for /usr/bin/file to 'file'" - # [[ ! -f /usr/bin/file ]] && ln -s $(pkg_path_for file)/bin/file /usr/bin/file - - build_line "Setting link for /usr/bin/env to 'coreutils'" - [[ ! -f /usr/bin/env ]] && ln -s $(pkg_path_for coreutils)/bin/env /usr/bin/env - return 0 -} - -do_build() { - export CPPFLAGS="${CPPFLAGS} ${CFLAGS}" - - local _bundler_dir=$(pkg_path_for bundler) - local _libxml2_dir=$(pkg_path_for libxml2) - local _libxslt_dir=$(pkg_path_for libxslt) - local _postgresql_dir=$(pkg_path_for postgresql) - local _pgconfig=$_postgresql_dir/bin/pg_config - local _sqlite_dir=$(pkg_path_for sqlite) - local _zlib_dir=$(pkg_path_for zlib) - - export GEM_HOME=${pkg_path}/vendor/bundle - export GEM_PATH=${_bundler_dir}:${GEM_HOME} - - # don't let bundler split up the nokogiri config string (it breaks - # the build), so specify it as an env var instead - export NOKOGIRI_CONFIG="--use-system-libraries --with-zlib-dir=${_zlib_dir} --with-xslt-dir=${_libxslt_dir} --with-xml2-include=${_libxml2_dir}/include/libxml2 --with-xml2-lib=${_libxml2_dir}/lib" - bundle config build.nokogiri '${NOKOGIRI_CONFIG}' - bundle config build.pg --with-pg-config=${_pgconfig} - bundle config build.sqlite3 --with-sqlite3-include=${_sqlite_dir}/include --with-sqlite3-lib=${_sqlite_dir}/lib - - # We don't need mysql, so let's not even have it in the gemfile - sed -e 's/gem "mysql"/#removed mysql gem/' -i rails40.gemfile - - bundle install --jobs 2 --retry 5 --path vendor/bundle \ - --binstubs --gemfile=rails40.gemfile -} - -do_install() { - cp -R . ${pkg_path}/dist - - for binstub in ${pkg_path}/dist/bin/*; do - build_line "Setting shebang for ${binstub} to 'ruby'" - [[ -f $binstub ]] && sed -e "s#/usr/bin/env ruby#$(pkg_path_for ruby)/bin/ruby#" -i $binstub - done - - # if [[ `readlink /usr/bin/file` = "$(pkg_path_for file)/bin/file" ]]; then - # build_line "Removing the symlink we created for '/usr/bin/file'" - # rm /usr/bin/file - # fi - - if [[ `readlink /usr/bin/env` = "$(pkg_path_for coreutils)/bin/env" ]]; then - build_line "Removing the symlink we created for '/usr/bin/env'" - rm /usr/bin/env - fi - -} diff --git a/plans/ruby-rails-sample/plan.sh b/plans/ruby-rails-sample/plan.sh index f096ef538f..9fa1ea9484 100644 --- a/plans/ruby-rails-sample/plan.sh +++ b/plans/ruby-rails-sample/plan.sh @@ -10,7 +10,6 @@ pkg_deps=( core/bundler core/cacerts core/glibc - core/hab-bpm core/libffi core/libxml2 core/libxslt