From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#36813: 'lower-gexp' does not respect 'system' or 'target' keywords Date: Fri, 26 Jul 2019 10:21:47 +0200 Message-ID: <87ftmtqk84.fsf@gnu.org> References: <87imrp3ddy.fsf@sdf.lonestar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53776) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqvVL-0005WO-W3 for bug-guix@gnu.org; Fri, 26 Jul 2019 04:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqvVG-0003YK-Tm for bug-guix@gnu.org; Fri, 26 Jul 2019 04:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hqvVG-0003Y5-Pw for bug-guix@gnu.org; Fri, 26 Jul 2019 04:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hqvVF-0001Ak-KR for bug-guix@gnu.org; Fri, 26 Jul 2019 04:23:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87imrp3ddy.fsf@sdf.lonestar.org> (Jakob L. Kreuze's message of "Thu, 25 Jul 2019 19:25:45 -0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: "Jakob L. Kreuze" Cc: 36813@debbugs.gnu.org Hello Jakob, zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) skribis: > I believe there is an issue with 'lower-gexp'. Running the following > snippet to lower a G-Expression for "i686-linux" yields output that > references store paths built for x86_64. In this case, the Guile > interpreter used is an x86_64 binary. > > #+BEGIN_SRC scheme > (define (display-exp exp) > (mlet* %store-monad ((lowered (lower-gexp exp > #:system "i686-linux" > #:target "i686-linux")) > (to-build -> (cons (lowered-gexp-guile lowered) > (lowered-gexp-inputs lowered))) > (_ (built-derivations to-build))) > (return (format #t "~a~%" (lowered-gexp-sexp lowered))))) > > (with-store store > (run-with-store store > (display-exp #~(primitive-load #$(switch-system-program %system))))) > #+END_SRC Note: #:target must be a =E2=80=9CGNU triplet=E2=80=9D like =E2=80=9Carm-li= nux-gnueabihf=E2=80=9D, not a system type like =E2=80=9Ci686-linux=E2=80=9D. > jakob@Epsilon ~ $ guile ~/test.scm=20 > (primitive-load /gnu/store/v7v1b7375j9j82dvfycv56v36nv5jq3y-switch-to-sys= tem.scm) > jakob@Epsilon ~ $ cat /gnu/store/v7v1b7375j9j82dvfycv56v36nv5jq3y-switch-= to-system.scm > #!/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/bin/guile --no-= auto-compile > !# > ... > jakob@Epsilon ~ $ file /gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-= 2.2.4/bin/guile > /gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/bin/guile: ELF 64= -bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpre= ter /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-linux-x86= -64.so.2, for GNU/Linux 2.6.32, not stripped That=E2=80=99s because the Guile used here comes from the #:guile-for-build parameter. So the caller is responsible for doing the right thing here. In fact, if you do: (lower-gexp exp #:system whatever #:guile-for-build #f) it will automatically take care of computing the right Guile for this system. For consistency, I don=E2=80=99t think we should change the defaul= t, though. WDYT? Thanks, Ludo=E2=80=99.