HowTo: contributing to app development with crossbuilder
-
@mymike Michele, would you mind trying to create a container also with the keyboard package cloning it from here as I already did before? I have had several errors (see previous outputs from me) and I'd like to see what's different from your output. Thanks.
P.S. what's your Desktop OS? Mine is Ubuntu 16.04.
-
Just want to add my findings in trying to use crossbuilder:
Ubuntu 17.04 (32bit)setup-lxd without zfs went well.
When trying to build with "crossbuilder --ubuntu=16.04" it stops with this error:
https://paste.ubuntu.com/p/YzNbHgGPpJ/ -
@luksus Why is your output so short? Did you cut it up to the essential?
For the error which states 'no device' are you sure you connected your phone to your PC prior to send the crossbuilder command? A tip for you: once connected the device to your PC, you don't need to type the complete command but you just need to write 'crossbuilder' and the script will detect by itself the OS (16.04 or 15.04). -
@mardy I think I made one step further. First I just realized that the
-su: dch: command not found
error is only thrown when I try to crossbuild again the keyboard package when it has been already created. If I wipe the container bylxc stop ubuntu-keyboard-usdk-16-04-amd64-armhf-dev
and thenlxc delete ubuntu-keyboard-usdk-16-04-amd64-armhf-dev
and I crossbuild it at its location, therefore theContainer is not connected to the Internet.
error is generated.
Secondly, I dug into the crossbuilder script and I found that this error, for my case at least, is a fake error. In fact, if I type in the terminallxc info ubuntu-keyboard-usdk-16-04-amd64-armhf-dev
I got this output:
As you can see the connection is actually available for the container (
eth0: inet6
).
However, running the script it is not detected because there is a typo in the concerned code rows:If I get rid of the
\b
ingrep -e "eth0.*inet\b"
then the connection is correctly detected and the setup can move forward.
Moving forward I got new errors in fetching some repositories. I'm not sure if the crossbuilt succeeded this time; trying to make a small change locally to the keyboard package and crossbuilding it on my phone, it seems I'm not able to see any difference...maybe it's me and probably I touched something not graphically evident as I thought. I'll make other attempts before to be sure I'm not able yet to make crossbuilder to properly work.
The very latest output, if you want to help me to understand if the repositories fetching error is problematic and how to circumvent this, is the following: https://paste.ubuntu.com/p/5w78Gz2MJx/. -
@matteo : No I did not cut that output. I did not connect my device, because I thought its not necessary and it would proceed building anyway.
I thought the error is, that it does not find the requested image container at https://sdk-images.ubports.com. -
@luksus maybe there aren't 32bit images to create the container
-
@matteo that ipv6 address is a link-local one, that means it could be used only in local network so, of course, it couldn't reach the internet and fetch the repos...
-
@matteo I tried but I got some dependencies issues like I got for the indicator-display (of course the deps where different) I have ubuntu 18.04
-
-
@mymike I don't follow you: which ipv6 address error are you talking about regarding the dependencies? Please, give me more insight about it.
-
@matteo idk which repos are needed. once the container is running it may have to install updates or dependencies requested by the component you're building, but if no internet connection is found it couldn't download them...
-
@matteo well, you said a connection is available for your container (
eth0: inet6
) with the addresfe80::216:3eff:fef5:570c
, but that address cannot pass through router, it can only be used inside your local network: it cannot access the internet, so it is normal that deps aren't downloaded as no internet connection is found -
@mymike oooooh ok.....thank you for the tip. So, according to your comment I actually don't have internet connection, is that right? But how is so? Are we talking about internet connection on my PC right? I do have it...weird...
-
@matteo no, its the container that doesn't have internet connection.
As you also said here:
I got always the same error: "Container is not connected to the Internet."
containers I think doesn't connects directly to internet using your pc connection but create a bridge (if I understood it correctly), so the container connection pass through the bridge and then to your pc connection. but the bridge seems to be broken
-
I think I figured out a solution to the
Container is not connected to the Internet
error on Ubuntu 16.04.It seems that LXD switched to setting up its default bridge
lxdbr0
as link-local only (no Internet connection) around the beginning of April 2016: article explaining the change here. From what I can tell, this decision was reversed before the release of 18.04 because the issue does not occur there. I'll see if I can submit a patch to Crossbuilder to fix this.Edit: This is no longer needed!
See this post below. A fix has been merged into Crossbuilder.
Fix "Container is not connected to the Internet"
To set up the bridge on your system, run
sudo dpkg-reconfigure -p medium lxd
. If you like you can carefully answer each question, but mashing enter to get through the setup works too. This will add an IPv4 and IPv6 subnet to your bridge.After setting up the bridge, your crossbuilder container still won't be set up correctly. Delete it by running
crossbuilder delete
.Once you complete these steps, you should be able to run crossbuilder successfully.
-
I first would like to thank @mymike for his clever intuition regarding the missing bridge and then @UniSuperBox for the hotfix found: it works (without the need to
crossbuilder delete
)! I'm able now to download the repositories and the installation goes further and further.....until to throw an ultimate error complaining about broken packages. Here it is the new complete logfile: -
@matteo said in HowTo: contributing to app development with crossbuilder:
I'm able now to download the repositories and the installation goes further and further.....until to throw an ultimate error complaining about broken packages. Here it is the new complete logfile:
You need to edit the
debian/control
file of the project, and add a<!nocheck>
next toxvfb
, similarly to how it's done here. That's because this package is only used for running the tests, and tests are not run when using crossbuilder. You can do the same for the python packages.After you manage to build the package with crossbuilder, it would be nice if you could create a pull request with your changes, so that the next contributor won't have to go through the same pain.
-
Thank you for your reply @mardy! I will try to follow your suggestions as soon as I'll have some additional spare time and report here the findings.
After, consider the PR done, no problemMatteo
-
@mardy I opened an issue for that on the address-book-app but wasn't sure if it should correctly be done in debian/control or debian/control.in
Debian/control includes this line:
#Modifications should be made to debian/control.in instead.
but it looks like that might be an artifact fro Canonical days. Is that the case?
-
A change has been merged to Crossbuilder which fixes the issue with containers connecting to the internet on 16.04. Update your crossbuilder script (with
git pull
) and runcrossbuilder setup-lxd
to set up the container bridge.