Skip to content

Instantly share code, notes, and snippets.

// strongly connected component:
digraph {
0 [label="@rule(pants.engine.internals.build_files:152:addresses_with_origins_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> AddressesWithOrigins, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Snapshot, PathGlobs), Get(AddressFamily, Dir)])"]
1 [label="@rule(pants.engine.internals.graph:424:addresses_with_origins_from_filesystem_specs(FilesystemSpecs, GlobalOptions) -> AddressesWithOrigins, gets=[Get(Snapshot, PathGlobs), Get(Owners, OwnersRequest)])"]
2 [label="@rule(pants.engine.internals.graph:470:resolve_addresses_with_origins(Specs) -> AddressesWithOrigins, gets=[Get(AddressesWithOrigins, AddressSpecs), Get(AddressesWithOrigins, FilesystemSpecs)])"]
3 [label="@rule(pants.engine.internals.graph:172:resolve_unexpanded_targets(Addresses) -> UnexpandedTargets, gets=[Get(WrappedTarget, Address)])"]
4 [label="@rule(pants.engine.internals.build_files:221:strip_address_or
// strongly connected component:
digraph {
0 [label="NodeIndex(51): @rule(pants.engine.process:219:fallible_to_exec_result_or_raise(FallibleProcessResult, ProductDescription) -> ProcessResult)"]
1 [label="NodeIndex(66): @rule(<intrinsic>(MultiPlatformProcess, Platform) -> FallibleProcessResultWithPlatform)"]
2 [label="NodeIndex(83): @rule(pants.backend.python.rules.pex_environment:129:find_pex_python(PythonSetup, PexRuntimeEnvironment, SubprocessEnvironment) -> PexEnvironment, gets=[Get(BinaryPaths, BinaryPathRequest)])"]
3 [label="NodeIndex(107): @rule(pants.engine.process:237:remove_platform_information(FallibleProcessResultWithPlatform) -> FallibleProcessResult)"]
4 [label="NodeIndex(139): @rule(pants.engine.process:208:get_multi_platform_request_description(MultiPlatformProcess) -> ProductDescription)"]
5 [label="NodeIndex(170): @rule(pants.core.util_rules.external_tool:171:download_external_tool(ExternalToolRequest) -> DownloadedExternalTool, gets=[Get(Digest, DownloadFile), Get(E
@rule(Logger, [Workunit])
def logger(workunit):
# Maybe we don't need both `Logger` and `Workunit`?
..
@rule(Classpath, [Logger, Target])
def compile_some_stuff(logger, target):
..
@console_rule(Compile, [Specs])
[info] Non-compiled module 'compiler-interface' for Scala 2.10.6. Compiling...
/var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/sbt_2a44fe22/xsbt/ClassName.scala:23: error: not found: value enteringPhase
enteringPhase(currentRun.flattenPhase.next) { s fullName separator }
^
/var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/sbt_2a44fe22/xsbt/ClassName.scala:73: error: not found: value enteringPhase
enteringPhase(currentRun.picklerPhase.next) {
^
/var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/sbt_2a44fe22/xsbt/ClassName.scala:83: error: not found: value enteringPhase
enteringPhase(currentRun.picklerPhase.next) { s.fullNameAsName('.') }
PEX-INFO
__main__.py
__main__.pyc
thrift.EiXtCn
thrift.efsw5Y
thrift.s5BL82
twitter
.pants.d/python-setup/chroots/6989e2e8e3cdedc3e8301919e289f60ad3e4d013//.bootstrap/_markerlib:
__init__.py
13:24:19 00:01 [run]
Detected interpreter /usr/bin/python: CPython-2.7.5
Detected interpreter /Users/stuhood/Python/CPython-2.7.8/bin/python2.7: CPython-2.7.8pex: Found site-library: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
pex: Found site-library: /Library/Python/2.7/site-packages
pex: Found site extra: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/../../Extras/lib/python
pex: Not a tained path element: /Users/stuhood/src/source/.pants.d/python-setup/chroots/6989e2e8e3cdedc3e8301919e289f60ad3e4d013/.bootstrap
pex: Not a tained path element: /Users/stuhood/src/source/.pants.d/python-setup/chroots/6989e2e8e3cdedc3e8301919e289f60ad3e4d013
pex: Not a tained path element: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
pex: Not a tained path element: /System
13:22:49 00:02 [run]
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x10939c6d0>
pex: Fetching https://science-binaries.local.twitter.com/home/third_party/python/setuptools-5.4.1.tar.gz: 272.3ms.4.1.tar.gzpex: Fetching https://science-binaries.local.twitter.com/home/third_party/python/setuptools-5.4.1.tar.gz
pex: Installing /var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/tmpxixEgI: 442.9msT/tmpX7TNDO/setuptools-5.4.1.tar.gzpex: Installing /var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/tmpxixEgI
installed /Users/stuhood/src/source/.pants.d/python-setup/interpreters/CPython-2.7.8.tmp.42a3678ccc6b4e2ab395acc0de6169c1/setuptools-5.4.1-py2.7.eggpex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x10a107b90>
pex: Fetching https://science-binaries.local.twitter.com/home/third_party/python/wheel-0.24.0.tar.gz: 72.9ms.24.0.tar.gzpex: Fetching https://science-binaries.local.twitter.com/home/third_party/pyt
13:26:19 00:02 [run]
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x10939f6d0>
pex: Fetching https://science-binaries.local.twitter.com/home/third_party/python/setuptools-5.4.1.tar.gz: 384.7ms.4.1.tar.gzpex: Fetching https://science-binaries.local.twitter.com/home/third_party/python/setuptools-5.4.1.tar.gz
pex: Installing /var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/tmpj7aEVc: 464.8msT/tmpygKVqf/setuptools-5.4.1.tar.gzpex: Installing /var/folders/tc/kq93y4pd5jn6gy3pfzd2zd5h0000gn/T/tmpj7aEVc
installed /Users/stuhood/src/source/.pants.d/python-setup/interpreters/CPython-2.7.8.tmp.17d9015e484940c2ab4ff4394311b7b3/setuptools-5.4.1-py2.7.eggpex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x10a108b50>
pex: Fetching https://science-binaries.local.twitter.com/home/third_party/python/wheel-0.24.0.tar.gz: 562.4ms24.0.tar.gzpex: Fetching https://science-binaries.local.twitter.com/home/third_party/pyt
implicit val timer = new MockTimer
val af = Future.sleep(10.seconds).before { Future.value("A") }
val bf = Future.sleep(10.seconds).before { Future.value("B") }
object DeadlineReached extends Exception
def selectWithin(deadline: Time)(remaining: Seq[Future[String]], valuesSoFar: Seq[String] = Seq()): Future[Seq[String]] =
if (remaining.isEmpty) {
Future.value(valuesSoFar)
} else Future.select(remaining).flatMap { s =>
val (t, nextRemaining) = s
scala> def inf(i: Long = 0): Stream[Long] = Stream.cons(i, inf(i+1))
inf: (i: Long)Stream[Long]
scala> val iterable: Iterable[Long] = inf()
iterable: Iterable[Long] = Stream(0, ?)
scala> inf().drop(Int.MaxValue).take(10): Iterable[Long]
res3: Iterable[Long] = Stream(2147483647, ?)