Skip to content

Zephyr module uses \ in path on windows when creating Kconfig files #15289

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

Closed
tejlmand opened this issue Apr 9, 2019 · 2 comments
Closed

Zephyr module uses \ in path on windows when creating Kconfig files #15289

tejlmand opened this issue Apr 9, 2019 · 2 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@tejlmand
Copy link
Collaborator

tejlmand commented Apr 9, 2019

The script zephyr_modules.py uses os.path.abspath when generating Kconfig include files for windows.

This causes the generated file to contain path like:

osource "c:\projets\..."

cause the load to fail in windows.

Instead posix style paths should be used.

@tejlmand tejlmand added the bug The issue is a bug, or the PR is fixing a bug label Apr 9, 2019
@tejlmand tejlmand self-assigned this Apr 9, 2019
tejlmand added a commit to tejlmand/zephyr that referenced this issue Apr 9, 2019
Fixes: zephyrproject-rtos#15289

Kconfig requires posix style path when sourcing other files.
As abspath in python will use native host style, i.e. backslash '\' in
windows this will cause invalid paths in Kconfig generated file and
thus the file will never be loaded.

This commit uses PurePath to convert the path to posix style, ensuring
Kconfig can load the modules.

Signed-off-by: Torsten Rasmussen <[email protected]>
@ulfalizer
Copy link
Collaborator

@tejlmand
How does it fail? Kconfiglib should be able to deal with Windows paths.

@ulfalizer
Copy link
Collaborator

Oh, wait, I realized how it fails. "\p" is transformed to just "p", due to how escaping works in strings in Kconfig.

carlescufi pushed a commit that referenced this issue Apr 9, 2019
Fixes: #15289

Kconfig requires posix style path when sourcing other files.
As abspath in python will use native host style, i.e. backslash '\' in
windows this will cause invalid paths in Kconfig generated file and
thus the file will never be loaded.

This commit uses PurePath to convert the path to posix style, ensuring
Kconfig can load the modules.

Signed-off-by: Torsten Rasmussen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

2 participants