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

Imported west-commands don't resolve when module manifest isn't in module root #725

Open
urob opened this issue Aug 15, 2024 · 1 comment

Comments

@urob
Copy link

urob commented Aug 15, 2024

When manifest isn't in the root of a module, then custom west-commands don't resolve when imported from another Zephyr workspace.

Example: https://github.com/zmkfirmware/zmk

The manifest file is located at /app/west.yml. The manifest adds custom commands from /app/scripts/west-commands.yml:

# ZMK manifest
manifest:
  # ...
  self:
    west-commands: scripts/west-commands.yml

When zmk is the topdir of the workspace, both the path to west-commands.yml and the paths to any script defined therein are interpreted relative to /app.

However, when zmk is imported from another Zephyr workspaces as follows, the paths won't resolve correctly:

# Main manifest of Zephyr workspace
manifest:
  projects:
    - name: zmk
      # ...
      import: app/west.yml

In this case, both the west-commands from the imported ZMK manifest as well as the paths to any script defined therein are interpreted as relative to /zmk (rather than /zmk/app), resulting in none of the commands being found.


Note that overwriting west-commands from the topdir manifest with west-commands: app/scripts/west-commands.yml resolves the first problem of /zmk/app/scripts/west-commands.yml being found, but still interprets the paths to any script therein relative to /zmk.

@marc-hb
Copy link
Collaborator

marc-hb commented Aug 15, 2024

Thanks for the great bug report. The inconsistency that you described really looks like a bug. Unfortunately, there is a serious shortage on the west maintenance side so unless you can find a volunteer for a fix (and... a test) I'm afraid you will have to find workarounds.

urob added a commit to urob/zmk that referenced this issue Aug 15, 2024
- Namespace `zephyr` under `modules`
- Fix `west-commands` paths to work when ZMK is loaded as module
  (cf, zephyrproject-rtos/west#725)
urob added a commit to urob/zmk that referenced this issue Aug 15, 2024
- Namespace `zephyr` under `modules`
- Fix `west-commands` paths to work when ZMK is loaded as module
  (cf, zephyrproject-rtos/west#725)
urob added a commit to urob/zmk that referenced this issue Aug 15, 2024
- Namespace `zephyr` under `modules`
- Fix `west-commands` paths to work when ZMK is loaded as module
  (cf, zephyrproject-rtos/west#725)
urob added a commit to urob/zmk that referenced this issue Aug 15, 2024
- Namespace `zephyr` under `modules`
- Fix `west-commands` paths to work when ZMK is loaded as module
  (cf, zephyrproject-rtos/west#725)
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