Fails to create x86 chroot

Bug #1319153 reported by Zoltan Balogh
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
click (Ubuntu)
Fix Released
High
Colin Watson

Bug Description

The `sudo click chroot -a i386 -f ubuntu-sdk-14.04 create` command fails with this error:

E: Unable to locate package g++-i686-linux-gnu
E: Couldn't find any package by regex 'g++-i686-linux-gnu'
E: Unable to locate package pkg-config-i686-linux-gnu
Command returned 100: schroot -u root -c source:click-ubuntu-sdk-14.04-i386 -- /finish.sh

The same with amd64 on my i386 machine fails as expected in a bit more spectacular way: http://pastebin.ubuntu.com/7459031/

1) $ lsb_release -rd
Description: Ubuntu Utopic Unicorn (development branch)
Release: 14.10

2) $ apt-cache policy click
click:
  Installed: 0.4.21.1
  Candidate: 0.4.21.1
  Version table:
 *** 0.4.21.1 0
        500 http://archive.ubuntu.com/ubuntu/ utopic/main i386 Packages
        100 /var/lib/dpkg/status

Related branches

Revision history for this message
Michael Vogt (mvo) wrote :

I can confirm this issue.

Changed in click (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
importance: Undecided → High
status: New → Triaged
Revision history for this message
Michael Vogt (mvo) wrote :

There was a problem with the sources.list generation in the chroot, the linked branch fixes this.

However there is still the problem that the chroot expects to have a
  "g++-%s" % target_tuple
package to do the cross build. So your example will stil fail.

I would like to get feedback from Colin what we should do:
- generate a better error but leave the cases when there is no g++-%(target_tuple)s available
- support chroot for native == target arch
- support the amd64 -> i386 as a special case

Or none of the above :) ?

Revision history for this message
Colin Watson (cjwatson) wrote :

I think we should probably have a table rather like that in mk-sbuild (perhaps reduced) of which architecture combinations can use native chroots, and generate native-building chroots in those cases rather than cross-building ones; so in the i386-on-amd64 case we would set self.native_arch to "i386". Then drop the -TARGET bit from g++ and libc-dev if self.native_arch == self.target_arch.

Both i386-on-amd64 and (of course) i386-on-i386 should then work.

Colin Watson (cjwatson)
summary: - Failes to create x86 chroot
+ Fails to create x86 chroot
Revision history for this message
Colin Watson (cjwatson) wrote :

I've merged Michael's patch for sources.list generation. I'll take care of the remaining piece of this.

Changed in click (Ubuntu):
assignee: Michael Vogt (mvo) → Colin Watson (cjwatson)
status: Triaged → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

By the way, for the case of an amd64 chroot on an i386 host system, we'll deal with this by just creating a native amd64 chroot; this is our only option because there's no i386-to-amd64 cross-compiler as such in the archive (and "gcc -m64" is a somewhat different kettle of fish that requires explicit build system support). This is perfectly workable, but only if you've taken special measures to install a 64-bit kernel on the i386 system so that it can execute 64-bit binaries.

I suspect that this is a fairly niche case; i386 chroot on amd64 host will likely be rather more common.

Colin Watson (cjwatson)
Changed in click (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package click - 0.4.23.1

---------------
click (0.4.23.1) utopic; urgency=medium

  [ Colin Watson ]
  * chroot: Force dpkg-architecture to recalculate everything rather than
    picking up values from the environment, to avoid the test suite getting
    confused by environment variables exported by dpkg-buildpackage.
  * tox.ini: Regularise whitespace.
  * Lintian complains about dh --with gir without a direct Build-
    Depends: gobject-introspection, although libgirepository1.0-dev
    depends on it. Build-depend on both.
  * Factor out some repetitive PackageKit error-reporting code.
  * Fix test coverage glitch.
  * Avoid ensure_dbing multiple times.
  * /custom/click, not /custom.
  * Remove trailing whitespace.
  * Document chroot session management.
  * Make manifest.json example actually be valid JSON.
  * Document that click chroot -s is mainly for debugging.
  * Allow specifying a framework base directly.
  * Fix docstring.
  * Add appropriate Since: annotations.
  * formatting
  * merge lp:~mvo/click/documentation-tweak
  * merge lp:~mvo/click/avoid-exposing-envvars

click (0.4.23) utopic; urgency=medium

  [ Michael Vogt ]
  * Show human-readable error message when a click chroot subcommand fails
    because of existing or non-existing chroots (LP: #1296820).
  * Selectively disable logging on some tests to avoid message spam during
    the test runs.
  * When running hooks, remove hook symlinks if framework requirements are
    not met (LP: #1271944).
  * Cleanup the chroot if "click chroot create" fails (unless
    --keep-broken-chroot is used)
  * Fix sources.list generation when native_arch and target_arch are on the
    same archive server (part of LP #1319153).
  * Add "click framework list" command to list available frameworks
    (LP: #1294659).

  [ Pete Woods ]
  * Add libunity-scopes-dev package to chroot (LP: #1320786).

  [ Sergio Schvezov ]
  * click chroot creation depends on dpkg-architecture, so recommend
    dpkg-dev.

  [ Colin Watson ]
  * chroot: Handle the case where we can execute binaries for the target
    architecture directly and thus don't need a cross-compiler
    (LP: #1319153).
 -- Ubuntu daily release <email address hidden> Tue, 20 May 2014 13:15:41 +0000

Changed in click (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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