Unable to run custom west commands before all imported repositories are cloned
See original GitHub issueIf a manifest imports from other projects, no custom west commands can be run from any project until all imported projects have been cloned. For example, if a manifest has the following form:
projects:
- name: internal1
revision: some-branch
- name: internal2
revision some-branch
- name: zephyr
remote: zephyr
revision: v2.5.0
import:
name-whitelist:
- proj1
- proj2
- name: external1
remote: external-repo
revision: v1.1.0
import:
name-whitelist:
- proja
self:
west-commands: scripts/west-commands.yml
Custom commands from the scripts/west-commands.yml
will be unavailable until both zephyr
and external1
are cloned. This can be a problem if some of the custom commands do important environment setup or supplement west update
in some way; forcing user to west update
before running the custom commands that are required for setting up/updating their environment properly.
Suggestion would be to ignore non-cloned imports from the repository instead of causing them to cancel the additional of all custom commands entirely.
(Note, in our project, we have replaced west update
with another command that does what west update
does as well as some other tasks, but we cannot run this custom command on new workspaces nor if the manifest is changed to include new imported projects, even though the custom command is defined in the same repository as the manifest file and thus always available)
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (2 by maintainers)
Ive created a simple example for you to see. It does seem to be tied to import, from what Ive observed: https://github.com/mrrosen/manifest
If you delete the import statement for Zephyr, the command works fine:
Thanks, this clarifies.
First, I think you should really maintain your own clones and rebase them regularly but I understand automating a rebase can be scary so let’s leave that aside.
Now sticking to your dynamic patching approach there is a tool much better than
patch
to implement the exact same approach:git merge
! In other words store your patches into a git branch somewhere; you do NOT need to rebase this branch regularly. Then perform a one-linegit merge --no-edit my-custom-patches
at build time.Unlike
patch
,git merge
is smart enough to realize something has already been merged and do nothing if you run it multiple times (idempotence). So you can make it part ofwest build
and run it as many time as you want. I agree making “dynamic patching” part ofwest update
feels much more logical, on the other hand makinggit merge
part ofwest build
Just Works. This is exactly what github continuously does for every Pull Request BTW, find the result in everypull/12345/merge
Other huge benefits of
git merge
overpatch
:git status
andgit describe ---dirty
.patch
files any more (the horror)It’s not because many people are still stuck with obsolete
.patch
files that they are a good idea 😃