Skip to content

Commit

Permalink
Fixes prompted by review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Oct 7, 2017
1 parent 5aa928a commit 111d2ff
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ cache:
matrix:
include:
- os: osx
# We request the oldest image we can for maximum compatibility.
# We request the oldest image we can (corresponding to OSX 10.10) for maximum compatibility.
# See: https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
osx_image: xcode6.4
language: generic
env:
Expand Down Expand Up @@ -443,7 +444,9 @@ deploy:
acl: public_read
on:
condition: $PREPARE_DEPLOY = 1
branch: master
# NB: We mainly want deploys for `master` commits; but we also need new binaries for stable
# release branches; eg `1.3.x`
all_branches: true
repo: pantsbuild/pants

# We accept the default travis-ci email author+committer notification
Expand Down
18 changes: 4 additions & 14 deletions build-support/bin/native/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
# Defines:
# + LIB_EXTENSION: The extension of native libraries.
# + KERNEL: The lower-cased name of the kernel as reported by uname.
# + OS_NAME: The name of the OS as seen by pants.
# + OS_ID: The ID of the current OS as seen by pants.
# + CACHE_ROOT: The pants cache root dir.
# + NATIVE_ENGINE_CACHE_DIR: The native engine binary root cache directory.
# + NATIVE_ENGINE_CACHE_TARGET_DIR: The directory containing all versions of the native engine for
# + NATIVE_ENGINE_CACHE_DIR: The directory containing all versions of the native engine for
# the current OS.
# + NATIVE_ENGINE_BINARY: The basename of the native engine binary for the current OS.
# + NATIVE_ENGINE_VERSION_RESOURCE: The path of the resource file containing the native engine
Expand All @@ -20,28 +18,21 @@
REPO_ROOT=$(cd $(dirname "${BASH_SOURCE[0]}") && cd ../../.. && pwd -P)
source ${REPO_ROOT}/build-support/common.sh

# TODO(John Sirois): Eliminate this replication of BinaryUtil logic internal to pants code when
# https://github.com/pantsbuild/pants/issues/4006 is complete.
readonly KERNEL=$(uname -s | tr '[:upper:]' '[:lower:]')
case "${KERNEL}" in
linux)
readonly LIB_EXTENSION=so
readonly OS_NAME=linux
readonly OS_ID=${OS_NAME}/$(uname -m)
;;
darwin)
readonly LIB_EXTENSION=dylib
readonly OS_NAME=mac
readonly OS_ID=${OS_NAME}/$(sw_vers -productVersion | cut -d: -f2 | tr -d ' \t' | cut -d. -f1-2)
;;
*)
die "Unknown kernel ${KERNEL}, cannot bootstrap pants native code!"
;;
esac

readonly NATIVE_ROOT="${REPO_ROOT}/src/rust/engine"
readonly NATIVE_ENGINE_MODULE="native_engine"
readonly NATIVE_ENGINE_BINARY="${NATIVE_ENGINE_MODULE}.so"
readonly NATIVE_ENGINE_BINARY="native_engine.so"
readonly NATIVE_ENGINE_RESOURCE="${REPO_ROOT}/src/python/pants/engine/${NATIVE_ENGINE_BINARY}"
readonly CFFI_BOOTSTRAPPER="${REPO_ROOT}/build-support/native-engine/bootstrap_cffi.py"

Expand All @@ -54,7 +45,6 @@ esac

readonly CACHE_ROOT=${XDG_CACHE_HOME:-$HOME/.cache}/pants
readonly NATIVE_ENGINE_CACHE_DIR=${CACHE_ROOT}/bin/native-engine
readonly NATIVE_ENGINE_CACHE_TARGET_DIR=${NATIVE_ENGINE_CACHE_DIR}/${OS_ID}

function calculate_current_hash() {
# Cached and unstaged files, with ignored files excluded.
Expand Down Expand Up @@ -132,7 +122,7 @@ function _build_native_code() {
function bootstrap_native_code() {
# Bootstraps the native code only if needed.
local native_engine_version="$(calculate_current_hash)"
local target_binary="${NATIVE_ENGINE_CACHE_TARGET_DIR}/${native_engine_version}/${NATIVE_ENGINE_BINARY}"
local target_binary="${NATIVE_ENGINE_CACHE_DIR}/${native_engine_version}/${NATIVE_ENGINE_BINARY}"
if [ ! -f "${target_binary}" ]
then
local readonly native_binary="$(_build_native_code)"
Expand All @@ -146,7 +136,7 @@ function bootstrap_native_code() {

# Pick up Cargo.lock changes if any caused by the `cargo build`.
native_engine_version="$(calculate_current_hash)"
target_binary="${NATIVE_ENGINE_CACHE_TARGET_DIR}/${native_engine_version}/${NATIVE_ENGINE_BINARY}"
target_binary="${NATIVE_ENGINE_CACHE_DIR}/${native_engine_version}/${NATIVE_ENGINE_BINARY}"

mkdir -p "$(dirname ${target_binary})"
cp "${native_binary}" "${target_binary}"
Expand Down
2 changes: 1 addition & 1 deletion build-support/docker/travis_ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > \
cmake \
oracle-java8-installer

# Setup mount points tfor the travis ci user & workdir.
# Setup mount points for the travis ci user & workdir.
VOLUME /travis/home
VOLUME /travis/workdir

Expand Down
24 changes: 18 additions & 6 deletions src/docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Deciding the "who", "what", and "when" of releasing is described on the
[[Release Strategy|pants('src/docs:release_strategy')]] page. Note that for some
lucky release managers, this may result in two or more releases in a particular week.

A release is always prepared for each pantsbuild/pants branch by a green Travis CI run; ie: master,
1.0.x, 1.1.x, etc. branches on https://github.com/pantsbuild/pants will have wheels created, tested
and deployed to https://binaries.pantsbuild.org ready for use in a release.

Once you know what to release, releasing pants involves:

- Preparing the release.
Expand Down Expand Up @@ -145,8 +149,8 @@ After confirming this, run.
:::bash
$ ./build-support/bin/release.sh -n

This will perform a dry run local build of the pantsbuild.pants sdist
and other related package sdists, install them in a virtualenv and then
This will perform a dry run local build of the pantsbuild.pants wheel
and other related package wheelss, install them in a virtualenv and then
smoke test basic operations.

Note that in addition to CI checking dry runs work, the release publish
Expand All @@ -162,7 +166,7 @@ Now that we've smoke-tested this release, we can publish to PyPi:
$ ./build-support/bin/release.sh

This also performs a dry run and then proceeds to upload the smoke
tested sdists to PyPi.
tested wheels to PyPi.

Announce
--------
Expand Down Expand Up @@ -191,7 +195,7 @@ Owners
------

The following folks are set up to publish to pypi for
pantsbuild.pants sdists:
pantsbuild.pants wheels:

Name | Email | PYPI Usename
------------------|-----------------------------|---------------
Expand All @@ -214,10 +218,18 @@ be obtained via:
Right now that's:

- pantsbuild.pants
- pantsbuild.pants.testinfra
- pantsbuild.pants.contrib.android
- pantsbuild.pants.contrib.buildgen
- pantsbuild.pants.contrib.scrooge
- pantsbuild.pants.testinfra
- pantsbuild.pants.contrib.buildgen
- pantsbuild.pants.contrib.go
- pantsbuild.pants.contrib.node
- pantsbuild.pants.contrib.python.checks
- pantsbuild.pants.contrib.scalajs
- pantsbuild.pants.contrib.findbugs
- pantsbuild.pants.contrib.cpp
- pantsbuild.pants.contrib.errorprone
- pantsbuild.pants.contrib.jax_ws

You can run the following to get a full ownership roster for each
package :
Expand Down
9 changes: 9 additions & 0 deletions src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ def register_bootstrap_options(cls, register):
help='Enables use of the v2 engine.')

# These facilitate configuring the native engine.
register('--native-engine-version', advanced=True, default='DEPRECATED',
removal_version='1.6.0.dev0',
removal_hint='Unused, the native engine is now embedded in the pantsbuild.pants wheel',
help='Native engine version.')
register('--native-engine-supportdir', advanced=True, default='DEPRECATED',
removal_version='1.6.0.dev0',
removal_hint='Unused, the native engine is now embedded in the pantsbuild.pants wheel',
help='Find native engine binaries under this dir. Used as part of the path to '
'lookup the binary with --binary-util-baseurls and --pants-bootstrapdir.')
register('--native-engine-visualize-to', advanced=True, default=None, type=dir_option,
help='A directory to write execution and rule graphs to as `dot` files. The contents '
'of the directory will be overwritten if any filenames collide.')
Expand Down

0 comments on commit 111d2ff

Please sign in to comment.