-
Notifications
You must be signed in to change notification settings - Fork 124
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
Better support for projects with imports when users do not want/have them locally #652
Comments
For commands: For API calls: unless the exceptions generated by the API are confusing, I think that's a problem for the user of the west API, not west itself. |
To be clear, 'groups' and 'import' cannot be combined in a single project. This is not a question of priority, but semantics. Import filtering is a separate enhancement that has been discussed to try to do filtering of imports in a way that doesn't use 'groups'.
As a design principle I have tried to avoid situations that lead to nondeterministic 'west update' behavior (unless the user explicitly asked for it with branches as project revisions) without a good reason. I don't see a great reason here, but I haven't thought about it hard.
See previous comment.
I don't think this is the way. Consider a situation where 'import:' is used recursively and you aren't sure where in the tree a particular extension command is defined (extension commands have a first-project-which-defines-the-extension "wins" semantics). In practice, and in general, you basically have to resolve the entire manifest before you can make a decision about what extensions are defined where.
Extending 'west init' was discussed and rejected a while ago (#52), but feel free to pursue this if you think the discussion in there should be revisited.
I deliberately decoupled active and inactive projects from enabled and disabled project groups for this reason: I wanted to leave open the option of adding new ways to make a project definition inactive. So this is a possibility, but IMO is likely overkill if we can get by with #654. |
Thanks @mbolivar-nordic
Just one note: This would be an option for savvy users who would otherwise do even more adhoc things, maybe for CI. If the user wants an extension command but does not know where it is, he better doesn't pull single projects, or the like. |
Hi @mbolivar-nordic , |
+1, isn't that just #644? It should really be possible to somehow get to a working state without downloading everything first. I mean a working state for "core" west commands of course, ignoring project-specific extensions. This is especially true considering zephyr/west.yml seems to be growing out of control with little concern for modularity. |
This involves a rework of the group filter mechanism, which has the side effect of fixing its behavior to match its documentation. We can therefore drop the xfail on a related test. This is a top level manifest key that takes a boolean. The default value is 'true' and is west's current behavior. The behavior when this value is false can be shown by this example: manifest: group-filter: [-foo] import-group-filters: false projects: - name: proj import: true self: import: submanifest.yml Here, the final Manifest.group_filter attribute for the manifest whose data are shown above will always be [-foo], regardless of what whe imported manifest data from 'proj' or 'submanifest.yml' are. The purpose of this extension is to allow the combination of 'groups' and 'import': - In previous versions of west, we could not combine the two, because in pathological edge cases, we could end up resolving an import for a group which was later disabled by an import that happened later on. - With this new backwards-compatible enhancement to the manifest file format, we can combine 'import:' with 'groups:' in a single project whenever 'import-group-filters:' is 'false'. This is because we will know the final 'group_filter' attribute for the entire Manifest at the time we perform the import, and it cannot be changed later by any imports we might perform. Since this new behavior would break backwards compatibility if made the default, we make it explicitly opt-in by requiring 'import-group-filters: false'. Fixes: zephyrproject-rtos#663 Fixes: zephyrproject-rtos#652 Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
When a manifest has a project with an import, west requires that project to be present locally so it can resolve the whole manifest before it can do quite a few of its functions.
If that is not the case, some west commands/API operations will fail in a bit mysterious ways.
Some users are either confused by the way west fails, and or / do not like this requirement, and/or consider it unnecessary.
I create this issue to try to list possible solutions and/or improvements, so maybe be arrive at a nice option.
import
that are also part of a group Enhancement: import filtering #543 viaimport-group-filters:
. This is not possible today, but would solve the problem when the project is not actually necessary (wrt to users being required to always have a project with an import)west update
having a new option to pull "whatever is the minimum needed" for west to work further. That is, all projects with imports, apart from the projects which may be explicitly listed. For ex.west update --and_required project_x project_y
. (This would mitigate the problem for users and CI)west init
having a new option to pull "whatever is the minimum needed" for west to work further...import
that are also part of a group by tracking relevant groups that were enabled at the time we did such an import, and erroring out if an attempt is made in a group-filter processed later that disables any of those relevant groupThe text was updated successfully, but these errors were encountered: