witty-crayon-22786
04/13/2018, 3:07 AMwitty-crayon-22786
04/13/2018, 3:08 AMtry: except:
around the entire rule body and see if it is even runningaloof-angle-91616
04/13/2018, 3:08 AMaloof-angle-91616
04/13/2018, 3:08 AMwitty-crayon-22786
04/13/2018, 3:08 AMCompiler
? SingletonRule(Compiler, compiler_inst)
witty-crayon-22786
04/13/2018, 3:08 AMwitty-crayon-22786
04/13/2018, 3:09 AMwitty-crayon-22786
04/13/2018, 3:09 AMaloof-angle-91616
04/13/2018, 3:09 AMwitty-crayon-22786
04/13/2018, 3:09 AMwitty-crayon-22786
04/13/2018, 3:10 AMSingletonRule
should definitely validate that.witty-crayon-22786
04/13/2018, 3:10 AMaloof-angle-91616
04/13/2018, 3:10 AMwitty-crayon-22786
04/13/2018, 3:10 AMwitty-crayon-22786
04/13/2018, 3:11 AMSingletonRule
should blow up immediately there.aloof-angle-91616
04/13/2018, 3:11 AMwitty-crayon-22786
04/13/2018, 3:11 AMtype(x) is Compiler
as opposed to isinstance(x, Compiler)
witty-crayon-22786
04/13/2018, 3:11 AMwitty-crayon-22786
04/13/2018, 3:12 AMCompiler
, type(x)
is the subclassaloof-angle-91616
04/13/2018, 3:12 AMwitty-crayon-22786
04/13/2018, 3:13 AMaloof-angle-91616
04/13/2018, 3:13 AMaloof-angle-91616
04/13/2018, 3:20 AMwitty-crayon-22786
04/13/2018, 3:29 AMaloof-angle-91616
04/13/2018, 3:29 AMwitty-crayon-22786
04/13/2018, 3:29 AMaloof-angle-91616
04/13/2018, 3:30 AMValueError: At least one request failed: [Throw(exc=Exception(u'Failed to parse PathGlobs: Failed to parse PathGlobs for include(["/private/var/folders/j2/x6ckkbrn08g8536d6_n3_ywm0000gn/T/tmpMkhtBs_BUILD_ROOT/hello.cpp"]), exclude([]): Absolute paths not supported: "/private/var/folders/j2/x6ckkbrn08g8536d6_n3_ywm0000gn/T/tmpMkhtBs_BUILD_ROOT/hello.cpp"',))]. Visualized as /var/folders/j2/x6ckkbrn08g8536d6_n3_ywm0000gn/T/tmpQnrY04.dot
witty-crayon-22786
04/13/2018, 3:30 AMwitty-crayon-22786
04/13/2018, 3:31 AMwitty-crayon-22786
04/13/2018, 3:31 AM@rule(JVMImports, [Select(Snapshot)])
def extract_imports(snapshot):
# TODO
cmd = tuple(['/Users/stuhood/src/pants/extractimports'] + [f.path for f in snapshot.files])
result = yield Get(ExecuteProcessResult,
ExecuteProcessRequest(cmd, [], snapshot.fingerprint, snapshot.digest_length))
if result.exit_code:
raise Exception('Import extraction `{}` failed ({}):\n{}'.format(
' '.join(cmd), result.exit_code, result.stderr))
def packages():
matched = set()
for p in result.stdout.splitlines():
match = _PACKAGE_RE.match(p.strip())
if match:
yield JVMPackageName(match.group(1))
yield JVMImports(set(packages()))