alert-psychiatrist-14102
10/17/2023, 4:27 PMpex_binary
- seems to be rebuilding all the requirements, even on a tiny code change (not involving requirements). resulting in long build times. What would be the way to go about it?happy-kitchen-89482
10/17/2023, 5:21 PMhappy-kitchen-89482
10/17/2023, 5:22 PMalert-psychiatrist-14102
10/17/2023, 5:48 PMpex_binary(
name="launcher",
dependencies=[
"//:version_file",
"./data:stimuli_data",
],
entry_point="launcher.py",
)
And that happens after adding a few new lines to launcher.py
(goes on for 70s)better-van-82973
10/17/2023, 5:51 PMalert-psychiatrist-14102
10/17/2023, 5:52 PMalert-psychiatrist-14102
10/17/2023, 5:59 PM-ldebug
. Looks like pants thinks something in options chaged, event through it did not..
20:55:16.15 [DEBUG] specs are: Specs(includes=RawSpecs(description_of_origin='CLI arguments', address_literals=(AddressLiteralSpec(path_component='stimulus', target_component='launcher', generated_component=None, parameters=FrozenDict({})),), file_literals=(), file_globs=(), dir_literals=(), dir_globs=(), recursi
ve_globs=(), ancestor_globs=(), unmatched_glob_behavior=<GlobMatchErrorBehavior.error: 'error'>, filter_by_global_options=True, from_change_detection=False), ignores=RawSpecs(description_of_origin='CLI arguments', address_literals=(), file_literals=(), file_globs=(), dir_literals=(), dir_globs=(), recursive_globs
=(), ancestor_globs=(), unmatched_glob_behavior=<GlobMatchErrorBehavior.error: 'error'>, filter_by_global_options=False, from_change_detection=False))
20:55:16.15 [DEBUG] changed_options are: ChangedOptions(since=None, diffspec=None, dependents=<DependentsOption.NONE: 'none'>)
20:55:16.15 [DEBUG] Launching 1 roots (poll=false).
20:55:16.15 [DEBUG] Dependency SessionValues of Some("@rule(pants.engine.internals.options_parsing.parse_options())") changed.
broad-processor-92400
10/17/2023, 11:12 PMbroad-processor-92400
10/17/2023, 11:15 PMpants run path/to/launcher.py
which is even faster than the packed layout (it conceptually combines the best bits of both optimisations). This may not work for how you need to invoke it, thoughalert-psychiatrist-14102
10/18/2023, 9:53 AMrequirements.pex
, app.pex
. What would be the command line?
Re using pants run
- possible in our case, but adds some complication to our dev environment. I'd prefer the separate pexs solution if I can make it work.broad-processor-92400
10/18/2023, 2:40 PMPEX_PATH=requirements.pex app.pex
. That is, setting the PEX_PATH environment variable to point to the requirements file https://pex.readthedocs.io/en/latest/api/vars.html
(I’m on mobile at the moment so no direct link, and I can’t experiment)
That’s pretty fiddly, so I’d recommend trying the packed
layout first, and only putting effort into PEX_PATH and/or pants run
if that doesn’t work (and the packed layout likely still makes the two-pex option faster too)alert-psychiatrist-14102
10/22/2023, 8:47 AM