【发布时间】:2015-10-01 03:16:03
【问题描述】:
我正在尝试使用裤子来构建一个微不足道的 pex 来测试它。但是,我遇到了一些问题:
$ ./pants binary src/python/hworld
INFO] Detected git repository at /home/jovalko/pants on branch master
23:03:48 00:00 [main]
(To run a reporting server: ./pants server)
23:03:48 00:00 [bootstrap]
23:03:48 00:00 [setup]
23:03:48 00:00 [parse]
FAILURE:
Failed to resolve target for tool: //:scala-compiler. This target was obtained from
option scalac in scope scala-platform. You probably need to add this target to your tools
BUILD file(s), usually located in BUILD.tools in the workspace root.
Exception AddressLookupError: name 'scala_jar' is not defined
while executing BUILD file FilesystemBuildFile(/home/jovalko/pants/BUILD.tools)
Loading addresses from '' failed.
23:03:48 00:00 [complete]
FAILURE
由于很难将我的问题的所有部分都表达为一个粘贴,我已将它们发布为on github(对于外部链接表示歉意)。
相关位是我的顶级BUILD:
# Pants source code
source_root('src/python')
还有 BUILD 用于我的 hworld 二进制文件:
python_binary(name='hworld',
source='hworld.py'
)
也许还有BUILD.tools,但它很长,我直接从pantsbuild/pants 复制它(如文档中建议的那样,我从另一个repo 的工作版本开始)。
我尝试了各种排列(使用 BUILD.tools,没有 pants.ini 中的各种东西),但在每种情况下,它都因与 scala 相关的东西而失败......这有点令人困惑,因为我只是在构建Python。而且,在pantsbuild/pants repo 中运行对我来说效果很好。
我会提醒你,我对裤子很陌生,很可能我做了一些愚蠢的事情;)。有什么想法吗?
【问题讨论】:
-
我认为我们已经在裤子的 1.0 版本中解决了这个问题,根本不需要 BUILD.tools。安装过程已简化,请参阅pantsbuild.org/install.html。