Commit fe43131
committed
Auto merge of rust-lang#132635 - kiike:fix/dots_in_target, r=onur-ozkan
bootstrap: add quoting support to avoid splitting
With this change, it is now possible to pass quotes to the configure script, such as
`./configure.py --set=target.\"thumbv8m.main-none-eabi\".linker=/linker`
or
`./configure.py '--set=target."thumbv8m.main-none-eabi".linker=/linker'`
, which will treat `thumbv8.main-none-eabi` as a whole part. Currently, the string would be split into two elements: `thumbv8`, and `main-none-eabi`.
The approach taken is to perform custom splitting instead of using `str.split()` and then repairing the split. Also, There are numerous corner cases not handled: the custom split doesn't differentiate between single quotes or double quotes, so it is perfectly possible to pass `./configure.py --set=target.\"thumbv8m.main-none-eabi\'.linker=/linker` and the behaviour would be the same as with all double quotes or single quotes.
As for the code, i'm unsure on whether to delimit strings with double or single quotes. I've seen both single quotes and double quotes used to delimit strings, like in
```py
err("Option '{}' provided more than once".format(key))
```
and this a handful of lines down:
```py
if option.name == 'sccache':
set('llvm.ccache', 'sccache', config)
```
Please advise on the wanted one.
Fixes rust-lang#130602
r? `@onur-ozkan`
Thanks in advance for the feedback!1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
291 | | - | |
292 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
| |||
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
301 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
302 | 310 | | |
303 | 311 | | |
304 | 312 | | |
| |||
0 commit comments