Commit 0aed62c
authored
fix(pypex): spill to a param file for PyPex when necessary (#617)
Binaries with large numbers of source inputs (i.e. large transitive
dependency trees) can lead to the argument vector's size exceeding the
OS' limits. Spilling to a param file when the argument list grows long
avoids this issue.
For smaller argument lists, skipping the param file generation is an
option that results in slightly less build work (one less file to
create).
This change is an alternate implementation of
https://github.com/aspect-build/rules_py/pull/543/files. Unlike that
change, this change uses the dedicated APIs for solving this problem —
`ctx.actions.args.use_param_file` on the Bazel side,
`fromfile_prefix_char` on the ArgumentParser side.
---
### Changes are visible to end-users: yes
- Searched for relevant documentation and updated as needed: yes (no
docs reference this case)
- Breaking change (forces users to change their own code or config): no
* only builds that would have failed previously have their argv spilled
to the param file
* builds that worked because their argv were under-limit when passed
in-line are unchanged in behaviour; they still pass their args inlinei
- Suggested release notes appear below: no
### Test plan
- Covered by existing test cases
- Manual testing: my real application (cannot be shared sadly)
fixes #5421 parent 88716fa commit 0aed62c
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments