dry-policeman-7927
12/06/2019, 11:28 AMlittle-salesclerk-62826
12/06/2019, 1:02 PMcwd
points to different places for v1 and v2. As ./pants is resolved as directory.hundreds-breakfast-49010
12/06/2019, 7:36 PM./pants binary --help
, one of the top-level options it displays help about is:
--binary-output-file=<path> (default: None)
Output to this file. If unspecified, outputs to stdout.
hundreds-breakfast-49010
12/06/2019, 7:37 PMConsoleTask
, but I don't think this makes sense for binary
, which I think implies we don't want it to exist on the v2 version?aloof-angle-91616
12/06/2019, 7:37 PMaloof-angle-91616
12/06/2019, 7:37 PMaloof-angle-91616
12/06/2019, 7:38 PMdist/
hundreds-breakfast-49010
12/06/2019, 10:44 PMConsole
with mock stdout and stderr passed into them as the test console, and other tests (maybe v1-only tests?) are using a special MockConsole
data structurehundreds-breakfast-49010
12/06/2019, 10:45 PMMockConsole
(perhaps in a follow-up commit)witty-crayon-22786
12/06/2019, 10:52 PMwitty-crayon-22786
12/06/2019, 10:52 PMwonderful-iron-54019
12/09/2019, 4:54 PMhappy-kitchen-89482
12/11/2019, 1:42 AMred-balloon-89377
12/11/2019, 2:18 PMcontext.target_roots
is a list and not a set?best-nightfall-7221
12/11/2019, 8:56 PMpython_requirements_library
and getting this. Whats the best way to debug it?
Exception message: Package SourcePackage(u'file:///aiq/build/.pants.d/python-setup/resolved_requirements/CPython-2.7.6/mysqlclient-1.4.6.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)
-ldebug
doesnt tell me much. I do have a build cache but disabled it, and python-repos
is only pointing to a local dir with only that wheel. And this works fine:
pip wheel --no-cache-dir mysqlclient==1.4.6 --wheel-dir=./
pip install ./mysqlclient-xxx-none-linux.whl
I'm on ubuntu14 and ub18 and noticed in one case, it builds a none
wheel, in another case it builds cp27mu
. But fails to pants1.7 binary :mypex
in both cases.aloof-angle-91616
12/12/2019, 8:44 AMdmcclanahan@tw-mbp-dmcclanahan: ~/tools/pants-v3 0:40:50 $? 1
X> ./pants options | g pex.build
Scrubbed PYTHONPATH=/Users/dmcclanahan/tools/pants-v3/src/python: from the environment.
(standard input):1385:pex-builder-wrapper.generate_ipex = False (from HARDCODED)
(standard input):1386:pex-builder-wrapper.ipex_injected_pex_version = 1.6.12 (from HARDCODED)
(standard input):1387:pex-builder-wrapper.setuptools_version = 40.6.3 (from HARDCODED)
./pants options 2.72s user 0.79s system 80% cpu 4.390 total
dmcclanahan@tw-mbp-dmcclanahan: ~/tools/pants-v3 0:41:16
X> ./pants --pex-builder-wrapper-binary-py-generate-ipex options | g pex.build
Scrubbed PYTHONPATH=/Users/dmcclanahan/tools/pants-v3/src/python: from the environment.
(standard input):1385:pex-builder-wrapper.generate_ipex = False (from HARDCODED)
(standard input):1386:pex-builder-wrapper.ipex_injected_pex_version = 1.6.12 (from HARDCODED)
(standard input):1387:pex-builder-wrapper.setuptools_version = 40.6.3 (from HARDCODED)
(standard input):1388:pex-builder-wrapper.binary.py.generate_ipex = True (from FLAG)
./pants --pex-builder-wrapper-binary-py-generate-ipex options 2.55s user 0.63s system 87% cpu 3.654 total
--pex-builder-wrapper-binary-py-generate-ipex
causes the option to be visible in the binary.py
scope. there's some intelligence about displaying options here that we could apply to the output of ./pants help
(which displays every single option in all its possible scopes)aloof-angle-91616
12/12/2019, 8:45 AM--generate-ipex
option is from this open PR (https://github.com/pantsbuild/pants/pull/8793)rapid-crayon-8232
12/12/2019, 3:45 PMfiles
and adding them as a dependency to the tests but they are still not found or not in the correct path, thx.damp-quill-59187
12/12/2019, 6:16 PMpython_binary
. Thas a single 'main' python_library
, an entrypoint, and some other params
`publish_task`: this is similar to the existing publish, but uses twine.
All these steps work well individually. The issue here is getting them to play nicely with each other. What I'd like to do is call our deploy-job
goal with the job_target
as a target. This would then in turn call our publish goal, which calls setup.py.
The issue that I'm running into is that when setup.py is called, it fails with the error :
FAILURE: setup-py target(s) must provide an artifact.
I imagine this is because it is looking at the job_target
for a provides argument, which it doesn't have. What we're looking for is to somehow specify that the round_manager.require_data('python_dists')
line can inform setup.py libraries that this needs to be run against are the python_library deps of job_target
I've dabbled in the python_binary code to see how this is done, but couldn't exactly grab a hold. Happy to provide more details as wellbrainy-barista-76354
12/12/2019, 10:03 PMMETA-INF/
META-INF/MANIFEST.MF
META-INF/services/
com/
com/roku/
com/roku/dea/
com/roku/dea/presto/
com/roku/dea/presto/udfs/
META-INF/services/com.facebook.presto.spi.Plugin
com/roku/dea/presto/udfs/UdfPlugin.class
com/roku/dea/presto/udfs/ProductUDF.class
META-INF/maven/
META-INF/maven/com.roku.dea/
META-INF/maven/com.roku.dea/prestoUdfs/
META-INF/maven/com.roku.dea/prestoUdfs/pom.xml
META-INF/maven/com.roku.dea/prestoUdfs/pom.properties
Since our team is using pants to build the project, so I copied my files to Pants project folder, and have a BUILD file like this:
resources(name='prestoUdfs-lib-resources',
sources=['src/main/resources/META-INF/services/com.facebook.presto.spi.Plugin']
)
java_library(
name='prestoUdfs-lib',
dependencies=[provided('3rdparty/java/com/facebook:presto-spi'),
provided('3rdparty/java/com/google:guava')
],
sources=globs('*.java'),
)
jvm_binary(
name='prestoUdfs-artifacts',
dependencies=[':prestoUdfs-lib',
':prestoUdfs-lib-resources'],
)
Then I built the project, it says
WARN] Globs did not match. Excludes were: []. Unmatched globs were: ["src/main/java/com/roku/dea/presto/udfs/src/main/resources/META-INF/services/com.facebook.presto.spi.Plugin"].
Then I moved META-INF folder to the same folder as .java files, and changed BUILD file to
resources(name='prestoUdfs-lib-resources',
sources=['META-INF/services/com.facebook.presto.spi.Plugin']
)
java_library(
name='prestoUdfs-lib',
dependencies=[provided('3rdparty/java/com/facebook:presto-spi'),
provided('3rdparty/java/com/google:guava')
],
sources=globs('*.java'),
)
jvm_binary(
name='prestoUdfs-artifacts',
dependencies=[':prestoUdfs-lib',
':prestoUdfs-lib-resources'],
)
Now my jar file looks like
META-INF/
META-INF/MANIFEST.MF
com/
com/roku/
com/roku/dea/
com/roku/dea/presto/
com/roku/dea/presto/udfs/
com/roku/dea/presto/udfs/META-INF/
com/roku/dea/presto/udfs/META-INF/services/
com/roku/dea/presto/udfs/META-INF/services/com.facebook.presto.spi.Plugin
com/roku/dea/presto/udfs/UdfPlugin.class
compile_classpath/
compile_classpath/src.main.java.com.roku.dea.presto.udfs.prestoUdfs-lib.txt
com/roku/dea/presto/udfs/ProductUDF.class
Looks like META-INF/services/com.facebook.presto.spi.Plugin is not on the root like Maven jar, so my EMR presto cluster can't load this jar. Is there a way to put resources to root path? Thanks for your help.microscopic-application-29816
12/12/2019, 11:18 PMbrainy-barista-76354
12/12/2019, 11:29 PMjava_library(
name='prestoUdfs-lib',
dependencies=[provided('3rdparty/java/com/facebook:presto-spi'),
provided('3rdparty/java/com/google:guava')
],
sources=globs('*.java'),
)
jvm_binary(
name='prestoUdfs-artifacts',
dependencies=[':prestoUdfs-lib'],
services={'com.facebook.presto.spi.Plugin': 'com.roku.dea.presto.udfs.UdfPlugin'}
)
I extracted the jar file, somehow com.facebook.presto.spi.Plugin is broken. Do you guys have any thoughts, thanks a lot.
cat META-INF/services/com.facebook.presto.spi.Plugin
# Generated from pants target src/main/java/com/roku/dea/presto/udfs:prestoUdfs-artifacts
c
o
m
.
r
o
k
u
.
d
e
a
.
p
r
e
s
t
o
.
u
d
f
s
.
U
d
f
P
l
u
g
i
n
# Generated from pants target src/main/java/com/roku/dea/presto/udfs:prestoUdfs-artifacts
c
o
m
.
r
o
k
u
.
d
e
a
.
p
r
e
s
t
o
.
u
d
f
s
.
U
d
f
P
l
u
g
i
n
# Generated from pants target src/main/java/com/roku/dea/presto/udfs:prestoUdfs-artifacts
c
o
m
.
r
o
k
u
.
d
e
a
.
p
r
e
s
t
o
.
u
d
f
s
.
U
d
f
P
l
u
g
i
n
enough-analyst-54434
12/13/2019, 1:57 AMgentle-room-19215
12/13/2019, 4:13 AMstrong-caravan-64652
12/13/2019, 5:31 PMgoogle-cloud-logging
) puts duplicate classes/resources on the class path. Is there an elegant way to flag this as "OK" in my 3rdparty
build file for this library, or do I have to do Duplicate.SKIP
in all of my bundle files for those duplicate classes/resources?
===== For target JvmBinary(BuildFileAddress(src/jvm/com/.../graphql/bin/BUILD, bin)):
Duplicate classes and/or resources detected in artifacts: ('com.google.api.grpc-proto-google-cloud-logging-v2-0.82.0.jar', 'com.google.api.grpc-proto-google-common-protos-1.17.0.jar')
com/google/logging/type/HttpRequest$Builder.class
com/google/logging/type/LogSeverityProto.class
com/google/logging/type/HttpRequestProto$1.class
com/google/logging/type/HttpRequestProto.class
google/logging/type/http_request.proto
com/google/logging/type/HttpRequest$1.class
com/google/logging/type/LogSeverity.class
com/google/logging/type/HttpRequestOrBuilder.class
google/logging/type/log_severity.proto
com/google/logging/type/LogSeverityProto$1.class
... 2 more ...
Both of those artifacts seem to be compile dependencies of https://mvnrepository.com/artifact/com.google.cloud/google-cloud-logging/1.99.0happy-kitchen-89482
12/13/2019, 7:16 PMhappy-kitchen-89482
12/13/2019, 8:49 PMcomponent
, e.g., pants.component.python
, or unit
, e.g., pants.unit.python
? This helps avoid code confusion with existing v1 backends. Note that all these words are somewhat overloaded.happy-kitchen-89482
12/13/2019, 8:49 PMpants_backend.python
hundreds-father-404
12/14/2019, 2:04 AM./pants help
more useful and accessible to read! No need to look at the code, only the pictures in the PR description and give input on what you like and think we could further improve. https://github.com/pantsbuild/pants/pull/8820rapid-crayon-8232
12/15/2019, 4:49 PMpython_binary(
name='jupyter-notebook',
dependencies = [
':package1',
':package2',
'packages-python/third_party:jupyter',
],
source='notebook.py',
)