Use shlex.split for executables in config file. - #27397
Conversation
c50e3c9 to
1f917c1
Compare
| return x | ||
| return [x] | ||
| if type(x) is list: | ||
| logger.warning(f'Found list-style config entry ({x}). Please use a single string with spaces between args.') |
There was a problem hiding this comment.
I'm not opposed to this warning, but I think it will start to show for many of our users?
There was a problem hiding this comment.
I don't think its will since the default config (i.e. tools/config_template.py has not used this syntax in the long time).
I think the last usage of this in the config template was the SPIDERMONKEY_ENGINE entry which was removed in 2019: #9469
What users are you thinking of?
There was a problem hiding this comment.
I was thinking of old installs which might have older versions of the config template. I guess maybe that's rare, though, if people reinstall every few years anyhow (new machine, etc.)
This allows simple strings like: ``` NODE_JS = '/path/to/node --with-arg' ``` Rather than the harder-to-parse: ``` NODE_JS = ['/path/to/node', '--with-arg'] ``` The idea is that perhaps we can just simplify our existing config format rather then converting to completely new one. See emscripten-core#27219
kripken
left a comment
There was a problem hiding this comment.
Maybe we can land it and see if tot users complain.
…ig file This ended up breaking emsdk in ways that would require more complexity to fix. See emscripten-core/emsdk#1752. This issue is that if emsdk is installed in the path contains spaces the NODE_JS path, for example, then needs to be quoted correctly in the config file. e.g. `NODE_JS = '"path with spaces/bin/node"'. Instead I think we should just revert this change. It turns out not to be needed for emscripten-core#27401 anyway since the LLVM_ROOT is never a list anyway.
This ended up breaking emsdk in ways that would require more complexity to fix. See emscripten-core/emsdk#1752. This issue is that if emsdk is installed in the path contains spaces the NODE_JS path, for example, then needs to be quoted correctly in the config file. e.g. `NODE_JS = '"path with spaces/bin/node"'. Instead I think we should just revert this change. It turns out not to be needed for #27401 anyway since the LLVM_ROOT is never a list anyway.
This allows simple strings like:
Rather than the harder-to-parse:
The idea is that perhaps we can just simplify our existing config format rather then converting to completely new one.
See #27219