From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cC4cE3XXEmN4KQAAbAwnHQ (envelope-from ) for ; Sat, 03 Sep 2022 06:26:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6BocE3XXEmP6JQEA9RJhRA (envelope-from ) for ; Sat, 03 Sep 2022 06:26:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7AC94453BF for ; Sat, 3 Sep 2022 06:26:28 +0200 (CEST) Received: from localhost ([::1]:59010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUKjj-0000cq-MM for larch@yhetil.org; Sat, 03 Sep 2022 00:26:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUKjK-0000ch-5l for bug-guix@gnu.org; Sat, 03 Sep 2022 00:26:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUKjJ-0001qM-Sj for bug-guix@gnu.org; Sat, 03 Sep 2022 00:26:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oUKjJ-0000wI-N8 for bug-guix@gnu.org; Sat, 03 Sep 2022 00:26:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#57116: cling: missing some system header files Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 03 Sep 2022 04:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57116 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Liliana Marie Prikler Cc: Gang Liang , 57116@debbugs.gnu.org Received: via spool by 57116-submit@debbugs.gnu.org id=B57116.16621791163542 (code B ref 57116); Sat, 03 Sep 2022 04:26:01 +0000 Received: (at 57116) by debbugs.gnu.org; 3 Sep 2022 04:25:16 +0000 Received: from localhost ([127.0.0.1]:40746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUKia-0000v3-Bx for submit@debbugs.gnu.org; Sat, 03 Sep 2022 00:25:16 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:33710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUKiY-0000uj-IN for 57116@debbugs.gnu.org; Sat, 03 Sep 2022 00:25:15 -0400 Received: by mail-qk1-f179.google.com with SMTP id f14so3233021qkm.0 for <57116@debbugs.gnu.org>; Fri, 02 Sep 2022 21:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date; bh=GuEbSbZmxyp/KtKYKdwZQDAAy1wExDYniGI/rXyaVzI=; b=PAEPhyLlyTm8hUnjV7HOdamkN+ySwPQJ4CGu7U3/AXkcZNn0XiKIDXwVok/0iL+jfs taUY3UZFEjh6ojRz2jFmvx6hBVZQwtmMVRd0MGhtQL9D1sPYSAUYt8GQ+tLG349EoYn1 PBj8y6wQ3eJ/l5TqRTbnROGrEyO6BNY+LrOBDlW3j6I3V/PO4ekPZaZSk7+OWrUr3r1t RWBBF8IZQVocC8vYba0tXHTWcmW0oNXAMIvAR7M2Mtj9jZ0sOKvca0n1dqy9GC6yjKeY WqOOVyOtjm0LYGfqFy21tsTEDZpFlZyvMJxoJKVY8hTdd9PkebCpdQLZ9uFm2vg+VmX0 VINQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=GuEbSbZmxyp/KtKYKdwZQDAAy1wExDYniGI/rXyaVzI=; b=gX3EecJBNQ/ALk+2KAtwEQ8hcmn79Xw0f41arL7Rpn8DYfdz5XP1gamMjWFHrJT6XS gHX4G1tFXAe2GPF/xBAyyy2goXhU8uuK5norJEetf9/7d+tG/Wc06O6kJ+fx9zh1QJzO 1PyPnx271EPFuDIPPcwtuL/F3a52+cD8pLKTBtQvo/c7cTV+r6XLiUjrZ3MapYQdj27y VkeCIQTtAUe4IGaJjVSk9oAcULMbURgVIFXFJlWnV/K0LEqUM2oF9y80Gxg+Yh9j9NWq 4YljBItME1O2qZxj40w4hZWgUp6XFSuDxxCQOmRwp2OJhGmMAtDs72aB5QYJYBvmhxwv 7txw== X-Gm-Message-State: ACgBeo0Q64fxUSARid7xdDIAuwSbJ0IpY7/2zvyw4/Bhlta4C8VaFsNc s0lZt0EZDayLw4fvA5FEmwZu7l8HDpo= X-Google-Smtp-Source: AA6agR6rdi0rvLRSxV6LjohrHtP6SrjXtZDftZ6Obd5BPs8XqnEamQAGRtUJSc+bFFoxgrGKF+Gclw== X-Received: by 2002:a37:b247:0:b0:6ba:ed13:dd89 with SMTP id b68-20020a37b247000000b006baed13dd89mr25352662qkf.771.1662179108778; Fri, 02 Sep 2022 21:25:08 -0700 (PDT) Received: from hurd (dsl-10-128-104.b2b2c.ca. [72.10.128.104]) by smtp.gmail.com with ESMTPSA id t11-20020a05620a450b00b006b8e8c657ccsm2843345qkp.117.2022.09.02.21.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 21:25:08 -0700 (PDT) From: Maxim Cournoyer References: Date: Sat, 03 Sep 2022 00:25:06 -0400 In-Reply-To: (Liliana Marie Prikler's message of "Thu, 11 Aug 2022 08:17:08 +0200") Message-ID: <87bkrx6q59.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662179188; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=GuEbSbZmxyp/KtKYKdwZQDAAy1wExDYniGI/rXyaVzI=; b=GujIsJ3wOv9k8zs3d/ZcblYCj12UZBv0yizDpEffeY6tDyaxh6xj7cv85zl7iwoEwGm+tY Tyz4T5jqTl7uao7qBHufyVqYyQmjM2mfMRFDCcDLypudbhDyvUhTOm2nwrYmEfHqmtwb5I gyJZa/F3r824re4za8OMpwiU44Yy/b3gHAPZNH4T7YIypRdEUVm0jdKNHiRGOi0D8jOurt p0g516xZv7u1d2iG3w+t+1WYIZTNKcTGDpV2rTE8TZj9CJjHDaKHrZ2uGlIuq0zuKra6pl sEIZpRYXWnuApMOrQ0Y3c2Ncx7ctcZkQuBH6CZXasOfkUjh5tvL4eE8RdZWWFw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662179188; a=rsa-sha256; cv=none; b=YpCjicbS3sGUhqxEKoncr38gBKayY/JhDhfbETOLYuqCK1W6wMFGGvzREwvPdUsgKjimv8 2IxZ+gd43tPu570fhIlyT+JhZYMb4wc6zPnAB+/Vw3x198ps9zO2zXtJwmbHk8s2NcajpN hcXt9iSECU3rqNMBkBG9AxFoRkHWSu+21blXTlRW4eWn/AM0QbWNdBOYj8C434dmya3mYd ceumIvVvgtFJVarJNSMWRCGD+loDynoSi+BqY9S0hIp8daWxraEUEVp9YyPVg+qF3Y372W onlfcomTferyDUuRfI5AwlvBdcAKjGL3W+vZTixzYuwGas+nIFUSNORdKf55EQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PAEPhyLl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PAEPhyLl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7AC94453BF X-Spam-Score: 7.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: peLXq5HNL8hA Hello, Liliana Marie Prikler writes: > Am Dienstag, dem 09.08.2022 um 15:32 -0700 schrieb Gang Liang: >> I had a fresh installation of cling from guix, and got the following >> error. Seems some system headers are missing. > You probably need gcc-toolchain installed alongside cling. Indeed: $ guix shell --pure cling -- cling '#include ' In file included from input_line_3:1: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/iostream:39: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/ostream:38: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/ios:42: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/bits/ios_base.h:41: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/bits/locale_classes.h:40: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/string:55: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/bits/basic_string.h:6545: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/ext/string_conversions.h:44: In file included from /gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/include/c++/cerrno:42: In file included from /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/include/errno.h:28: /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/include/bits/errno.h:26:11: fatal error: 'linux/errno.h' file not found # include ^~~~~~~~~~~~~~~ But: $ guix shell --pure cling gcc-toolchain -- cling '#include ' runs fine. I tried this: --8<---------------cut here---------------start------------->8--- modified gnu/packages/llvm.scm @@ -79,6 +79,12 @@ (define-module (gnu packages llvm) #:export (make-lld-wrapper system->llvm-target)) +;;; Lazily resolve to avoid top-level cycles between modules. +(define gcc-toolchain* + (delay (module-ref (resolve-interface '(gnu packages commencement)) + 'gcc-toolchain))) + + (define* (system->llvm-target #:optional (system (or (and=> (%current-target-system) gnu-triplet->nix-system) @@ -2215,11 +2221,25 @@ (define-public cling (add-after 'install 'delete-static-libraries ;; This reduces the size from 17 MiB to 5.4 MiB. (lambda _ - (for-each delete-file (find-files #$output "\\.a$"))))))) + (for-each delete-file (find-files #$output "\\.a$")))) + (add-after 'install 'wrap-cling + ;; Wrap the 'cling' command so that it can locate the GCC + ;; toolchain provided headers. Use 'suffix so as to allow users + ;; to override which headers are used. + (lambda* (#:key outputs #:allow-other-keys) + (define gcc-toolchain #$(this-package-input "gcc-toolchain")) + (wrap-program (search-input-file outputs "bin/cling") + `("C_INCLUDE_PATH" suffix + (,(string-append gcc-toolchain "/include"))) + `("CPLUS_INCLUDE_PATH" suffix + (,(string-append gcc-toolchain "/include/c++") + ,(string-append gcc-toolchain "/include"))) + `("LIBRARY_PATH" suffix + (,(string-append gcc-toolchain "/lib"))))))))) (native-inputs (list python python-lit)) (inputs - (list clang-cling llvm-cling)) + (list clang-cling (force gcc-toolchain*) llvm-cling)) (home-page "https://root.cern/cling/") (synopsis "Interactive C++ interpreter") (description "Cling is an interactive C++17 standard compliant --8<---------------cut here---------------end--------------->8--- but it gave: --8<---------------cut here---------------start------------->8--- /gnu/store/lpwfmh4v2w2qbpdmmva0si32c9havn95-llvm-cling-9.0.1/lib/libLLVM-9.so(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1a)[0x7f76e20ea81a] /gnu/store/lpwfmh4v2w2qbpdmmva0si32c9havn95-llvm-cling-9.0.1/lib/libLLVM-9.so(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x7f76e20e8894] /gnu/store/lpwfmh4v2w2qbpdmmva0si32c9havn95-llvm-cling-9.0.1/lib/libLLVM-9.so(+0x7129c2)[0x7f76e20e89c2] /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0(+0x11d80)[0x7f76e6c3fd80] /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6(_ZTVN10__cxxabiv120__si_class_type_infoE+0x10)[0x7f76e19c0c78] Stack dump: 0. Program arguments: /gnu/store/x48h88ckmkk5vh9g36d2cnmhw23x9ql5-profile/bin/cling #include --8<---------------cut here---------------end--------------->8--- I'm not sure why. Should we close it as 'notabug', or persist with the attempt to wrap the cling binary with the include paths required to ease its setup? Thanks, Maxim