Topics

http2 support issue in curl #yocto #raspberrypi


Uzair Mazhar
 

Hi All, 
 While testing my image on raspberry pi3b, I found that curl doesn’t have http2 support.
   $ curl --http2 -I https://nghttp2.org/ 
 # Unsupported protocol   

I tried to search for the solution and one of the possible answer [1][2] were adding --with-nghttp2 flag to curl. For that I modified curl recipes (curl_7.64.1.bb) and added “EXTRA_OECONF = --with-nghttp2 “ along with default parameter already set in this block but it again shows the same error.

After That I have been trying to resolve this issue from over a week now as per my understanding of this issue but I am not able to solve this. 

I generated rpi image by following these steps: 
Cloned warrior branch of poky, meta-raspberrypi and meta-openembedded 
 Edited conf/local.conf to add,   
            LICENSE_FLAGS_WHITELIST_append = " commercial_faad2 commercial_gstreamer1.0-plugins-ugly " 
           IMAGE_INSTALL_append += " avs-device-sdk curl” 
Edited conf/bblayer.conf to add all relevant layers (meta-raspberrypi, meta-networking etc.) 
Generate image using “bitbake -k core-image-base” 

 I have tried to replicate whole procedure with poky “Thud” branch but in vain.     

My Environment setup: 
      Yocto version is 2.7.0
      Ubuntu~18.04.1   
      Linux kernel 4.15.0-66-generic   
     Python3 version 3.6.8 
     gcc/g++ 7.4.0  
     Git 2.17.1 
 [1] https://github.com/alexa/avs-device-sdk/wiki/Ubuntu-Linux-Quick-Start-Guide#authorization 
 [2]https://serversforhackers.com/c/curl-with-http2-support     

Any help in this matter will be appreciated.   
 Thanks,   
 Uzair Mazhar Awan   
 Design and Verification Engineer | www.Emumba.com Office: 3rd Floor, B-Block, STP-3, I9/3, Islamabad,Pakistan


 

On Thu, 5 Dec 2019, at 07:32, Uzair Mazhar wrote:
Hi All,
While testing my image on raspberry pi3b, I found that curl doesn’t
have http2 support.
$ curl --http2 -I https://nghttp2.org/
# Unsupported protocol

I tried to search for the solution and one of the possible answer
[1][2] were adding --with-nghttp2 flag to curl. For that I modified
curl recipes (curl_7.64.1.bb) and added “EXTRA_OECONF = --with-nghttp2
“ along with default parameter already set in this block but it again
shows the same error.
Looking at the link you gave [1], you probably need to use "--with-nghttp2=<PATH>" and add nghttp2 to DEPENDS. You may need to find or write a recipe for that library.

[1]: https://serversforhackers.com/c/curl-with-http2-support

--
Paul Barker


Uzair Mazhar
 

I added nghttp2 into depends but it gave dependency chain error about nghttp2-native.
"ERROR: Nothing PROVIDES 'nghttp2-native' (but virtual:native:/mnt/sdb1/yocto_exp/poky-warrior/meta/recipes-support/curl/curl_7.64.1.bb DEPENDS on or otherwise requires it). Close matches:
  gtest-native
  ncp-native
  gyp-native "
NOTE: Runtime target 'core-image-base' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['core-image-base', 'apt-native', 'curl-native', 'nghttp2-native']
NOTE: Runtime target 'avs-device-sdk' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['avs-device-sdk', 'cmake-native', 'curl-native', 'nghttp2-native']
 


Ross Burton
 

On 05/12/2019 10:30, Uzair Mazhar wrote:
I added nghttp2 into depends but it gave dependency chain error about nghttp2-native.
As Paul said:

"You may need to find or write a recipe for that library."

layers.openembedded.org is your friend here:

https://layers.openembedded.org/layerindex/recipe/86423/

There's a recipe for this in meta-networking.

Ross


Uzair Mazhar
 

As I mentioned That I Cloned warrior branch of poky, meta-raspberrypi and meta-openembedded.
nghttp2 recipe is already in my repository under "meta-openembedded/meta-networking/recipes-support/nghttp2" 
but the problem is still persistent. 
 
I tried to add nghttp2 as RDENPENDS in curl and it compiled successfully but libnghttp2 was not part of my image. 
 
If I add nghttp2 in conf/local.conf inside "IMAGE_INSTALL_append ", the libnghttp2 becomes the part of my image under /usr/lib but again curl doesn't support http2. 


Ross Burton
 

On 05/12/2019 11:23, Uzair Mazhar wrote:
As I mentioned That I Cloned warrior branch of poky, meta-raspberrypi and meta-openembedded.
nghttp2 recipe is already in my repository under "meta-openembedded/meta-networking/recipes-support/nghttp2"
but the problem is still persistent.
Did you add meta-networking to bblayers.conf?

I tried to add nghttp2 as RDENPENDS in curl and it compiled successfully but libnghttp2 was not part of my image.
Probably because the dependency ended up on a package you didn't actually instally. Also RDEPENDS are not in the sysroot, so the curl build wouldn't have been able to see nghttp2, you meant to add it to DEPENDS.

If I add nghttp2 in conf/local.conf inside "IMAGE_INSTALL_append ", the libnghttp2 becomes the part of my image under /usr/lib but again curl doesn't support http2.
Adding the library to the image won't change the curl library which has already been built without nghttp2.


Looking at the curl recipe, nghttp2 support is there but disabled out of the box, so you just need to turn the support on. The recipe has:

PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"

The documentation covers the methods available to turn on/off PACKAGECONFIG options:

https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-PACKAGECONFIG

Ross


Uzair Mazhar
 

On Thu, Dec 5, 2019 at 07:48 PM, Ross Burton wrote:
Did you add meta-networking to bblayers.conf?
Yes! I have. 

I am going to try "PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"" thing with the help of documentation and will get back to you with my findings.

Thanks, 
Uzair


Uzair Mazhar
 

Hey Ross,
Thank you for your help. 
The problem was I wasn't adding nghttp2 in PACKAGECONFIG??=.  Once I did it solved the http2 issue. 

Regards,
Uzair