paguilar / br-pbuilder

Top-level parallel build for Buildroot
Other
2 stars 1 forks source link

json.decoder.JSONDecodeError running `pbuilder` in x86 Ubuntu container #5

Open udance4ever opened 1 month ago

udance4ever commented 1 month ago

no issues getting pbuilder off the ground in an arm64 Ubuntu build container in Asahi Linux (MBP 2020)

went to checkout the same branch in a x86 Ubuntu build container on an x86 machine (MBP early 2015) (same Dockerfile on both machines)

and get this error:

Traceback (most recent call last):
  File "/build/buildroot/support/scripts/pbuilder.py", line 166, in <module>
    sys.exit(main())
  File "/build/buildroot/support/scripts/pbuilder.py", line 149, in main
    if generate_deps(pbuilder_deps_file) != 0:
  File "/build/buildroot/support/scripts/pbuilder.py", line 84, in generate_deps
    pkg_list = json.loads(subprocess.check_output(cmd))
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Script /build/buildroot/support/scripts/pbuilder.py failed!
make: *** [Makefile:939: pbuilder] Error 1
make: Leaving directory '/build/buildroot'
make: *** [Makefile:136: x86_64-build] Error 2 

wondering if this error makes any sense to you?

Building x86 targets on an x86 machine is our default configuration so it’s surprising the cross-build environment succeeds to the end!

paguilar commented 1 month ago

This kind of error seems to happen when the JSON is corrupted. In this case the JSON is generated by Buildroot's show-info, so I don't think that it was generated with errors. Could it be that the JSON file was corrupted while br-pbuilder was reading it? Eg., Did you execute br-pbuilder twice at the same time for different targets?

udance4ever commented 1 month ago

this is the first time execution on an x86 machine (not M1) - this is the only difference. I've tried a clean build several times & same result.

do you have x86 hardware available?

can you reproduce the result?

paguilar commented 1 month ago

I have an x86_64, but I've never seen this. Could it be an issue with the host's python3 and/or its json libs? I don't think it's a BR issue, but just to be sure, could you execute make -s --no-print-directory show-info and validate the resulting JSON? (any online validator should be ok)

udance4ever commented 1 month ago

it’s valid JSON: test.json

used the following commands to create it:

squatter@orbit:~/dev/batocera.linux$ make x86_64-shell
squatter@8513b6ae1d9a:/x86_64$ make -s --no-print-directory show-info > test.json