https://pantsbuild.org/ logo
#general
Title
# general
r

rich-helicopter-79006

02/11/2020, 1:29 PM
I’m getting a weird problem when I try to import sources/docs with an IntelliJ pants project. Specifically, an `Exception caught: (pants.backend.jvm.ivy_utils.IvyResolveMappingError)`:
Copy code
Exception caught: (pants.backend.jvm.ivy_utils.IvyResolveMappingError)

 File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/bin/pants", line 8, in <module>
    sys.exit(main())
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 85, in main
    PantsLoader.run()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 81, in run
    cls.load_and_execute(entrypoint)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 74, in load_and_execute
    entrypoint_main()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 39, in main
    PantsRunner(exiter, start_time=start_time).run()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 88, in run
    return runner.run()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 231, in run
    self._run()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 292, in _run
    goal_runner_result = self._maybe_run_v1()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 259, in _maybe_run_v1
    return goal_runner_factory.create().run()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 209, in run
    return self._run_goals()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 180, in _run_goals
    result = self._execute_engine()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 168, in _execute_engine
    result = engine.execute(self._context, self._goals)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/engine/legacy_engine.py", line 26, in execute
    self.attempt(context, goals)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/engine/round_engine.py", line 234, in attempt
    goal_executor.attempt(explain)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/engine/round_engine.py", line 50, in attempt
    task.execute()
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/task/console_task.py", line 56, in execute
    for value in self.console_output(targets) or tuple():
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/project_info/tasks/export.py", line 414, in console_output
    graph_info = self.generate_targets_map(targets, classpath_products=classpath_products)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/project_info/tasks/export.py", line 180, in generate_targets_map
    classpath_products = self.resolve_jars(targets)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/project_info/tasks/export.py", line 156, in resolve_jars
    confs=confs)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/tasks/ivy_task_mixin.py", line 145, in resolve
    pinned_artifacts=artifact_set))
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/tasks/ivy_task_mixin.py", line 181, in _resolve_subset
    for target, resolved_jars in self.add_directory_digests_for_jars(resolved_jars_per_target):
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/tasks/resolve_shared.py", line 38, in add_directory_digests_for_jars
    targets_and_jars=list(targets_and_jars)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/ivy_utils.py", line 433, in resolved_jars_for_each_target
    ivy_info = self._ivy_info_for(conf)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/ivy_utils.py", line 453, in _ivy_info_for
    return IvyUtils.parse_xml_report(conf, report_path)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/ivy_utils.py", line 926, in parse_xml_report
    ret.add_module(ivy_module)
  File "/Users/allen/.cache/pants/setup/bootstrap-Darwin-x86_64/1.16.0_py27/lib/python2.7/site-packages/pants/backend/jvm/ivy_utils.py", line 599, in add_module
    .format(ref_unversioned, module.ref.rev))

Exception message: Already defined module IvyModuleRef(net.sourceforge.f2j:arpack_combined_all:latest.integration:javadoc:jar), as rev 0.1!
The command line being executed is:
Copy code
pants --target-spec-file=/private/var/folders/zn/04ckg50s6c70p76y0s564r7c0000gn/T/pants_target_specs7.in --no-quiet export --output-file=/private/var/folders/zn/04ckg50s6c70p76y0s564r7c0000gn/T/pants_depmap_run1245.out --formatted --export-libraries-sources --export-libraries-javadocs
Running this command on the command-line triggers the same error, so it doesn’t seem like it’s IntelliJ/IntelliJ-pants related, but it’s definitely because I’m exporting sources/javadocs. Is this a problem somewhere in my deps?
Worked around this by pinning the version for
arpack_combined_all
via https://www.pantsbuild.org/3rdparty_jvm.html#managed-jar-dependencies It looks like that project only had one release: super puzzled what’s going on there, but apparently it’s a bad interaction between ivy, that library and cached jars?
h

hundreds-father-404

02/11/2020, 4:05 PM
Cc @wide-energy-11069. Any idea what’s going on?
w

wide-energy-11069

02/11/2020, 5:11 PM
unclear, haven’t touched ivy for a while. but seems like a legit error from ivy, possibly conflicting versions of the same library?
also friendly reminder ivy resolve (not publish) will be gone by 1.27
❤️ 1