Page MenuHomePhabricator

debian-glue job: ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Closed, ResolvedPublic

Description

Jenkins Debian Glue attempts to use eatmydata which dramatically speed up the build time.

pbuilder has support for it since 0.225. Jenkins Debian Glue then check the target distribution to verify whether it has a recent enough version (and all recent distro beside trusty have one).

The package is added by setting EXTRAPACKAGES=eatmydata which pbuilder build honors to install some more packages. However it is not installed in our build:

sudo DIST=stretch cowbuilder --build xxx.dsc
-> Invoking pbuilder
 forking: pbuilder build ... xxx.dsc
 I: Installing the build-deps
 I: user script .../hooks/D01apt.wikimedia.org starting
 ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

I blame sudo for not passing the environment variable...

Event Timeline

Mentioned in SAL (#wikimedia-releng) [2019-01-21T19:49:31Z] <hashar> integration: update sudo rule for debian-glue to keep env variable EXTRAPACKAGES. Would let us get eatmydata included | T214328

eatmydata is properly installed:

The following additional packages will be installed:
  libeatmydata1 libfakeroot
The following NEW packages will be installed:
  eatmydata fakeroot libeatmydata1 libfakeroot

The issue is that it happens rather late in pbuilder, notably after D hooks and after pbuilder-satisfydepends-dummy. The relevant code (on Jessie) is:

/usr/lib/pbuilder/pbuilder-buildpackage-funcs
function checkbuilddep () {
    # call satisfydepends
    local BUILDOPT="--binary-all"
    case "${BINARY_ARCH}" in
        yes) BUILDOPT="--binary-arch";;
        *) ;;
    esac
    if "$PBUILDERSATISFYDEPENDSCMD" --control "$1" --chroot "${BUILDPLACE}" --internal-chrootexec "${CHROOTEXEC}" "${BUILDOPT}" "${PBUILDERSATISFYDEPENDSOPT[@]}"; then
        :
    else
    # If asked to preserve the build place, and pbuilder-satisfydepends
    # didn't taint it, then don't clean it when exiting.
        if [ $? -eq 2 -a "${PRESERVE_BUILDPLACE}" = "yes" ]; then
            trap umountproc_trap exit sighup
        fi
        log "E: pbuilder-satisfydepends failed."
        exit 2
    fi
    # install extra packages to the chroot
    if [ -n "$EXTRAPACKAGES" ]; then
        $CHROOTEXEC usr/bin/apt-get -q -y "${APTGETOPT[@]}" install ${EXTRAPACKAGES}
    fi
}

So it is intended to have extra packages installed AFTER pbuilder-dummy which kind of make sense. The code is similar in Debian Stretch.

hashar closed this task as Resolved.EditedJan 21 2019, 9:36 PM
hashar claimed this task.

Eventually we can revisit after the jobs get migrated to Debian Stretch and a more recent version of pbuilder. Jessie has 0.215 but 0.225 bring in built-in eatmydata support so that should help :)