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

"west zephyr-export" dumps stack if cmake is not installed #27375

Closed
mbolivar-nordic opened this issue Aug 4, 2020 · 1 comment · Fixed by #27401
Closed

"west zephyr-export" dumps stack if cmake is not installed #27375

mbolivar-nordic opened this issue Aug 4, 2020 · 1 comment · Fixed by #27401
Assignees
Labels
area: Build System area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@mbolivar-nordic
Copy link
Contributor

Describe the bug
The west zephyr-export command should fail gracefully if cmake is not installed, but it does not

To Reproduce
Steps to reproduce the behavior:

  1. uninstall cmake
  2. make sure no cmake user package entries exist for zephyr (maybe; optional -- that's how I tested)
  3. west zephyr-export

Output:

$ west zephyr-export
FATAL ERROR: CMake is not installed or cannot be found; cannot build.
Traceback (most recent call last):
  File "/home/mbolivar/zephyrproject/zephyr/scripts/west_commands/export.py", line 59, in run_cmake_and_clean_up
    lines = run_cmake(['-S', str(path), '-B', str(path)],
  File "/home/mbolivar/zephyrproject/zephyr/scripts/west_commands/zcmake.py", line 44, in run_cmake
    log.die('CMake is not installed or cannot be found; cannot build.')
  File "/home/mbolivar/.virtualenvs/west-test/lib/python3.8/site-packages/west/log.py", line 146, in die
    sys.exit(exit_code)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mbolivar/.virtualenvs/west-test/bin/west", line 8, in <module>
    sys.exit(main())
  File "/home/mbolivar/.virtualenvs/west-test/lib/python3.8/site-packages/west/app/main.py", line 780, in main
    app.run(argv or sys.argv[1:])
  File "/home/mbolivar/.virtualenvs/west-test/lib/python3.8/site-packages/west/app/main.py", line 106, in run
    self.run_command(argv)
  File "/home/mbolivar/.virtualenvs/west-test/lib/python3.8/site-packages/west/app/main.py", line 339, in run_command
    self.run_extension(args.command, argv)
  File "/home/mbolivar/.virtualenvs/west-test/lib/python3.8/site-packages/west/app/main.py", line 409, in run_extension
    command.run(args, unknown, self.topdir, manifest=self.manifest)
  File "/home/mbolivar/.virtualenvs/west-test/lib/python3.8/site-packages/west/commands.py", line 116, in run
    self.do_run(args, unknown)
  File "/home/mbolivar/zephyrproject/zephyr/scripts/west_commands/export.py", line 48, in do_run
    run_cmake_and_clean_up(share / 'zephyr-package' / 'cmake')
  File "/home/mbolivar/zephyrproject/zephyr/scripts/west_commands/export.py", line 62, in run_cmake_and_clean_up
    msg = [line for line in lines if not line.startswith('-- ')]

Expected behavior

No stack dump, just a clean error message

Impact

Annoyance

Environment (please complete the following information):

  • Commit SHA or Version used: d5e1753
@mbolivar-nordic mbolivar-nordic added the bug The issue is a bug, or the PR is fixing a bug label Aug 4, 2020
@mbolivar-nordic mbolivar-nordic added area: Build System area: West West utility priority: low Low impact/importance bug labels Aug 4, 2020
@tejlmand
Copy link
Collaborator

tejlmand commented Aug 6, 2020

Thanks for raising this.
It actually gave me the opportunity to cleanup Zephyr export, something I have wanted to do for some time, but as things were working, I found no reason.

Fixed now.

tejlmand added a commit to tejlmand/zephyr that referenced this issue Aug 6, 2020
Fixes: zephyrproject-rtos#27375

This is a cleanup of the Zephyr CMake package export.
The code has been simplified so that the export now happens through a
CMake script. This avoids several generated CMake build files compared
to previous export mode, and thus removes the need for a CMake pristine
script.

A benefit of this cleanup is that it also fixes zephyrproject-rtos#27375.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
nashif pushed a commit that referenced this issue Aug 19, 2020
Fixes: #27375

This is a cleanup of the Zephyr CMake package export.
The code has been simplified so that the export now happens through a
CMake script. This avoids several generated CMake build files compared
to previous export mode, and thus removes the need for a CMake pristine
script.

A benefit of this cleanup is that it also fixes #27375.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants