Re: [PATCH v3 1/2] binman: Do not pollute source tree when build with `make O=...`

2021-12-28 Thread Simon Glass
Hi Andy,

On Thu, 23 Dec 2021 at 02:07, Andy Shevchenko  wrote:
>
> On Thu, Dec 23, 2021 at 7:08 AM Simon Glass  wrote:
> > On Tue, 14 Dec 2021 at 17:33, Simon Glass  wrote:
> > >
> > > Importing libraries in Python caches the bytecode by default.
> > > Since we run scripts in source tree it ignores the current directory
> > > settings, which is $(srctree), and creates cache just in the middle
> > > of the source tree. Move cache to the current directory.
> > >
> > > Signed-off-by: Andy Shevchenko 
> > > ---
> > > v3: avoided crash (Simon), preserved tree hierarchy
> > >  tools/binman/main.py | 13 -
> > >  1 file changed, 12 insertions(+), 1 deletion(-)
> > >
> > > Applied to u-boot-dm/next, thanks!
> >
> > I didn't notice this before, but this seems to create files like this:
> >
> > ./tools/binman/usr/lib/python3/dist-packages/elftools/common/construct_utils.cpython-39.pyc
> >
> > We don't really want to 'recache' the common Python files. Do you
> > think we should revert this patch, or find another fix?
>
> I'm not sure I understand. efitools is not common, it's a separate
> (non-standard) module and it's cached.

The problem is that we don't want to create this file in the source directory.

For me this file is in:

/usr/lib/python3/dist-packages/elftools/

but it could be in ~/.local I suppose.

In any case, the cache file should go there, shouldn't it?

Regards,
Simon


Re: [PATCH v3 1/2] binman: Do not pollute source tree when build with `make O=...`

2021-12-23 Thread Andy Shevchenko
On Thu, Dec 23, 2021 at 7:08 AM Simon Glass  wrote:
> On Tue, 14 Dec 2021 at 17:33, Simon Glass  wrote:
> >
> > Importing libraries in Python caches the bytecode by default.
> > Since we run scripts in source tree it ignores the current directory
> > settings, which is $(srctree), and creates cache just in the middle
> > of the source tree. Move cache to the current directory.
> >
> > Signed-off-by: Andy Shevchenko 
> > ---
> > v3: avoided crash (Simon), preserved tree hierarchy
> >  tools/binman/main.py | 13 -
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > Applied to u-boot-dm/next, thanks!
>
> I didn't notice this before, but this seems to create files like this:
>
> ./tools/binman/usr/lib/python3/dist-packages/elftools/common/construct_utils.cpython-39.pyc
>
> We don't really want to 'recache' the common Python files. Do you
> think we should revert this patch, or find another fix?

I'm not sure I understand. efitools is not common, it's a separate
(non-standard) module and it's cached.

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v3 1/2] binman: Do not pollute source tree when build with `make O=...`

2021-12-22 Thread Simon Glass
Hi Andy,

On Tue, 14 Dec 2021 at 17:33, Simon Glass  wrote:
>
> Importing libraries in Python caches the bytecode by default.
> Since we run scripts in source tree it ignores the current directory
> settings, which is $(srctree), and creates cache just in the middle
> of the source tree. Move cache to the current directory.
>
> Signed-off-by: Andy Shevchenko 
> ---
> v3: avoided crash (Simon), preserved tree hierarchy
>  tools/binman/main.py | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> Applied to u-boot-dm/next, thanks!

I didn't notice this before, but this seems to create files like this:

./tools/binman/usr/lib/python3/dist-packages/elftools/common/construct_utils.cpython-39.pyc

We don't really want to 'recache' the common Python files. Do you
think we should revert this patch, or find another fix?

Regards,
Simon


Re: [PATCH v3 1/2] binman: Do not pollute source tree when build with `make O=...`

2021-12-14 Thread Simon Glass
Importing libraries in Python caches the bytecode by default.
Since we run scripts in source tree it ignores the current directory
settings, which is $(srctree), and creates cache just in the middle
of the source tree. Move cache to the current directory.

Signed-off-by: Andy Shevchenko 
---
v3: avoided crash (Simon), preserved tree hierarchy
 tools/binman/main.py | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

Applied to u-boot-dm/next, thanks!