Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Pex overhead for changes to source files with run and repl #10406

Closed
Eric-Arellano opened this issue Jul 19, 2020 · 0 comments · Fixed by #10418
Closed

No Pex overhead for changes to source files with run and repl #10406

Eric-Arellano opened this issue Jul 19, 2020 · 0 comments · Fixed by #10418
Assignees
Projects
Milestone

Comments

@Eric-Arellano
Copy link
Contributor

Right now, we build a Pex with the source files. This shouldn't be necessary. We should run the sources as loose files, just like we do with Pytest where we simply populate the chroot with the files.

If done correctly, running ./pants run build-support/bin/check_banned_imports.py would be nearly instantaneous. Changing its contents would not involve re-building a PEX.

We will still use a Pex for third party requirements.

@Eric-Arellano Eric-Arellano added this to the 2.0.0rc0 milestone Jul 19, 2020
@Eric-Arellano Eric-Arellano added this to To do in Pants 2.0 via automation Jul 19, 2020
@Eric-Arellano Eric-Arellano self-assigned this Jul 20, 2020
@Eric-Arellano Eric-Arellano moved this from To do to In progress in Pants 2.0 Jul 21, 2020
stuhood pushed a commit that referenced this issue Jul 21, 2020
)

Whereas `binary` must include source files in the PEX, `run` does not need to. We get less cache invalidation and generally faster performance by instead having the chroot simply be populated with the source files, similar to how we implement Pytest.

We still use a Pex to handle the `entry_point` field and to resolve all 3rd party requirements.

Before, with a whitespace change:
```
▶ /usr/bin/time ./pants run build-support/bin/generate_travis_yml.py > .travis.yml
        2.72 real         0.73 user         0.21 sys
```

After, with a whitespace change:
```
▶ /usr/bin/time ./pants run build-support/bin/generate_travis_yml.py > .travis.yml
        1.87 real         0.73 user         0.21 sys
```

Implements half of #10406.
Pants 2.0 automation moved this from In progress to Done Jul 21, 2020
Eric-Arellano added a commit that referenced this issue Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Pants 2.0
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant