patman: ImportError
Stefan Bosch
stefan_b at posteo.net
Tue May 26 17:07:19 CEST 2020
Hi Simon,
Am 20.05.20 um 18:07 schrieb Stefan Bosch:
> Hi Simon,
>
> Am 20.05.20 um 02:52 schrieb Simon Glass:
>> Hi Stefan,
>>
>> On Sun, 17 May 2020 at 07:54, Stefan Bosch <stefan_b at posteo.net> wrote:
>>>
>>> Hi Simon,
>>>
>>> Am 17.05.20 um 01:03 schrieb Simon Glass:
>>>> Hi Stefan,
>>>>
>>>> On Sat, 16 May 2020 at 05:27, Stefan Bosch <stefan_b at posteo.net> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> recently, I updated my local repository (U-Boot master). Last
>>>>> commit is
>>>>> c693f212c5b0433b3a49a89d87cbff28bf78eb87 now. Previously it has been
>>>>> 4df3578119b043d76b86b50077b06898fc2a4f62 (Date: Wed Dec 18 18:25:42
>>>>> 2019 +0100).
>>>>>
>>>>> Now I get an "ImportError" if I call patman:
>>>>>
>>>>> u-boot_master$ ./tools/patman/patman --help
>>>>> Traceback (most recent call last):
>>>>> File "./tools/patman/patman", line 21, in <module>
>>>>> from patman import checkpatch
>>>>> File
>>>>> "/home/stefan/u-boot_master/tools/patman/../patman/checkpatch.py",
>>>>> line
>>>>> 10, in <module>
>>>>> from patman import command
>>>>> File
>>>>> "/home/stefan/u-boot_master/tools/patman/../patman/command.py",
>>>>> line 8, in <module>
>>>>> from patman import tools
>>>>> File
>>>>> "/home/stefan/u-boot_master/tools/patman/../patman/tools.py",
>>>>> line 13, in <module>
>>>>> from patman import command
>>>>> ImportError: cannot import name 'command'
>>>>>
>>>>> Cause of this 'ImportError' is probably that "from patman import
>>>>> command" has already been done before in checkpatch.py (circular
>>>>> dependency). I think the error has to do with your your commit
>>>>> bf776679a73f3b9eae37aabd2be5754483039cb2 (patman: Move to absolute
>>>>> imports).
>>>>>
>>>>> My Python version is 3.4.3.
>>>>
>>>> The circular dependency has been there for some time, but perhaps in
>>>> Python 2, not Python 3. My Python is 3.6.9 or 3.7.7.
>>>>
>>>> I sent a patch to break the circular dependency. Can you please try it
>>>> and see if it helps?
>>>>
>>>> Regards,
>>>> Simon
>>>>
>>>
>>> Thanks for your quick reply. I tried your patch, the good news is that
>>> the ImportError for 'command' has been gone. The bad news is that the
>>> same occurs for 'checkpatch' now:
>>>
>>> $ ./tools/patman/patman --help
>>> Traceback (most recent call last):
>>> File "./tools/patman/patman", line 21, in <module>
>>> from patman import checkpatch
>>> File
>>> "/home/stefan/u-boot_master/tools/patman/../patman/checkpatch.py", line
>>> 11, in <module>
>>> from patman import gitutil
>>> File "/home/stefan/u-boot_master/tools/patman/../patman/gitutil.py",
>>> line 10, in <module>
>>> from patman import checkpatch
>>> ImportError: cannot import name 'checkpatch'
>>
>> OK I will try a new patch.
>>
>> Which distribution are you using?
>>
>> Regards,
>> Simon
>>
>
> I am using Ubuntu 14.04 (Kernel "3.13.0-170-generic").
>
> Thanks for the new patch. Unfortunately I get the following ImportError
> now:
>
> $ ./tools/patman/patman --help
> Traceback (most recent call last):
> File "./tools/patman/patman", line 21, in <module>
> from patman import checkpatch
> File
> "/home/stefan/u-boot_master/tools/patman/../patman/checkpatch.py", line
> 11, in <module>
> from patman import gitutil
> File "/home/stefan/u-boot_master/tools/patman/../patman/gitutil.py",
> line 12, in <module>
> from patman import series
> File "/home/stefan/u-boot_master/tools/patman/../patman/series.py",
> line 8, in <module>
> from patman import get_maintainer
> File
> "/home/stefan/u-boot_master/tools/patman/../patman/get_maintainer.py",
> line 8, in <module>
> from patman import gitutil
> ImportError: cannot import name 'gitutil'
>
> Regards
> Stefan
Patman itself is working now with Patch-series v3, thanks a lot for your
efforts. Unfortunately I still have an ImportError when building certain
boards, e.g.
$ make axm_defconfig
$ make -j4 ARCH=arm
CROSS_COMPILE=/opt/gcc-linaro-6.4.1-2018.05-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
causes the following error:
...
DTOC C spl/dts/dt-platdata.c
LDS spl/u-boot-spl.lds
DTOC H include/generated/dt-structs-gen.h
Traceback (most recent call last):
File "./tools/dtoc/dtoc", line 43, in <module>
from patman import test_util
File "/home/stefan/u-boot_master/tools/dtoc/../patman/test_util.py",
line 14, in <module>
from patman import test_util
ImportError: cannot import name 'test_util'
Traceback (most recent call last):
File "./tools/dtoc/dtoc", line 43, in <module>
from patman import test_util
File "/home/stefan/u-boot_master/tools/dtoc/../patman/test_util.py",
line 14, in <module>
from patman import test_util
ImportError: cannot import name 'test_util'
scripts/Makefile.spl:324: recipe for target
'include/generated/dt-structs-gen.h' failed
make[1]: *** [include/generated/dt-structs-gen.h] Error 1
make[1]: *** Waiting for unfinished jobs....
scripts/Makefile.spl:327: recipe for target 'spl/dts/dt-platdata.c' failed
make[1]: *** [spl/dts/dt-platdata.c] Error 1
Makefile:1934: recipe for target 'spl/u-boot-spl' failed
make: *** [spl/u-boot-spl] Error 2
If I remove "from patman import test_util" in tools/patman/test_util.py
there is no error anymore (at least for the axm board). I think this is
a Bug becuase it is not necessary to import test_util inside itself?!
Regards
Stefan
More information about the U-Boot
mailing list