Errors Creating Image after Python3 automatic update

Greeting,

I’m having problems generating an image file for an FX30s after the Python3 was updated.
First it was an error to the Python3 path, then the print command required parentheses. I corrected both of these, but now getting the following error, which I can’t figure out the problem:

(lsh:SWI-FX30-CATM) eddie@Q87CRM:~/Workspace$ systoimg wp77xx AdvantorCell.wp77xx.update
Warning: output directory is not provided. Using ‘/home/eddie/Workspace’ as output directory.
Removing old content of /home/eddie/Workspace/_staging_AdvantorCell.wp77xx.update
Unpacking AdvantorCell.wp77xx.update …
Traceback (most recent call last):
File “/home/eddie/Workspace/leaf-data/SWI-FX30-CATM/fx30-catm-legato/bin/update-util”, line 346, in
ProcessHeaders(args)
File “/home/eddie/Workspace/leaf-data/SWI-FX30-CATM/fx30-catm-legato/bin/update-util”, line 317, in ProcessHeaders
oldChunkList = ReadUpdateFile(OldUpdateFile)
File “/home/eddie/Workspace/leaf-data/SWI-FX30-CATM/fx30-catm-legato/bin/update-util”, line 185, in ReadUpdateFile
chunk = ReadChunk(bufferedStream)
File “/home/eddie/Workspace/leaf-data/SWI-FX30-CATM/fx30-catm-legato/bin/update-util”, line 172, in ReadChunk
jsonObj = json.loads(inStr)
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)
***ERROR: Failed to unpack AdvantorCell.wp77xx.update
Try ‘systoimg --help’ for usage instructions.
(lsh:SWI-FX30-CATM) eddie@Q87CRM:~/Workspace$

Appreciate any help figuring this out. Thanks!

Eddie

are you able to do “make wp77xx” to make the legato image?

I have already compiled the code and now I’m trying to generate an image with the systoimg command.

yes, i understand
I just want to see whether “make wp77xx” is OK.
If yes, probably you don’t need to use systoimg

I usually use VScode, so I’m not 100% familiar with leaf shell.

I just tried “make wp77xx” as you suggested. The response I got was:
“make: *** No rule to make target ‘wp77xx’. Stop.”

are you compiling inside “leaf shell”?

I compiled in VScode.

you need to first go to the legato framework folder in leaf-data

I changed the folder as suggested and ran the “make wp77xx” command. It compiled but returned 2 errors.

(lsh:FX30S-15-1) eddie@Q87CRM:~/Workspace/leaf-data/current/fx30-catm-legato$ make wp77xx
Building Legato for target ‘wp77xx’
modules/WiFi/moduleDefs:12: Legato WiFi version is undefined…
KSET build/wp77xx/.config - TARGET_WP77XX
KCONFIG build/wp77xx/.config
GEN build/wp77xx/.config.mk
Building Legato for target ‘wp77xx’
modules/WiFi/moduleDefs:12: Legato WiFi version is undefined…
GEN version
GEN build/wp77xx/framework/include/le_config.h
MAKE tools
make[1]: Entering directory ‘/home/eddie/.leaf/fx30-catm-legato_21.05.0’
Using ninja installed at: /usr/bin/ninja
GEN /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/build.ninja
Tools arch: x86_64
MAKE mkPatch
make[2]: Entering directory ‘/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkPatch’
make[2]: ‘/home/eddie/.leaf/fx30-catm-legato_21.05.0/bin/mkPatch’ is up to date.
make[2]: Leaving directory ‘/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkPatch’
NINJA /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/build.ninja
[77/87] Compiling tool source
FAILED: /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/obj/mkTools/codeGenerator/exeMainGenerator.cpp.o
g++ -std=c++0x -MMD -MF /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/obj/mkTools/codeGenerator/exeMainGenerator.cpp.o.d -g -Wall -Werror -Wno-unused-command-line-argument -Wno-deprecated -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/precompiled/ -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/defTools -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/liblegato -c /home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/codeGenerator/exeMainGenerator.cpp -o /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/obj/mkTools/codeGenerator/exeMainGenerator.cpp.o
/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/codeGenerator/exeMainGenerator.cpp: In function ‘void code::GenerateCLangExeMain(const model::Exe_t*, const mk::BuildParams_t&)’:
/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/codeGenerator/exeMainGenerator.cpp:171:25: error: loop variable ‘fileSystemObjectPtr’ creates a copy from type ‘const std::shared_ptrmodel::FileSystemObject_t’ [-Werror=range-loop-construct]
171 | for (const auto fileSystemObjectPtr : componentPtr->bundledFiles)
| ^~~~~~~~~~~~~~~~~~~
/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/codeGenerator/exeMainGenerator.cpp:171:25: note: use reference type to prevent copying
171 | for (const auto fileSystemObjectPtr : componentPtr->bundledFiles)
| ^~~~~~~~~~~~~~~~~~~
| &
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unused-command-line-argument’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
[86/87] Compiling tool source
FAILED: /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/obj/mkTools/configGenerator/configGenerator.cpp.o
g++ -std=c++0x -MMD -MF /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/obj/mkTools/configGenerator/configGenerator.cpp.o.d -g -Wall -Werror -Wno-unused-command-line-argument -Wno-deprecated -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/precompiled/ -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/defTools -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools -I/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/liblegato -c /home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/configGenerator/configGenerator.cpp -o /home/eddie/.leaf/fx30-catm-legato_21.05.0/build/tools/obj/mkTools/configGenerator/configGenerator.cpp.o
/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/configGenerator/configGenerator.cpp: In function ‘void config::GenerateBindingsConfig(std::ofstream&, model::App_t*, const mk::BuildParams_t&)’:
/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/configGenerator/configGenerator.cpp:783:21: error: loop variable ‘mapItem’ creates a copy from type ‘const std::pair<const std::__cxx11::basic_string, model::Exe_t*>’ [-Werror=range-loop-construct]
783 | for (const auto mapItem : appPtr->executables)
| ^~~~~~~
/home/eddie/.leaf/fx30-catm-legato_21.05.0/framework/tools/mkTools/configGenerator/configGenerator.cpp:783:21: note: use reference type to prevent copying
783 | for (const auto mapItem : appPtr->executables)
| ^~~~~~~
| &
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unused-command-line-argument’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile.hostTools:42: tools] Error 1
make[1]: Leaving directory ‘/home/eddie/.leaf/fx30-catm-legato_21.05.0’
make: *** [Makefile:459: tools] Error 2
(lsh:FX30S-15-1) eddie@Q87CRM:~/Workspace/leaf-data/current/fx30-catm-legato$((l(lsh(lsh:FX(lsh:FX30S-1(lsh:FX30S-15-(lsh:FX30S-15-1) e(lsh:FX30S-15(lsh:FX30S-(lsh:FX30S-(lsh:FX30(ls((l(ls(ls(lsh:F(lsh:(lsh:(ls(lsh:FX30(ls(ls(l(lsh:(l((lsh:(ls(l(lsh(lsh:F(lsh((lsh(l(lsh:F(lsh:F(l((ls(ls(l((ls(lsh:FX30S-(l(lsh:(lsh:(lsh(lsh(l(l(l(ls(l(lsh:(ls(l(ls(l(ls(l(l(lsh:(((l((ls((ls(ls((ls(l(l(lsh(l(ls((((((((lsh:FX30S-15-1) eddie@Q87CRM:~/Workspace/leaf-data/current/fx30-catm-legato$

I just tried to compile the legato image of swi-wp76_6.0.0 which is using legato 21.05, no problem is found for “make wp76xx”.
I wonder if the GCC version of your enviroment makes the problem.
It should be fine to make the legato image in Ubuntu 16 or Ubuntu 18.


(lsh:WP76_stable) owner@CNHKG-EX-001367:~/LEAF/WP76/leaf-data/WP76_stable/wp76-legato$ ls -l ./build/wp76xx/legato.cwe
lrwxrwxrwx 1 owner owner 23 Oct 11 22:45 ./build/wp76xx/legato.cwe -> legato-squashfs.ubi.cwe
(lsh:WP76_stable) owner@CNHKG-EX-001367:~/LEAF/WP76/leaf-data/WP76_stable/wp76-legato$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

               
(lsh:WP76_stable) owner@CNHKG-EX-001367:~/LEAF/WP76/leaf-data/WP76_stable/wp76-legato$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.7 LTS
Release:        16.04
Codename:       xenial

I currently have Ubuntu 22.04

I’ll have to re-create my environment to Ubuntu 18 and see if that resolves my problem. I’ll let you know how it goes.

Thanks!!

Eddie

Hey, thanks for all the help!

I had to rebuilt my development box to Ubuntu 18 and reload leaf, after that I was able to build my app image successfully.

Regards,

Eddie