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

enough-analyst-54434

09/25/2017, 4:28 PM
@lively-france-2777 what version of Pants do you run? A few points: 1. your
./pants options
output shows a redundant entry, '/.provisioning/' is covered by '.*/' 2. I see on pantsbuild/pants master:
Copy code
$ cat provisioning/BUILD 
not_a_target_type()
$ PANTS_IGNORE="+['/provisioning/']" ./pants --changed-parent=HEAD --changed-include-dependees=transitive test
...
SUCCESS
$ ./pants --changed-parent=HEAD --changed-include-dependees=transitive test
...
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/legacy/source_mapper.py", line 108, in iter_target_addresses_for_sources
    for hydrated_targets in self._scheduler.product_request(HydratedTargets, subjects):
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/scheduler.py", line 540, in product_request
    return self.products_request([product], subjects)[product]
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/scheduler.py", line 517, in products_request
    raise ExecutionError('Received unexpected Throw state(s):\n{}'.format(cumulative_trace))

Exception message: Received unexpected Throw state(s):
Computing Select(AscendantAddresses(directory=u'provisioning'), =Collection.of(HydratedTarget))
  Computing Task(<function transitive_hydrated_targets at 0x7fb255193398>, AscendantAddresses(directory=u'provisioning'), =Collection.of(HydratedTarget))
    Computing TransitiveDependencies( =HydratedTarget, =BuildFileAddresses)
      Computing Task(<function addresses_from_address_families at 0x7fb25554f050>, AscendantAddresses(directory=u'provisioning'), =BuildFileAddresses)
        Computing Task(<function parse_address_family at 0x7fb255549578>, Dir(path='provisioning'), =AddressFamily)
          Throw(Failed to parse provisioning/BUILD:
name 'not_a_target_type' is not defined)
            Traceback (most recent call last):
              File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/native.py", line 400, in extern_invoke_runnable
                val = runnable(*args)
              File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/build_files.py", line 84, in parse_address_family
                address_mapper.parser))
              File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/mapper.py", line 59, in parse
                raise MappingError('Failed to parse {}:\n{}'.format(filepath, e))
            MappingError: Failed to parse provisioning/BUILD:
            name 'not_a_target_type' is not defined
l

lively-france-2777

09/26/2017, 1:09 AM
I’m using 1.3.0. And thanks, digging into
not_a_target_type()
made me notice that there’s an empty
BUILD
in pantsbuild/pants (the root folder), and after adding an empty
BUILD
in my source root my ignores started working and my tests ran.
e

enough-analyst-54434

09/26/2017, 3:22 AM
Hrm. I'm very happy you found an empty BUILD as the workaround, but this is a highly non-obvious step to take. It seems to me, and should be eliminated or well documented. Juggling a release and a hotfix atm, but if you beat me to filing an issue about this, I'd be obliged.
l

lively-france-2777

09/26/2017, 6:56 AM
I’ll try to make a small reproducible repo with it later today 🙂
Created a new repro repo to test this out with, I hope the issue covers the main issue. I’m a little unsure what else to log into it. 🙂 https://github.com/pantsbuild/pants/issues/4904
4 Views