Message ID | 20220126181807.3022258-1-hanlinchen@chromium.org |
---|---|
State | Accepted |
Commit | 7ea52d2b586144fdc033a3ffc1c4a4bbb99b5440 |
Headers | show |
Series |
|
Related | show |
Hi Han-Lin, Thank you for the patch. On Thu, Jan 27, 2022 at 02:18:07AM +0800, Han-Lin Chen wrote: > It's to fix build errors with mojom in ChromeOS chroot. The reason is that > ChromeOS recently moves native mojom generators module into site-packages, > which has higher import precedence than the local namespace package and shadows > the local package of the same. Add __init__.py to make it an explicit package > to avoid shadowing. > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> That's interesting. It led me to try and understand how python searches for modules. A directory with an __init__.py file is considered to be a regular package, while a directory without such a file is a namespace package. The same search order is used for both, but namespace packages are only considered if no regular package can be found. This is described in https://www.python.org/dev/peps/pep-0420/#specification. Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > utils/ipc/generators/__init__.py | 0 > 1 file changed, 0 insertions(+), 0 deletions(-) > create mode 100644 utils/ipc/generators/__init__.py > > diff --git a/utils/ipc/generators/__init__.py b/utils/ipc/generators/__init__.py > new file mode 100644 > index 00000000..e69de29b
Hi Han-Lin, On Thu, Jan 27, 2022 at 02:18:07AM +0800, Han-Lin Chen wrote: > It's to fix build errors with mojom in ChromeOS chroot. The reason is that > ChromeOS recently moves native mojom generators module into site-packages, > which has higher import precedence than the local namespace package and shadows > the local package of the same. Add __init__.py to make it an explicit package > to avoid shadowing. > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Paul ELder <paul.elder@ideasonboard.com> > --- > utils/ipc/generators/__init__.py | 0 > 1 file changed, 0 insertions(+), 0 deletions(-) > create mode 100644 utils/ipc/generators/__init__.py > > diff --git a/utils/ipc/generators/__init__.py b/utils/ipc/generators/__init__.py > new file mode 100644 > index 00000000..e69de29b > -- > 2.35.0.rc0.227.g00780c9af4-goog >
diff --git a/utils/ipc/generators/__init__.py b/utils/ipc/generators/__init__.py new file mode 100644 index 00000000..e69de29b
It's to fix build errors with mojom in ChromeOS chroot. The reason is that ChromeOS recently moves native mojom generators module into site-packages, which has higher import precedence than the local namespace package and shadows the local package of the same. Add __init__.py to make it an explicit package to avoid shadowing. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> --- utils/ipc/generators/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 utils/ipc/generators/__init__.py