Commit 43583d1
authored
fix(bzlmod): let workspace-invoked python_register_toolchains to register toolchains (bazel-contrib#2289)
While migrating to bzlmod, users may have a hybrid build where WORKSPACE
contains
python_register_toolchain() calls. Because these calls originate from
WORKSPACE files,
the `native.register_toolchain` APIs are still available. At the same
time, we still
detect that bzlmod is enabled, and thus disable calling those functions.
The net
effect is, users aren't able to register toolchains in such a hybrid
setup. At the
same time, because the code path is shared, we can't have the bzlmod
toolchain code
try to call them, as it'll fail.
To accomodate both cases, have the bzlmod toolchain code pass a special
arg so that
`python_register_toolchains` knows to skip parts that don't apply to the
bzlmod toolchain
invocation.
This was all unwound by some users and pointed out in a Slack thread. A
few people are
manually carrying an equivalent patch for a working hybrid mode.
Fixes bazel-contrib#16751 parent 1388a89 commit 43583d1
4 files changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 77 | + | |
| 78 | + | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
| |||
169 | 167 | | |
170 | 168 | | |
171 | 169 | | |
172 | | - | |
| 170 | + | |
173 | 171 | | |
174 | 172 | | |
175 | 173 | | |
| |||
0 commit comments