Commit 5592301
committed
fix ensurepip shebangs via in-process pip monkey-patching
Replace the unsupported --executable pip argument with an in-process
monkey-patch of pip's internal script generation logic.
The bundled version of pip does not support the --executable flag,
causing integration failures (e.g., during 'make install'). This change
intercepts the --executable argument in _run_pip and applies it by
patching pip._internal.operations.install.wheel and
pip._vendor.distlib.scripts.ScriptMaker before the installation starts.
This ensures that scripts installed via ensurepip (with --prefix or
--root) use the correct target interpreter shebang even when
cross-compiling or performing staged installs.1 parent 60417f3 commit 5592301
1 file changed
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
75 | 120 | | |
76 | 121 | | |
77 | 122 | | |
| |||
0 commit comments