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

Simon Glass sjg at chromium.org
Fri Dec 3 21:13:12 CET 2021


Hi Andy,

On Fri, 3 Dec 2021 at 00:55, Andy Shevchenko <andy.shevchenko at gmail.com> wrote:
>
>
>
> On Friday, December 3, 2021, Simon Glass <sjg at chromium.org> wrote:
>>
>> Hi Andy,
>>
>> On Tue, 30 Nov 2021 at 12:04, Andy Shevchenko
>> <andriy.shevchenko at linux.intel.com> 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 <andriy.shevchenko at linux.intel.com>
>> > ---
>> > v2: reused our_path
>> >  tools/binman/main.py | 11 ++++++++++-
>> >  1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> This look useful, but we cannot rely on 'srcdir' being in the
>> environment.
>
>
> True and code is aware of that. Nothing needs to be fixed.

What am I missing?

$ binman test
Traceback (most recent call last):
  File "/home/sglass/bin/binman", line 23, in <module>
    srctree = os.environ['srctree']
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'srctree'

>>
>>
>> For example, most binman development is done just by
>> running 'binman test' in the source tre. So perhaps default to the
>> current directory is 'srcdir' is not set?
>>
[..]

Regards,
Simon


More information about the U-Boot mailing list