我试着用裤子做一个小的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
:
以及hworld二进制文件的BUILD
:
python_binary(name='hworld',
source='hworld.py'
)
也许还有BUILD.tools
但它很长,我直接从pantsbuild/pants复制了它(正如文档中建议的那样,我从另一个repo开始使用一个工作版本)。在
我尝试过各种排列(用构建工具,没有,pants.ini
)中的各种东西,但在任何情况下,它都会因为与scala相关的东西而失败。。。这有点令人费解,因为我只是在构建python。而且,在pantsbuild/pantsrepo中运行对我来说很好。在
我要提醒你,我对裤子是全新的,很可能我做了些傻事;)。有什么想法吗?在
这看起来像一个例子,你的裤子设置使用了来自master的代码,但是你的虚拟环境中的裤子版本落后了一些提交。根据你的裤子.ini你可以使用py0.0.0版本来自动释放。在
但是scala_jar实现在0.0.50到0.0.51之间,特别是this commit here。在
通过修补你的差异和撞上裤子的版本裤子.ini,我可以让你的项目编译。不过,我很高兴你找到了让你进步的东西。在
如果有人碰到这个问题,我通过从我的
BUILD.tools
中删除与scala相关的(特别是使用scala_jar
)条目来解决这个问题:相关问题 更多 >
编程相关推荐