From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Trofimovich Subject: Re: 'guix build --target=' handling questions Date: Mon, 6 Mar 2017 22:01:46 +0000 Message-ID: <20170306220146.71d7d8ec@sf> References: <20170221214035.6cd9f180@sf> <20170222225422.2d1020ba@sf> <87y3wiqtml.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/wtBi23oB971FCkgbbrWI8iO"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cl0hZ-0005r4-5k for guix-devel@gnu.org; Mon, 06 Mar 2017 17:01:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cl0hX-000665-Vd for guix-devel@gnu.org; Mon, 06 Mar 2017 17:01:57 -0500 In-Reply-To: <87y3wiqtml.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Cc: guix-devel@gnu.org --Sig_/wtBi23oB971FCkgbbrWI8iO Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 06 Mar 2017 17:04:18 +0100 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Sergei Trofimovich skribis: >=20 > >> Question time: > >>=20 > >> - Is there a way to run 'guix environment --target=3D' in the same way= as 'guix build --target=3D' > >> sets it up? I'd like to see how both compilers are supposed to be pr= esent in there. > >> > >> - Why default g++ in PATH is the host g++ and not target g++? > >> Target seems to make most sense if no explicit compiler is specified. > >>=20 > >> - How to actually set CXX to point to target g++? > >> It looks like implicitly there already both host (through native-inp= uts) > >> and target (through build-inputs) compilers available. > >> I would expect something like > >> #:make-flags (list (string-append "CXX=3D" <.?.>))=20 > >> What should be in place of that "<.?.>" to refer to target g++? =20 > > > > I think I've found a workaround at least for my third question. > > > > Both host and target compilers are available as g++ and ${target}-g++. > > > > Thus the following workaround seems to work: > > > > diff --git a/gnu/packages/regex.scm b/gnu/packages/regex.scm > > index f04cba706..a8fa689ab 100644 > > --- a/gnu/packages/regex.scm > > +++ b/gnu/packages/regex.scm > > @@ -20,11 +20,13 @@ > > > > (define-module (gnu packages regex) > > #:use-module ((guix licenses) #:prefix license:) > > #:use-module (guix packages) > > #:use-module (guix download) > > - #:use-module (guix build-system gnu)) > > + #:use-module (guix build-system gnu) > > + #:use-module (guix utils) ; for %current-target-system > > + ) > > > > (define-public re2 > > (package > > (name "re2") > > (version "2017-01-01") > > @@ -40,11 +42,15 @@ > > "0yij1ajh66h3pj3kfz7y0ldrsww8rlpjzaavyr5lchl98as1jq74= ")))) > > (build-system gnu-build-system) > > (arguments > > `(#:test-target "test" > > ;; There is no configure step, but the Makefile respects a pre= fix. > > - #:make-flags (list (string-append "prefix=3D" %output)) > > + #:make-flags (list (string-append "prefix=3D" %output) > > + (string-append "CXX=3D" ,(string-append (if= (%current-target-system) > > + (= string-append (%current-target-system) "-") > > + "= ") > > + "g++"= ))) =20 >=20 > As John wrote, this is the right fix for this package. Aha! > If you can send it with =E2=80=98git send-email=E2=80=99 (see > ), Sent as: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D26004 About the 'guix environment --target=3D' / 'guix build --target=3D' part or= question: Would it make sense to have '--target=3D' support in 'guix environment' too= l or is it too tricky? Thanks! --=20 Sergei --Sig_/wtBi23oB971FCkgbbrWI8iO Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSZKa0VG5avZRlY01hxoe52YR/zqgUCWL3cSgAKCRBxoe52YR/z quVBAJ9hVYbW5nSVXwleTR/CuKFNKHlppgCdEdVDnilWmIYDy2XlURneSUkuDdA= =kje5 -----END PGP SIGNATURE----- --Sig_/wtBi23oB971FCkgbbrWI8iO--