Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kconfig preprocessor: couldn't parse 'default $(shell ... #47

Closed
wizardofoz123 opened this issue Jul 10, 2018 · 4 comments
Closed

Kconfig preprocessor: couldn't parse 'default $(shell ... #47

wizardofoz123 opened this issue Jul 10, 2018 · 4 comments

Comments

@wizardofoz123
Copy link

Hi,

when I run Kconfiglib on v4.18-rc4 upstream kernel, I get:

init/Kconfig:16: couldn't parse ' default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC': macro expanded to blank string

It looks like a tiny expansion issue in the new Kconfig preprocessor.

Best regards,
Jakub

@ulfalizer
Copy link
Owner

ulfalizer commented Jul 10, 2018

@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.

@ulfalizer
Copy link
Owner

ulfalizer commented Jul 10, 2018

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...

@wizardofoz123
Copy link
Author

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.

@ulfalizer
Copy link
Owner

ulfalizer commented Jul 10, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants