From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6599908608985530368 X-Received: by 2002:a2e:9945:: with SMTP id r5-v6mr257795ljj.44.1538032355406; Thu, 27 Sep 2018 00:12:35 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:ec14:: with SMTP id b20-v6ls342803lfa.10.gmail; Thu, 27 Sep 2018 00:12:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV60JvYDUb09DcBPCB/eHJ9i6gq9QXTP590ErsfR3DmjnrRhWMbKzVsDMhMkYzbqOdMhVDKci X-Received: by 2002:a19:915c:: with SMTP id y28-v6mr285218lfj.1.1538032354812; Thu, 27 Sep 2018 00:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538032354; cv=none; d=google.com; s=arc-20160816; b=0XHqZrR31raNEov7Dds2YpmJ8k2YGKmaCuu+g4DOqwhbzBlDazyMFwWCwpdHpyLVGZ j+EJue9djT3SZ3/aUuAX4o0X2C+fjFiRz3UR408QkBGWQ25ty1TuTvRb/vN6P0KNIOmz NuhHRXIcp2MYLvSIgu2tx+JOvPmO2EHjDwVYaSBd84S7T3TI0RSgCW84/b2Ei7dM6XhJ nKwwBJl7xPUPfi03YMbZQ7ynbR3wYfgQWrLDfgtJsllvxYpJTxJtJD/YTLoaquuYafpq Ec71m23xxpz+5mJZPii9OOaoBaxBH3hBSNuaCZAc80onMlA7QBVIUCNtXfbf1CEPxjbI yuSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:to:subject; bh=u7WT+EfV7XdPpDAmY09dLRlzjz51SAXFaPTBilp7fqs=; b=dykkKHWGRIG7y0IVZzU8q6cwegYrGVWXFNhZl93tKW6Rg87F5nA31TZsKqhsbFlk3+ k0/MBHiMei1qVrKksTVuHmIp1S8J2Q//c3sj0aXw1R3tNZo+pavD8LddbpQ+Hx45tMtU c9WEDh3jqV8HfBvICxdP2gqnfU1o8E6yq0AdZ2F41cdtHzQbRZnfgM72fxQnuV9mFNyb Ctft7ZOKZr5M9//z3X8oBHhRuPKoWCeWr5DG4jfTkO5Z51Vax6Q/Kyoob8OXcMTa56Hm ArlFHi/mIr7fNqJTNQk0pFRhDSscYfim0rTXLOu6vLfvygYlwUFE6Hj+kPskVnD7g1eF 3YVA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id c18-v6si63594lff.1.2018.09.27.00.12.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 00:12:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from [192.168.50.211] (nat-ppp-217.71.235.199-satnet-spb.ru [217.71.235.199] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w8R7CUal023543 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 27 Sep 2018 09:12:32 +0200 Subject: Re: [PATCHv2 1/2] cross: use env variables instead of switches To: Henning Schild , isar-users References: <20180911101605.21977-2-henning.schild@siemens.com> <20180921125542.3026-1-henning.schild@siemens.com> <20180921150840.02e8bd55@md1pvb1c.ad001.siemens.net> From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: <63ddc92e-c7c5-06d5-fe6d-cb7ea689b8d0@ilbers.de> Date: Thu, 27 Sep 2018 10:12:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180921150840.02e8bd55@md1pvb1c.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: 5xFMDNdlZBmK On 9/21/18 4:08 PM, Henning Schild wrote: > Am Fri, 21 Sep 2018 14:55:42 +0200 > schrieb Henning Schild : > >> Debian has environment variables to set the architectures to be used >> by dpkg-buildpackage and mk-build-deps. Use those instead of adding >> parameters to the tools. >> This patch now also uses the debian names for cross building and we do >> not have confusing statements like "--host-arch $target_arch" anymore. > > The change to v1 is that we call mk-build-deps still with --host-arch. > And we provide the "default"-argument, according to the man-page. The > tool does not do what its man-page says, or at least the man-page is > very confusing. I've reran scripts/ci_build.sh on stretch host - (both variants - native and cross) - build still fails on example-hello, example module etc. I would suggest to run CI script before submitting patch to the mailing list. Maxim. > Henning > >> Signed-off-by: Henning Schild >> --- >> meta/classes/dpkg.bbclass | 6 +++++- >> meta/recipes-devtools/buildchroot/files/build.sh | 2 +- >> meta/recipes-devtools/buildchroot/files/common.sh | 13 ------------- >> meta/recipes-devtools/buildchroot/files/deps.sh | 4 ++++ >> 4 files changed, 10 insertions(+), 15 deletions(-) >> >> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass >> index da0b40d..959c041 100644 >> --- a/meta/classes/dpkg.bbclass >> +++ b/meta/classes/dpkg.bbclass >> @@ -7,6 +7,8 @@ inherit dpkg-base >> do_install_builddeps() { >> dpkg_do_mounts >> E="${@ bb.utils.export_proxies(d)}" >> + export DEB_HOST_ARCH="${DISTRO_ARCH}" >> + export DEB_BUILD_ARCH="${HOST_ARCH}" >> sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} >> ${DISTRO_ARCH} dpkg_undo_mounts >> } >> @@ -19,5 +21,7 @@ do_install_builddeps[stamp-extra-info] = >> "${DISTRO}-${DISTRO_ARCH}" # Build package from sources using build >> script dpkg_runbuild() { >> E="${@ bb.utils.export_proxies(d)}" >> - sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} >> ${DISTRO_ARCH} >> + export DEB_HOST_ARCH="${DISTRO_ARCH}" >> + export DEB_BUILD_ARCH="${HOST_ARCH}" >> + sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} >> } >> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh >> b/meta/recipes-devtools/buildchroot/files/build.sh index >> e74bc14..0458b1f 100644 --- >> a/meta/recipes-devtools/buildchroot/files/build.sh +++ >> b/meta/recipes-devtools/buildchroot/files/build.sh @@ -15,4 +15,4 @@ >> for i in configure aclocal.m4 Makefile.am Makefile.in; do done >> >> # Build the package >> -dpkg-buildpackage -a$target_arch -d --source-option=-I >> +dpkg-buildpackage -d --source-option=-I >> diff --git a/meta/recipes-devtools/buildchroot/files/common.sh >> b/meta/recipes-devtools/buildchroot/files/common.sh index >> b7551eb..61917b8 100644 --- >> a/meta/recipes-devtools/buildchroot/files/common.sh +++ >> b/meta/recipes-devtools/buildchroot/files/common.sh @@ -6,19 +6,6 @@ >> >> set -e >> >> -# Create human-readable names >> -target_arch=$2 >> - >> -# Notes: >> -# mk-build-deps for jessie and jtretch has different parameter >> name to specify -# host architecture. >> -debian_version=$(cut -c1 /etc/debian_version) >> -if [ $(($debian_version)) -ge 9 ]; then >> - set_arch="--host-arch $target_arch" >> -else >> - set_arch="-a $target_arch" >> -fi >> - >> # Go to build directory >> cd $1 >> >> diff --git a/meta/recipes-devtools/buildchroot/files/deps.sh >> b/meta/recipes-devtools/buildchroot/files/deps.sh index >> 4bd604f..cc34b2d 100644 --- >> a/meta/recipes-devtools/buildchroot/files/deps.sh +++ >> b/meta/recipes-devtools/buildchroot/files/deps.sh @@ -23,5 +23,9 @@ >> apt-get update \ -o Dir::Etc::sourceparts="-" \ >> -o APT::Get::List-Cleanup="0" >> >> +# according to the man-page --host-arch should default to exactly >> what we say +# here ... but it does not, so we have to provide this >> argument +set_arch="--host-arch `dpkg-architecture -qDEB_HOST_ARCH`" >> + >> # Install all build deps >> mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control > -- Maxim Osipov ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn Germany +49 (151) 6517 6917 mosipov@ilbers.de http://ilbers.de/ Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov