* RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
@ 2023-09-03 11:08 Frank Wunderlich
2023-09-04 18:18 ` Krzysztof Kozlowski
0 siblings, 1 reply; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-03 11:08 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski; +Cc: devicetree, linux-kernel
Hi,
i tried to check a binding-file with 6.5 kernelsource and get this error
GNU nano 6.2 dt.log
LINT Documentation/devicetree/bindings
CHKDT Documentation/devicetree/bindings/processed-schema.json
SCHEMA Documentation/devicetree/bindings/processed-schema.json
Traceback (most recent call last):
File "/home/frank/.local/bin/dt-mk-schema", line 38, in <module>
schemas = dtschema.DTValidator(args.schemas).schemas
File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 354, in __init__
self.schemas = process_schemas(schema_files)
File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 271, in process_schemas
sch = process_schema(os.path.abspath(filename))
File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 248, in process_schema
dtsch.is_valid()
File "/home/frank/.local/lib/python3.10/site-packages/dtschema/schema.py", line 145, in is_valid
for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
for error in errors:
File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_validators.py", line 362, in allOf
yield from validator.descend(instance, subschema, schema_path=index)
File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 258, in descend
for error in self.evolve(schema=schema).iter_errors(instance):
block from line 242-258 repeats many times (~2000 lines in log)
File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
for error in errors:
File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_legacy_validators.py", line 216, in recursiveRef
lookup_url, next_target = validator.resolver.resolve(each)
File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 835, in resolve
url = self._urljoin_cache(self.resolution_scope, ref).rstrip("/")
RecursionError: maximum recursion depth exceeded in comparison
make[2]: *** [Documentation/devicetree/bindings/Makefile:68: Documentation/devicetree/bindings/processed-schema.json] Error 1
make[2]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
make[1]: *** [/media/data_nvme/git/kernel/BPI-R2-4.14/Makefile:1516: dt_binding_check] Error 2
make: *** [Makefile:234: __sub-make] Error 2
my command is (after importing defconfig, also tried a clean before):
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
already did an update of dtschema with "pip3 install dtschema --upgrade" and also an uninstall/install of this python-package
$ pip3 show dtschema
Name: dtschema
Version: 2023.7
Summary: DeviceTree validation schema and tools
Home-page: https://github.com/devicetree-org/dt-schema
Author: Rob Herring
Author-email: robh@kernel.org
License: BSD
Location: /home/frank/.local/lib/python3.10/site-packages
Requires: jsonschema, pylibfdt, rfc3987, ruamel.yaml
Required-by:
any idea what can be the cause?
regards Frank
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
2023-09-03 11:08 RecursionError when try to check bindings (ubuntu 22.04 / Python3.10) Frank Wunderlich
@ 2023-09-04 18:18 ` Krzysztof Kozlowski
2023-09-04 18:33 ` Aw: " Frank Wunderlich
2023-09-04 19:17 ` Aw: " Frank Wunderlich
0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-04 18:18 UTC (permalink / raw)
To: Frank Wunderlich, Rob Herring, Krzysztof Kozlowski
Cc: devicetree, linux-kernel
On 03/09/2023 13:08, Frank Wunderlich wrote:
> Hi,
>
> i tried to check a binding-file with 6.5 kernelsource and get this error
>
> GNU nano 6.2 dt.log
> LINT Documentation/devicetree/bindings
> CHKDT Documentation/devicetree/bindings/processed-schema.json
> SCHEMA Documentation/devicetree/bindings/processed-schema.json
> Traceback (most recent call last):
> File "/home/frank/.local/bin/dt-mk-schema", line 38, in <module>
> schemas = dtschema.DTValidator(args.schemas).schemas
> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 354, in __init__
> self.schemas = process_schemas(schema_files)
> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 271, in process_schemas
> sch = process_schema(os.path.abspath(filename))
> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 248, in process_schema
> dtsch.is_valid()
> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/schema.py", line 145, in is_valid
> for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> for error in errors:
> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_validators.py", line 362, in allOf
> yield from validator.descend(instance, subschema, schema_path=index)
> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 258, in descend
> for error in self.evolve(schema=schema).iter_errors(instance):
>
> block from line 242-258 repeats many times (~2000 lines in log)
>
> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> for error in errors:
> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_legacy_validators.py", line 216, in recursiveRef
> lookup_url, next_target = validator.resolver.resolve(each)
> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 835, in resolve
> url = self._urljoin_cache(self.resolution_scope, ref).rstrip("/")
> RecursionError: maximum recursion depth exceeded in comparison
>
> make[2]: *** [Documentation/devicetree/bindings/Makefile:68: Documentation/devicetree/bindings/processed-schema.json] Error 1
> make[2]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
> make[1]: *** [/media/data_nvme/git/kernel/BPI-R2-4.14/Makefile:1516: dt_binding_check] Error 2
> make: *** [Makefile:234: __sub-make] Error 2
>
> my command is (after importing defconfig, also tried a clean before):
>
> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
>
> already did an update of dtschema with "pip3 install dtschema --upgrade" and also an uninstall/install of this python-package
>
> $ pip3 show dtschema
> Name: dtschema
> Version: 2023.7
> Summary: DeviceTree validation schema and tools
> Home-page: https://github.com/devicetree-org/dt-schema
> Author: Rob Herring
> Author-email: robh@kernel.org
> License: BSD
> Location: /home/frank/.local/lib/python3.10/site-packages
> Requires: jsonschema, pylibfdt, rfc3987, ruamel.yaml
> Required-by:
>
> any idea what can be the cause?
Can you share the reproduction steps? This probably is some error in
schema which is then not nicely handled by dtschema.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Aw: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
2023-09-04 18:18 ` Krzysztof Kozlowski
@ 2023-09-04 18:33 ` Frank Wunderlich
2023-09-04 19:21 ` Krzysztof Kozlowski
2023-09-04 19:17 ` Aw: " Frank Wunderlich
1 sibling, 1 reply; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-04 18:33 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel
Hi
> Gesendet: Montag, 04. September 2023 um 20:18 Uhr
> Von: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
> An: "Frank Wunderlich" <frank-w@public-files.de>, "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>
> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
> Betreff: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
>
> On 03/09/2023 13:08, Frank Wunderlich wrote:
> > Hi,
> >
> > i tried to check a binding-file with 6.5 kernelsource and get this error
> >
> > LINT Documentation/devicetree/bindings
> > CHKDT Documentation/devicetree/bindings/processed-schema.json
> > SCHEMA Documentation/devicetree/bindings/processed-schema.json
> > Traceback (most recent call last):
> > File "/home/frank/.local/bin/dt-mk-schema", line 38, in <module>
> > schemas = dtschema.DTValidator(args.schemas).schemas
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 354, in __init__
> > self.schemas = process_schemas(schema_files)
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 271, in process_schemas
> > sch = process_schema(os.path.abspath(filename))
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 248, in process_schema
> > dtsch.is_valid()
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/schema.py", line 145, in is_valid
> > for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> > for error in errors:
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_validators.py", line 362, in allOf
> > yield from validator.descend(instance, subschema, schema_path=index)
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 258, in descend
> > for error in self.evolve(schema=schema).iter_errors(instance):
> >
> > block from line 242-258 repeats many times (~2000 lines in log)
> >
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> > for error in errors:
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_legacy_validators.py", line 216, in recursiveRef
> > lookup_url, next_target = validator.resolver.resolve(each)
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 835, in resolve
> > url = self._urljoin_cache(self.resolution_scope, ref).rstrip("/")
> > RecursionError: maximum recursion depth exceeded in comparison
> >
> > make[2]: *** [Documentation/devicetree/bindings/Makefile:68: Documentation/devicetree/bindings/processed-schema.json] Error 1
> > make[2]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
> > make[1]: *** [/media/data_nvme/git/kernel/BPI-R2-4.14/Makefile:1516: dt_binding_check] Error 2
> > make: *** [Makefile:234: __sub-make] Error 2
> >
> > my command is (after importing defconfig, also tried a clean before):
> >
> > ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
> >
> > already did an update of dtschema with "pip3 install dtschema --upgrade" and also an uninstall/install of this python-package
> >
> > $ pip3 show dtschema
> > Name: dtschema
> > Version: 2023.7
> > Summary: DeviceTree validation schema and tools
> > Home-page: https://github.com/devicetree-org/dt-schema
> > Author: Rob Herring
> > Author-email: robh@kernel.org
> > License: BSD
> > Location: /home/frank/.local/lib/python3.10/site-packages
> > Requires: jsonschema, pylibfdt, rfc3987, ruamel.yaml
> > Required-by:
> >
> > any idea what can be the cause?
>
> Can you share the reproduction steps? This probably is some error in
> schema which is then not nicely handled by dtschema.
there is not much more than i already told...
git checkout v6.5 #to have clean mainline version
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig #use mainline default config
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
it does not tell me a special binding file which is broken...it seems it has a problem with the self generated processed-schema.json, but it deletes the file.
maybe there is a way to skip this removal to analyse this file...have looked into my site-packages, but have not found the position of file deletion
btw. i get the same error also if i do not pass a file to dt-validate command...
$ which dt-validate
/home/frank/.local/bin/dt-validate
this is also a python-file which is installed outside of the site-packages, but i don't know why
> Best regards,
> Krzysztof
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Aw: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
2023-09-04 18:18 ` Krzysztof Kozlowski
2023-09-04 18:33 ` Aw: " Frank Wunderlich
@ 2023-09-04 19:17 ` Frank Wunderlich
1 sibling, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-04 19:17 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel
Hi,
seems like this fixes it (at least i get over the faulty point see now the DTEX lines):
pip3 install jsonschema==4.17.0
seems my previous version was 4.6.0
Requirement already satisfied: jsonschema in /home/frank/.local/lib/python3.10/site-packages (4.6.0)
first tried upgrade of this, but this results in 4.19 which is not compatible with dtschema
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
dtschema 2023.7 requires jsonschema<4.18,>=4.1.2, but you have jsonschema 4.19.0 which is incompatible.
so i set the last version told to be compatible
regards Frank
> On 03/09/2023 13:08, Frank Wunderlich wrote:
> > Hi,
> >
> > i tried to check a binding-file with 6.5 kernelsource and get this error
> >
> > GNU nano 6.2 dt.log
> > LINT Documentation/devicetree/bindings
> > CHKDT Documentation/devicetree/bindings/processed-schema.json
> > SCHEMA Documentation/devicetree/bindings/processed-schema.json
> > Traceback (most recent call last):
> > File "/home/frank/.local/bin/dt-mk-schema", line 38, in <module>
> > schemas = dtschema.DTValidator(args.schemas).schemas
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 354, in __init__
> > self.schemas = process_schemas(schema_files)
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 271, in process_schemas
> > sch = process_schema(os.path.abspath(filename))
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 248, in process_schema
> > dtsch.is_valid()
> > File "/home/frank/.local/lib/python3.10/site-packages/dtschema/schema.py", line 145, in is_valid
> > for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> > for error in errors:
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_validators.py", line 362, in allOf
> > yield from validator.descend(instance, subschema, schema_path=index)
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 258, in descend
> > for error in self.evolve(schema=schema).iter_errors(instance):
> >
> > block from line 242-258 repeats many times (~2000 lines in log)
> >
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> > for error in errors:
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_legacy_validators.py", line 216, in recursiveRef
> > lookup_url, next_target = validator.resolver.resolve(each)
> > File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 835, in resolve
> > url = self._urljoin_cache(self.resolution_scope, ref).rstrip("/")
> > RecursionError: maximum recursion depth exceeded in comparison
> >
> > make[2]: *** [Documentation/devicetree/bindings/Makefile:68: Documentation/devicetree/bindings/processed-schema.json] Error 1
> > make[2]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
> > make[1]: *** [/media/data_nvme/git/kernel/BPI-R2-4.14/Makefile:1516: dt_binding_check] Error 2
> > make: *** [Makefile:234: __sub-make] Error 2
> >
> > my command is (after importing defconfig, also tried a clean before):
> >
> > ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
> >
> > already did an update of dtschema with "pip3 install dtschema --upgrade" and also an uninstall/install of this python-package
> >
> > $ pip3 show dtschema
> > Name: dtschema
> > Version: 2023.7
> > Summary: DeviceTree validation schema and tools
> > Home-page: https://github.com/devicetree-org/dt-schema
> > Author: Rob Herring
> > Author-email: robh@kernel.org
> > License: BSD
> > Location: /home/frank/.local/lib/python3.10/site-packages
> > Requires: jsonschema, pylibfdt, rfc3987, ruamel.yaml
> > Required-by:
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Aw: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
2023-09-04 18:33 ` Aw: " Frank Wunderlich
@ 2023-09-04 19:21 ` Krzysztof Kozlowski
2023-09-04 19:27 ` Aw: " Frank Wunderlich
0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-04 19:21 UTC (permalink / raw)
To: Frank Wunderlich
Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel
On 04/09/2023 20:33, Frank Wunderlich wrote:
> Hi
>
>> Gesendet: Montag, 04. September 2023 um 20:18 Uhr
>> Von: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
>> An: "Frank Wunderlich" <frank-w@public-files.de>, "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>
>> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
>> Betreff: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
>>
>> On 03/09/2023 13:08, Frank Wunderlich wrote:
>>> Hi,
>>>
>>> i tried to check a binding-file with 6.5 kernelsource and get this error
>>>
>>> LINT Documentation/devicetree/bindings
>>> CHKDT Documentation/devicetree/bindings/processed-schema.json
>>> SCHEMA Documentation/devicetree/bindings/processed-schema.json
>>> Traceback (most recent call last):
>>> File "/home/frank/.local/bin/dt-mk-schema", line 38, in <module>
>>> schemas = dtschema.DTValidator(args.schemas).schemas
>>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 354, in __init__
>>> self.schemas = process_schemas(schema_files)
>>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 271, in process_schemas
>>> sch = process_schema(os.path.abspath(filename))
>>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 248, in process_schema
>>> dtsch.is_valid()
>>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/schema.py", line 145, in is_valid
>>> for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
>>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
>>> for error in errors:
>>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_validators.py", line 362, in allOf
>>> yield from validator.descend(instance, subschema, schema_path=index)
>>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 258, in descend
>>> for error in self.evolve(schema=schema).iter_errors(instance):
>>>
>>> block from line 242-258 repeats many times (~2000 lines in log)
>>>
>>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
>>> for error in errors:
>>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_legacy_validators.py", line 216, in recursiveRef
>>> lookup_url, next_target = validator.resolver.resolve(each)
>>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 835, in resolve
>>> url = self._urljoin_cache(self.resolution_scope, ref).rstrip("/")
>>> RecursionError: maximum recursion depth exceeded in comparison
>>>
>>> make[2]: *** [Documentation/devicetree/bindings/Makefile:68: Documentation/devicetree/bindings/processed-schema.json] Error 1
>>> make[2]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
>>> make[1]: *** [/media/data_nvme/git/kernel/BPI-R2-4.14/Makefile:1516: dt_binding_check] Error 2
>>> make: *** [Makefile:234: __sub-make] Error 2
>>>
>>> my command is (after importing defconfig, also tried a clean before):
>>>
>>> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
>>>
>>> already did an update of dtschema with "pip3 install dtschema --upgrade" and also an uninstall/install of this python-package
>>>
>>> $ pip3 show dtschema
>>> Name: dtschema
>>> Version: 2023.7
>>> Summary: DeviceTree validation schema and tools
>>> Home-page: https://github.com/devicetree-org/dt-schema
>>> Author: Rob Herring
>>> Author-email: robh@kernel.org
>>> License: BSD
>>> Location: /home/frank/.local/lib/python3.10/site-packages
>>> Requires: jsonschema, pylibfdt, rfc3987, ruamel.yaml
>>> Required-by:
>>>
>>> any idea what can be the cause?
>>
>> Can you share the reproduction steps? This probably is some error in
>> schema which is then not nicely handled by dtschema.
>
> there is not much more than i already told...
>
> git checkout v6.5 #to have clean mainline version
> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig #use mainline default config
> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
>
> it does not tell me a special binding file which is broken...it seems it has a problem with the self generated processed-schema.json, but it deletes the file.
>
> maybe there is a way to skip this removal to analyse this file...have looked into my site-packages, but have not found the position of file deletion
>
> btw. i get the same error also if i do not pass a file to dt-validate command...
Cannot reproduce it. Are you sure you are no mixing Python versions or
packages (e.g. pip and pip3)?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Aw: Re: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
2023-09-04 19:21 ` Krzysztof Kozlowski
@ 2023-09-04 19:27 ` Frank Wunderlich
0 siblings, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-04 19:27 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel
regards Frank
> Gesendet: Montag, 04. September 2023 um 21:21 Uhr
> Von: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
> An: "Frank Wunderlich" <frank-w@public-files.de>
> Cc: "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
> Betreff: Re: Aw: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
>
> On 04/09/2023 20:33, Frank Wunderlich wrote:
> > Hi
> >
> >> Gesendet: Montag, 04. September 2023 um 20:18 Uhr
> >> Von: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
> >> An: "Frank Wunderlich" <frank-w@public-files.de>, "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>
> >> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
> >> Betreff: Re: RecursionError when try to check bindings (ubuntu 22.04 / Python3.10)
> >>
> >> On 03/09/2023 13:08, Frank Wunderlich wrote:
> >>> Hi,
> >>>
> >>> i tried to check a binding-file with 6.5 kernelsource and get this error
> >>>
> >>> LINT Documentation/devicetree/bindings
> >>> CHKDT Documentation/devicetree/bindings/processed-schema.json
> >>> SCHEMA Documentation/devicetree/bindings/processed-schema.json
> >>> Traceback (most recent call last):
> >>> File "/home/frank/.local/bin/dt-mk-schema", line 38, in <module>
> >>> schemas = dtschema.DTValidator(args.schemas).schemas
> >>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 354, in __init__
> >>> self.schemas = process_schemas(schema_files)
> >>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 271, in process_schemas
> >>> sch = process_schema(os.path.abspath(filename))
> >>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/validator.py", line 248, in process_schema
> >>> dtsch.is_valid()
> >>> File "/home/frank/.local/lib/python3.10/site-packages/dtschema/schema.py", line 145, in is_valid
> >>> for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
> >>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> >>> for error in errors:
> >>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_validators.py", line 362, in allOf
> >>> yield from validator.descend(instance, subschema, schema_path=index)
> >>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 258, in descend
> >>> for error in self.evolve(schema=schema).iter_errors(instance):
> >>>
> >>> block from line 242-258 repeats many times (~2000 lines in log)
> >>>
> >>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 242, in iter_errors
> >>> for error in errors:
> >>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/_legacy_validators.py", line 216, in recursiveRef
> >>> lookup_url, next_target = validator.resolver.resolve(each)
> >>> File "/home/frank/.local/lib/python3.10/site-packages/jsonschema/validators.py", line 835, in resolve
> >>> url = self._urljoin_cache(self.resolution_scope, ref).rstrip("/")
> >>> RecursionError: maximum recursion depth exceeded in comparison
> >>>
> >>> make[2]: *** [Documentation/devicetree/bindings/Makefile:68: Documentation/devicetree/bindings/processed-schema.json] Error 1
> >>> make[2]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
> >>> make[1]: *** [/media/data_nvme/git/kernel/BPI-R2-4.14/Makefile:1516: dt_binding_check] Error 2
> >>> make: *** [Makefile:234: __sub-make] Error 2
> >>>
> >>> my command is (after importing defconfig, also tried a clean before):
> >>>
> >>> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
> >>>
> >>> already did an update of dtschema with "pip3 install dtschema --upgrade" and also an uninstall/install of this python-package
> >>>
> >>> $ pip3 show dtschema
> >>> Name: dtschema
> >>> Version: 2023.7
> >>> Summary: DeviceTree validation schema and tools
> >>> Home-page: https://github.com/devicetree-org/dt-schema
> >>> Author: Rob Herring
> >>> Author-email: robh@kernel.org
> >>> License: BSD
> >>> Location: /home/frank/.local/lib/python3.10/site-packages
> >>> Requires: jsonschema, pylibfdt, rfc3987, ruamel.yaml
> >>> Required-by:
> >>>
> >>> any idea what can be the cause?
> >>
> >> Can you share the reproduction steps? This probably is some error in
> >> schema which is then not nicely handled by dtschema.
> >
> > there is not much more than i already told...
> >
> > git checkout v6.5 #to have clean mainline version
> > ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig #use mainline default config
> > ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dt_binding_check
> >
> > it does not tell me a special binding file which is broken...it seems it has a problem with the self generated processed-schema.json, but it deletes the file.
> >
> > maybe there is a way to skip this removal to analyse this file...have looked into my site-packages, but have not found the position of file deletion
> >
> > btw. i get the same error also if i do not pass a file to dt-validate command...
>
> Cannot reproduce it. Are you sure you are no mixing Python versions or
> packages (e.g. pip and pip3)?
i do not call python directly but it does not matter
$ pip -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
$ pip3 -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
$ python -V
Python 3.10.12
$ python3 -V
Python 3.10.12
but it is fixed by upgrading jsonschema package to 4.17
pip3 install jsonschema==4.17.0
maybe this can be defined as depency for dtschema...at least 4.6 is not working (the version i had before)
i guess you have already a newer version of jsonschema package
> Best regards,
> Krzysztof
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-09-04 19:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-03 11:08 RecursionError when try to check bindings (ubuntu 22.04 / Python3.10) Frank Wunderlich
2023-09-04 18:18 ` Krzysztof Kozlowski
2023-09-04 18:33 ` Aw: " Frank Wunderlich
2023-09-04 19:21 ` Krzysztof Kozlowski
2023-09-04 19:27 ` Aw: " Frank Wunderlich
2023-09-04 19:17 ` Aw: " Frank Wunderlich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®