Skip to content

Commit

Permalink
Trying something out.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjyw committed Feb 10, 2020
1 parent 6521881 commit ac08e4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions pants.remote.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ interpreter_search_paths: [
# side, and this can cause pex bootstrapping to fail (for unclear reasons).
# The /pyenv-docker-build/ paths are unlikely to exist on local systems, and so will not interfere with interpreter
# discovery there. This emphasizes that we should fix #7735, and not commingle the paths of two unrelated systems.
'<PATH>',
'<PEXRC>',
#'<PATH>',
#'<PEXRC>',
]

[python-native-code]
Expand Down
25 changes: 10 additions & 15 deletions src/python/pants/backend/python/rules/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
DirectoriesToMerge,
DirectoryWithPrefixToAdd,
)
from pants.engine.isolated_process import ExecuteProcessResult, MultiPlatformExecuteProcessRequest
from pants.engine.isolated_process import ExecuteProcessResult, ExecuteProcessRequest
from pants.engine.legacy.structs import PythonTargetAdaptor, TargetAdaptor
from pants.engine.platform import Platform, PlatformConstraint
from pants.engine.rules import rule, subsystem_rule
Expand Down Expand Up @@ -128,23 +128,18 @@ async def create_pex(
# (execution_platform_constraint, target_platform_constraint) of this dictionary is "The output of
# this command is intended for `target_platform_constraint` iff it is run on `execution_platform
# constraint`".
execute_process_request = MultiPlatformExecuteProcessRequest(
{
(PlatformConstraint(platform.value), PlatformConstraint(platform.value)):
pex_bin.create_execute_request(
python_setup=python_setup,
subprocess_encoding_environment=subprocess_encoding_environment,
pex_build_environment=pex_build_environment,
pex_args=argv,
input_files=merged_digest,
description=f"Create a requirements PEX: {', '.join(request.requirements.requirements)}",
output_files=(request.output_filename,)
)
}
execute_process_request = pex_bin.create_execute_request(
python_setup=python_setup,
subprocess_encoding_environment=subprocess_encoding_environment,
pex_build_environment=pex_build_environment,
pex_args=argv,
input_files=merged_digest,
description=f"Create a requirements PEX: {', '.join(request.requirements.requirements)}",
output_files=(request.output_filename,)
)

result = await Get[ExecuteProcessResult](
MultiPlatformExecuteProcessRequest,
ExecuteProcessRequest,
execute_process_request
)
return Pex(directory_digest=result.output_directory_digest, output_filename=request.output_filename)
Expand Down

0 comments on commit ac08e4c

Please sign in to comment.