Commit 96d1574
authored
feat(pex): support building PEX archives to inherit from the sys.path (#619)
By default PEX archives are built to operate fully hermetically, which
is usually a good idea. However, sometimes it is necessary to use
packages from the hosting environment. One such example is AWS Lambda;
the recommended approach for using PEX to run on Lambda is to build in
this way.[^1]
Mapping of this flag through from the build system largely follows the
equivalent feature in Pants.[^2]
---
### Changes are visible to end-users: yes
- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config):no
- Suggested release notes appear below: no
### Test plan
- Covered by existing test cases
- Manual testing; please provide instructions so we can reproduce:
1. Edit `//py/tests/py-pex-binary:print_modules_pex` to have an explicit
`inherit_path` of a chosen value (e.g. "prefer").
2. `bazel build //py/tests/py-pex-binary:print_modules_pex`.
3. `tar xfO bazel-bin/py/tests/py-pex-binary/print_modules_pex.pex
PEX-INFO | jq '.inherit_path'`
4. Expect result: `"prefer"`.
Do above except without passing an explicit `inherit_path` should give
`"false"`, which confirms the default semantics are preserved.
[^1]: https://github.com/pex-tool/lambdex/blob/main/MIGRATING.md
[^2]:
https://www.pantsbuild.org/stable/reference/targets/pex_binary#inherit_path1 parent 8022c89 commit 96d1574
3 files changed
+32
-1
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| |||
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
| |||
157 | 172 | | |
158 | 173 | | |
159 | 174 | | |
| 175 | + | |
| 176 | + | |
160 | 177 | | |
161 | 178 | | |
162 | 179 | | |
| |||
0 commit comments