Bug 9720

Summary: yocto-bsp: BSP creation fails using an input file
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Component: Scripts and ToolsAssignee: Humberto Ibarra <humberto.ibarra.lopez>
Status: VERIFIED INVALID QA Contact: Jose Perez C <jose.perez.carranza>
Severity: normal    
Priority: Medium+ CC: jose.perez.carranza, leonardo.sandoval.gonzalez, ross.burton
Version: 2.1   
Target Milestone: 2.2 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Leonardo Sandoval Gonzalez 2016-06-06 21:33:00 UTC
This test was executed under commit [6c5d7f1fb276cbe0a461ece6c8f0ca17a478fa8c] with the following output:

$ yocto-bsp list arm properties > arm.properties
$ yocto-bsp create myarm arm --infile=arm.properties 
Traceback (most recent call last):
  File "/home/lsandov1/poky/scripts/yocto-bsp", line 150, in <module>
    ret = main()
  File "/home/lsandov1/poky/scripts/yocto-bsp", line 145, in main
    invoke_subcommand(args, parser, yocto_bsp_help_usage, subcommands)
  File "/home/lsandov1/poky/scripts/lib/bsp/help.py", line 73, in invoke_subcommand
    subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
  File "/home/lsandov1/poky/scripts/yocto-bsp", line 89, in yocto_bsp_create_subcommand
    yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file)
  File "/home/lsandov1/poky/scripts/lib/bsp/engine.py", line 1615, in yocto_bsp_create
    yocto_common_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties)
  File "/home/lsandov1/poky/scripts/lib/bsp/engine.py", line 1554, in yocto_common_create
    properties = json.load(infile)
  File "/usr/lib/python3.4/json/__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.4/json/decoder.py", line 346, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 31 - line 552 column 1 (char 30 - 12750)

something broke this tool on the python3 jump and needs further investigation. The idea was to create a BSP using an input file.
Comment 1 Humberto Ibarra 2016-06-09 17:14:47 UTC
As this script is designed, the output of list properties is not meant to work as the input for a new create command.

The listing of properties throws properties attributes (like which value is the default one for that property), the create on the other hand expects a json of desired values for the properties of the new BSP to be created.

This is not an issue, however, the exception shown is not a correct display. I will open a new bug to create a graceful error message for this situation and will be marking this as invalid.
Comment 2 Humberto Ibarra 2016-06-09 17:21:50 UTC
Opened bug 9750 for the error message handling.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=9750
Comment 3 Jose Perez C 2016-07-01 16:21:44 UTC
Invalid bug 

Tracked now on bug 9750
Comment 4 Jose Perez C 2016-07-01 16:36:27 UTC
Invalid