73c3c787abbe1ca71b900f11bb880e1de09c6d2a,src/python/pants/engine/process.py,,find_binary,#Any#,376

Before Change


        CreateDigest([FileContent(script_path, script_content.encode(), is_executable=True)]),
    )

    paths = []
    search_path = create_path_env_var(request.search_path)
    result = await Get(
        FallibleProcessResult,
        // We use a volatile process to force re-run since any binary found on the host system today
        // could be gone tomorrow. Ideally we"d only do this for local processes since all known
        // remoting configurations include a static container image as part of their cache key which
        // automatically avoids this problem.
        UncacheableProcess(
            Process(
                description=f"Searching for `{request.binary_name}` on PATH={search_path}",
                level=LogLevel.DEBUG,
                input_digest=script_digest,
                argv=[script_path, request.binary_name],
                env={"PATH": search_path},
            )
        ),
    )
    if result.exit_code == 0:
        paths.extend(result.stdout.decode().splitlines())

    return BinaryPaths(binary_name=request.binary_name, paths=paths)


def rules():

After Change


    if not request.test_args:
        return dataclasses.replace(binary_paths, paths=[BinaryPath(path) for path in found_paths])

    results = await MultiGet(
        Get(
            FallibleProcessResult,
            UncacheableProcess(
                Process(argv=[path, *request.test_args], description=f"Test binary {path}.")
            ),
        )
        for path in found_paths
    )
    return dataclasses.replace(
        binary_paths,
        paths=[
            BinaryPath.fingerprinted(path, result.stdout)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pantsbuild/pants
Commit Name: 73c3c787abbe1ca71b900f11bb880e1de09c6d2a
Time: 2020-09-13
Author: john.sirois@gmail.com
File Name: src/python/pants/engine/process.py
Class Name:
Method Name: find_binary


Project Name: dmlc/dgl
Commit Name: ac932c665b0a06ea9e222136351f52b5d6772ed0
Time: 2018-12-02
Author: coin2028@hotmail.com
File Name: examples/pytorch/jtnn/jtnn/jtnn_vae.py
Class Name: DGLJTNNVAE
Method Name: assm


Project Name: RaRe-Technologies/gensim
Commit Name: 29d1092d3012b399e9aef0513b13b763ebdf1726
Time: 2020-04-30
Author: radimrehurek@seznam.cz
File Name: setup.py
Class Name:
Method Name: