Bug 3305

Summary: yocto-bsp doesn't work correctly with SRC_URIs containing 'protocol=http'
Product: [Build System, Metadata & Runtime] BSPs Reporter: Evadeflow <evadeflow>
Component: bsps-toolsAssignee: Darren Hart <dvhart>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: corneliux.stoicescu, tom.zanussi
Version: unspecified   
Target Milestone: 1.4 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: Patch Review (Oct 18 2012)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
SRC_URI that does not work with yocto-bsp (but should)
none
SRC_URI that *does* work with yocto-bsp (but should NOT) none

Description Evadeflow 2012-10-18 14:11:37 UTC
If I change the SRC_URI of meta/recipes-kernel/linux/linux-yocto_3.4.bb to point to a valid HTTP URL and change protocol to 'http', I get the error appended below when I run yocto-bsp. If I change 'git://' in the URL to 'http://', then everything works fine. It seems yocto-bsp does not know how to properly deal with git-over-http? (I'll attach a couple of diffs to make it crystal clear what I mean.)

> % yocto-bsp create tegra arm                       
> Would you like to use the default (3.4) kernel? (y/n) [default: y] 
> Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n] [default: y] 
> Getting branches from remote repo git://git.yoctoproject.org/git/linux-yocto-3.4.git...
> Traceback (most recent call last):
>   File "/home/evadeflow/projects/poky/scripts/yocto-bsp", line 137, in <module>
>     ret = main()
>   File "/home/evadeflow/projects/poky/scripts/yocto-bsp", line 132, in main
>     invoke_subcommand(args, parser, yocto_bsp_help_usage, subcommands)
>   File "/home/evadeflow/projects/poky/scripts/lib/bsp/help.py", line 73, in invoke_subcommand
>     subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
>   File "/home/evadeflow/projects/poky/scripts/yocto-bsp", line 76, in yocto_bsp_create_subcommand
>     yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file)
>   File "/home/evadeflow/projects/poky/scripts/lib/bsp/engine.py", line 1260, in yocto_bsp_create
>     run_program_lines(program_lines, codedump)
> SyntaxError: function specified for 'gen' property returned nothing : input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base"
Comment 1 Darren Hart 2012-10-18 14:15:12 UTC
I have a fix for this.
Comment 2 Evadeflow 2012-10-18 14:17:00 UTC
Created attachment 891 [details]
SRC_URI that does not work with yocto-bsp (but should)

git-over-http SRC_URIs are (somewhat counter-intuitively) always supposed to begin with 'gitt://', so this syntax is *supposed* to work...
Comment 3 Evadeflow 2012-10-18 14:19:02 UTC
Created attachment 892 [details]
SRC_URI that *does* work with yocto-bsp (but should NOT)

This SRC_URI starts with 'http://' and works fine, but... it's not supposed to.
Comment 4 Darren Hart 2012-10-18 14:25:51 UTC
Patch sent to poky mailing list (evadeflow on CC) - Can you try the patch?
Comment 5 Evadeflow 2012-10-18 14:34:25 UTC
(In reply to comment #4)
> Patch sent to poky mailing list (evadeflow on CC) - Can you try the patch?

Your patch works for me. I has able to change the SRC_URI prefix back to 'git://' (while leaving 'protocol=http') and run yocto-bsp successfully. :-)
Comment 6 Darren Hart 2012-11-01 05:16:28 UTC
Fixed in commit 952b879de5ffdb04a706fc4e2824696b25c4bf11
Comment 7 Stoicescu Cornel 2013-01-07 13:09:11 UTC
Verified in master: 09359e6ec00901abfe49157f1f9730117b4d284b