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

Load the native engine lib from a pkg_resource. #4914

Merged
merged 3 commits into from
Oct 7, 2017

Conversation

jsirois
Copy link
Contributor

@jsirois jsirois commented Sep 29, 2017

This switches pants to generating wheels instead of sdists and embeds
the proper platform-dependent native engine library as a resource within
the pantsbuild.pants wheel.

Fixes #4906

@jsirois jsirois force-pushed the jsirois/issues/4906 branch 12 times, most recently from d8e3a61 to f677213 Compare October 2, 2017 17:22
@jsirois jsirois mentioned this pull request Oct 2, 2017
@jsirois jsirois force-pushed the jsirois/issues/4906 branch 14 times, most recently from 0138148 to a23d181 Compare October 6, 2017 17:22
Copy link
Member

@kwlzn kwlzn left a comment

Choose a reason for hiding this comment

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

lgtm! thanks for tackling this.

.travis.yml Outdated
@@ -45,47 +45,40 @@ cache:
matrix:
include:
- os: osx
# We request the oldest image we can for maximum compatibility.
osx_image: xcode6.4
Copy link
Member

Choose a reason for hiding this comment

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

might be good to clearly state in this comment which OSX version xcode6.4 nets us to help onlookers save time when the question inevitably comes up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, fixed

register('--native-engine-version', advanced=True,
default=pkg_resources.resource_string('pants.engine', 'native_engine_version').strip(),
help='Native engine version.')
register('--native-engine-supportdir', advanced=True, default='bin/native-engine',
Copy link
Member

Choose a reason for hiding this comment

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

I suppose since these are largely obscured from users in general it's fine to yank these without a deprecation cycle.

Copy link
Sponsor Member

@stuhood stuhood Oct 6, 2017

Choose a reason for hiding this comment

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

Yea, I'm fine with this.

... but it would be pretty easy to leave them in as noops with a deprecation warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed that it's easy enough to do, fixed.

@stuhood stuhood mentioned this pull request Oct 6, 2017
Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks a lot John!

# + get_rust_os_ids: Produces the BinaryUtil os id paths supported by rust, one per line.
source ${REPO_ROOT}/build-support/bin/native/utils.sh
# TODO(John Sirois): Eliminate this replication of BinaryUtil logic internal to pants code when
# https://github.com/pantsbuild/pants/issues/4006 is complete.
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This issue is probably no longer relevant to this codepath.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, killed. Also killed the emulation and just kept LIB_EXTENSION, which is the only variant bit needed any longer.

@@ -490,7 +552,7 @@ function usage() {
echo " and can be installed in an ephemeral virtualenv."
echo " -l Lists all pantsbuild packages that this script releases."
echo " -o Lists all pantsbuild package owners."
echo " -e Check that native engine binaries are deployed for this release."
echo " -e Check that wheels are prebuilt for this release."
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Do you think that you could add a comment somewhere to explain what process generally prebuilds the wheels (tagged travis builds? all travis builds?) and what consumes them (the release script)? Will this mean that a release tag must be pushed (and be past the relevant stage in travis) before the release can proceed? Fine either way, just hoping to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

Yeah, as things stand the binary wheels just get built on master pushes, in .travis.yml we still have:

on:
    condition: $PREPARE_DEPLOY = 1
    branch: master
    repo: pantsbuild/pants

This means the version bump / changelog PR will (re)generate the final wheels, and the release script is checking that wheels for each published package have been curled down, so this should be failsafe mod only 1 version (mac vs linux) of the pantsbuild.pants wheel being published. That though would mean a red master CI which - for now anyway - I'm hoping we're still intolerant of.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And, I just realized this breaks down for stable branch cherry-picks. I'll update the release condition to include any https://github.com/pantsbuild/pants branch.

cmake \
oracle-java8-installer

# Setup mount points tfor the travis ci user & workdir.
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

s/tfor/for/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

options.native_engine_version,
options.native_engine_supportdir,
options.native_engine_visualize_to)
return Native(options.native_engine_visualize_to)

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Not a comment for you, but probably for @benjyw / @kwlzn : should we consider reverting c34fa86 after this lands? Sounds like it had some fallout anyway: #4917

Copy link
Member

Choose a reason for hiding this comment

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

no, the daemon externalization patch depends on c34fa86 and will move all of the pantsd and watchman scoped options as well as some global options into bootstrap as well. so we'll have to solve or accept #4917 very soon either way.

@jsirois jsirois force-pushed the jsirois/issues/4906 branch 2 times, most recently from 111d2ff to b6fada3 Compare October 7, 2017 01:40
@jsirois
Copy link
Contributor Author

jsirois commented Oct 7, 2017

Since the changes here in response to review feedback were small, I'll TBR once this goes green to move on to performing a release that tests all this jimcrackery.

This switches pants to generating wheels instead of sdists and embeds
the proper platform-dependent native engine library as a resource within
the pantsbuild.pants wheel.

Fixes pantsbuild#4906
@jsirois jsirois merged commit 2a9a4b9 into pantsbuild:master Oct 7, 2017
@jsirois jsirois deleted the jsirois/issues/4906 branch October 7, 2017 20:23
VOLUME /travis/workdir

# Setup a non-root user to execute the build under (avoids problems with npm install).
ARG TRAVIS_USER=travis_ci
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these args which leak in from the host environment, rather than being self-contained constants in the Dockerfile?

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