Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run test with v2 engine #3770

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/python/pants/engine/legacy/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
unicode_literals, with_statement)

import logging
from collections import namedtuple

from twitter.common.collections import OrderedSet, maybe_list

Expand All @@ -15,6 +16,7 @@
from pants.build_graph.address import Address
from pants.build_graph.address_lookup_error import AddressLookupError
from pants.build_graph.build_graph import BuildGraph
from pants.build_graph.remote_sources import RemoteSources
from pants.engine.fs import Files, FilesDigest, PathGlobs
from pants.engine.legacy.structs import BundleAdaptor, BundlesField, SourcesField, TargetAdaptor
from pants.engine.nodes import Return, State, TaskNode, Throw
Expand Down Expand Up @@ -140,6 +142,8 @@ def _instantiate_target(self, target_adaptor):
# Instantiate.
if target_cls is JvmApp:
return self._instantiate_jvm_app(kwargs)
elif target_cls is RemoteSources:
return self._instantiate_remote_sources(kwargs)
return target_cls(build_graph=self, **kwargs)
except TargetDefinitionException:
raise
Expand All @@ -159,6 +163,11 @@ def _instantiate_jvm_app(self, kwargs):

return JvmApp(build_graph=self, **kwargs)

def _instantiate_remote_sources(self, kwargs):
DestWrapper = namedtuple('DestWrapper', ['target_types'])
kwargs['dest'] = DestWrapper((self._target_types[kwargs['dest']._type_alias],))
return RemoteSources(build_graph=self, **kwargs)

def inject_synthetic_target(self,
address,
target_type,
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/engine/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Noop(datatype('Noop', ['format_string', 'args']), State):

@staticmethod
def cycle(src, dst):
return Noop('Edge would cause a cycle: {} -> {}.', src, dst)
return Noop('Cycle detected! Edge would cause a cycle: {} -> {}.', src, dst)

def __new__(cls, format_string, *args):
return super(Noop, cls).__new__(cls, format_string, args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def _configured_pants_run(self, command, workdir):
command=command,
workdir=workdir,
config={
'GLOBAL': { 'ignore_patterns': [] },
'GLOBAL': {
'ignore_patterns': [],
'pants_ignore': []
},
'jvm-platform': {
'default_platform': 'java7',
'platforms': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def _execute_pants(self, goal):
# Make sure the emitted BUILD under .pants.d is not ignored.
config = {
'GLOBAL': {
'ignore_patterns': []
'ignore_patterns': [],
'pants_ignore': []
}
}
pants_run = self.run_pants_with_workdir([goal] + prep_commands_specs, workdir, config=config)
Expand Down