-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Conversation
d8e3a61
to
f677213
Compare
0138148
to
a23d181
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/tfor/for/
There was a problem hiding this comment.
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) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
111d2ff
to
b6fada3
Compare
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
b6fada3
to
5b3cde4
Compare
VOLUME /travis/workdir | ||
|
||
# Setup a non-root user to execute the build under (avoids problems with npm install). | ||
ARG TRAVIS_USER=travis_ci |
There was a problem hiding this comment.
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?
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