new armhf click build chroot is DEB_BUILD_ARCH=amd64

Bug #1322178 reported by Kyle Nitzsche
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
The Savilerow project
Won't Fix
Low
Unassigned
Ubuntu Developer Portal
New
Undecided
Unassigned
click (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

(note sure which project to file this against..)

I just created a 14.04 armhf click build target from the Ubuntu SDK.

A terminal into the chroot (from the Maintain button) shows this:

(click-ubuntu-sdk-14.04-armhf)root@chroma:/home/knitzsche# dpkg-architecture
DEB_BUILD_ARCH=amd64
DEB_BUILD_ARCH_BITS=64
DEB_BUILD_ARCH_CPU=amd64
DEB_BUILD_ARCH_ENDIAN=little
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_GNU_CPU=x86_64
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=x86_64-linux-gnu
DEB_BUILD_MULTIARCH=x86_64-linux-gnu
DEB_HOST_ARCH=amd64
DEB_HOST_ARCH_BITS=64
DEB_HOST_ARCH_CPU=amd64
DEB_HOST_ARCH_ENDIAN=little
DEB_HOST_ARCH_OS=linux
DEB_HOST_GNU_CPU=x86_64
DEB_HOST_GNU_SYSTEM=linux-gnu
DEB_HOST_GNU_TYPE=x86_64-linux-gnu
DEB_HOST_MULTIARCH=x86_64-linux-gnu

I expected (perhaps naively) :DEB_BUILD_ARCH=armhf (and probably others).

When I install pkgs in the chroot with apt-get install, the amd64 arch one is installed unless I specify armhf, which I did not expect either.

Some pkgs/vers on my host system:
$ apt-cache policy qtcreator-plugin-ubuntu
qtcreator-plugin-ubuntu:
  Installed: 3.0.1+14.10.20140521.1-0ubuntu1~0trusty1

$ apt-cache policy click
click:
  Installed: 0.4.23.1ubuntu1i~0trusty1

Revision history for this message
Michał Karnicki (karni) wrote :

I confirm apt-get installs packages for amd64 arch, as well as

(click-ubuntu-sdk-14.04-armhf)root@dojo:/home/karni# dpkg-architecture
DEB_BUILD_ARCH=amd64

Changed in qtcreator-plugin-ubuntu:
status: New → Confirmed
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

It appear that the DEB_HOST_ARCH is set to armhf when you run cmake from the SDK, which outputs in part this, so this bug may be invalid:

Command returned 1: schroot -c click-ubuntu-sdk-14.04-armhf -- env DEB_HOST_MULTIARCH=arm-linux-gnueabihf DEB_HOST_GNU_SYSTEM=linux-gnueabihf DEB_HOST_ARCH=armhf DEB_HOST_GNU_TYPE=arm-linux-gnueabihf DEB_HOST_ARCH_ENDIAN=little DEB_BUILD_ARCH_CPU=amd64 DEB_BUILD_ARCH_BITS=64 DEB_BUILD_GNU_TYPE=x86_64-linux-gnu DEB_HOST_ARCH_BITS=32 DEB_HOST_ARCH_OS=linux DEB_BUILD_ARCH=amd64 DEB_BUILD_GNU_CPU=x86_64 DEB_BUILD_GNU_SYSTEM=linux-gnu DEB_HOST_ARCH_CPU=arm DEB_BUILD_ARCH_ENDIAN=little DEB_BUILD_ARCH_OS=linux DEB_HOST_GNU_CPU=arm DEB_BUILD_MULTIARCH=x86_64-linux-gnu cmake -DQT_IMPORTS_DIR=/usr/lib/arm-linux-gnueabihf/qt5/qml /home/knitzsche/sdk/scopes/fbphotos '-GCodeBlocks - Unix Makefiles'

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Final point: given the default chroot DEB vars, when you naively install a pkg (for example when adding build deps, a common end user case) without setting the arch to armhf (apt-get instal PKG:armhf), it installs amd4 (or I suppose x86 in many cases).

This is unexpected (to me) and took some time to understand and recover from.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

So, is this a valid bug?

tags: added: scope-dev
affects: qtcreator-plugin-ubuntu → savilerow
affects: savilerow → qtcreator-plugin-ubuntu
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

I think it is not a bug, but indeed a confusing behavior. But this multi arch click chroot is the very essence of the click build story.

I agree that the default arch when installing a package in the click chroot should be the target arch, as developers install more typically libs, headers, qml plugins than developer tools.

Anyhow, I think the click package is the best address for this issue and not the QtC plugin.

affects: qtcreator-plugin-ubuntu → click (Ubuntu)
Revision history for this message
Florian W. (florian-will) wrote :

This is still an issue, and very confusing. I assume that most developers who need external dependenices for the click package run into this and wonder why the linker complains about not finding the library.

I guess most developers find it more convenient to add build rules that copy prebuilt libraries from the chroot into the click package instead of adding the library source code to their project. This ensures easy click package updates whenever Ubuntu updates the library (without API breaking changes of course). For this use case, running apt-get install libwhatever-dev in the chroot is the first required step, and the user expects to have a somewhat sane environment when clicking the "Maintain" button.

I worked around this by installing libupnp6:armhf and libupnp6-dev:armhf instead of libupnp-dev.

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

good documents on how to use the chroot is the right fix to this issue.

Maybe https://launchpad.net/developer-ubuntu-com is the right place for this issue ?

Changed in savilerow:
importance: Undecided → Medium
Changed in savilerow:
status: New → Triaged
tags: added: tracking
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

I think docs would help and they should go somewhere here: https://developer.ubuntu.com/

Changed in savilerow:
importance: Medium → Low
Revision history for this message
Daniel Holbach (dholbach) wrote :

Can maybe somebody point out in which way developer.ubuntu.com should be fixed?

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

@Daniel, fire a bug on https://launchpad.net/developer-ubuntu-com and mail to those who works on it ?

Revision history for this message
Daniel Holbach (dholbach) wrote :

Sorry, I think I'm not quite sure how this bug should be fixed on developer.ubuntu.com. Is there a summary of what needs to be changed?

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

My two cents (echoing in part what Florian said), Critical pieces of information devs need include:
* dpkg-architecture vars do not clearly reflect the click chroot --architecture (they reflect the host system).
* to install compiled build dep debian pkgs, you must add the architecture to the pkgs, as in: apt-get install package:armhf.

Adding these to some general discussion of click chroots and developing for touch may help. Perhaps in a C++ section/guide.

Changed in savilerow:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.