unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sergei Trofimovich <slyfox@inbox.ru>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: 'guix build --target=' handling questions
Date: Mon, 6 Mar 2017 22:01:46 +0000	[thread overview]
Message-ID: <20170306220146.71d7d8ec@sf> (raw)
In-Reply-To: <87y3wiqtml.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3040 bytes --]

On Mon, 06 Mar 2017 17:04:18 +0100
ludo@gnu.org (Ludovic Courtès) wrote:

> Sergei Trofimovich <slyfox@inbox.ru> skribis:
> 
> >> Question time:
> >> 
> >> - Is there a way to run 'guix environment --target=' in the same way as 'guix build --target='
> >>   sets it up? I'd like to see how both compilers are supposed to be present 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.
> >> 
> >> - How to actually set CXX to point to target g++?
> >>   It looks like implicitly there already both host (through native-inputs)
> >>   and target (through build-inputs) compilers available.
> >>   I would expect something like
> >>       #:make-flags (list (string-append "CXX=" <.?.>)) 
> >>   What should be in place of that "<.?.>" to refer to target g++?  
> >
> > 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 prefix.
> > -        #:make-flags (list (string-append "prefix=" %output))
> > +        #:make-flags (list (string-append "prefix=" %output)
> > +                           (string-append "CXX=" ,(string-append (if (%current-target-system)
> > +                                                                     (string-append (%current-target-system) "-")
> > +                                                                     "")
> > +                                                                 "g++")))  
> 
> As John wrote, this is the right fix for this package.

Aha!

> If you can send it with ‘git send-email’ (see
> <https://www.gnu.org/software/guix/manual/html_node/Submitting-Patches.html>),

Sent as:
    http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26004

About the 'guix environment --target=' / 'guix build --target=' part or question:

Would it make sense to have '--target=' support in 'guix environment' tool or is it
too tricky?

Thanks!

-- 

  Sergei

[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2017-03-06 22:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 21:40 'guix build --target=' handling questions Sergei Trofimovich
2017-02-22 22:54 ` Sergei Trofimovich
2017-02-23 17:07   ` John Darrington
2017-03-06 16:04   ` Ludovic Courtès
2017-03-06 22:01     ` Sergei Trofimovich [this message]
2017-03-07 14:48       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306220146.71d7d8ec@sf \
    --to=slyfox@inbox.ru \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).