Kconfig preprocessor: couldn't parse 'default $(shell ...
wizardofoz123 opened this issue · 4 comments
Hi,
when I run Kconfiglib on v4.18-rc4 upstream kernel, I get:
init/Kconfig:16: couldn't parse ' default
It looks like a tiny expansion issue in the new Kconfig preprocessor.
Best regards,
Jakub
@wizardofoz123
Hello,
Are you running it via scriptconfig
/iscriptconfig
, or manually?
More environment variables are referenced in the Kconfig files now, which will need to be set if you run it manually. See the updated docstring at the top of kconfiglib.py
for a list.
I suspect you're missing srctree
(which you can set to .
) and CC
(can set it to gcc
for example).
Check above the error for related warnings as well. You might see something about /scripts/gcc-version.sh
not being found.
On a side note, it would be nice if you could assume that there was a just a single Kconfig tree and always warn for stuff like references to undefined symbols (have to implement that manually now). Unfortunately, there's quite a lot of Kconfig files that are shared between different architectures in the kernel, which gives some (usually) safe undefined references.
I wonder if it might be okay to always warn for references to undefined environment variables though...
Yes, this was just a missing srctree
, that wasn't required before. Thanks!
I'm not sure about undefined symbols, this may add a bit more "noise".
I'd leave it as-is, until someone really needs it.
@wizardofoz123
No problem. Wonder if I should add a note about it in the README. Looks like brokenness otherwise...
Yeah... wouldn't want it for the kernel at least. Been thinking of adding a "single-tree" mode, with a flag passed to Kconfig.__init__()
or the like. Knowing that there's no shared stuff would make it safe to flag references to undefined symbols in the library itself.