From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 04 07:53:27 2020 Received: (at submit) by debbugs.gnu.org; 4 Feb 2020 12:53:27 +0000 Received: from localhost ([127.0.0.1]:42759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxhn-0006Y6-EF for submit@debbugs.gnu.org; Tue, 04 Feb 2020 07:53:27 -0500 Received: from lists.gnu.org ([209.51.188.17]:51450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxhl-0006Xy-3e for submit@debbugs.gnu.org; Tue, 04 Feb 2020 07:53:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54082) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyxhj-0006yc-TZ for guix-patches@gnu.org; Tue, 04 Feb 2020 07:53:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iyxhj-0003pL-PQ; Tue, 04 Feb 2020 07:53:23 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50230 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iyxhj-0002T8-Cw; Tue, 04 Feb 2020 07:53:23 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH core-updates 0/2] Clarify search path handling in commencement.scm Date: Tue, 4 Feb 2020 13:53:14 +0100 Message-Id: <20200204125314.27494-1-ludo@gnu.org> X-Mailer: git-send-email 2.25.0 X-Debbugs-Cc: janneke@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Guix! The patch below for current ‘core-updates’ is an attempt to clarify search path handling in commencement.scm by: 1. Having ‘native-search-paths’ fields only for compilers—e.g., “C_INCLUDE_PATH” belongs to the compiler, not to libc. 2. Avoiding phases that manually fiddle with search path environment variables: normally, this is handled automatically by the ‘set-paths’ phase based on the declared search paths, so manual fiddling should be a last resort and it should be well commented so we remember why it’s there. This is an attempt to reduce complexity and keep things declarative as much as possible. I’ve tested it on top of 46312064de8ae0cca531fddbc4b5ec8421e5d866 and “guix build coreutils” succeeds. There’s another pattern that I found hard to follow that has to do with the reuse of build phases. For example, there’s a build phase named ‘setenv’ (perhaps we should find a more descriptive name :-)) in the various GCCs that is reused or replaced; when looking at a specific package, it’s difficult to see which phases it really runs because this particular phase is inherited and modified on several layers. If I can make time for it, I’ll see if I can come up with a proposal to clarify this, but at any rate, it’s probably something to keep in mind for future changes. Thoughts? (I’m particularly interested in your feedback, janneke!) Ludo’. Ludovic Courtès (2): gnu: commencement: Avoid hard-coded GCC version numbers. gnu: commencement: Rationalize search path handling. gnu/packages/commencement.scm | 201 ++++++++-------------------------- 1 file changed, 48 insertions(+), 153 deletions(-) -- 2.25.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 04 08:01:20 2020 Received: (at 39414) by debbugs.gnu.org; 4 Feb 2020 13:01:20 +0000 Received: from localhost ([127.0.0.1]:42768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpQ-0006lQ-Ii for submit@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpP-0006lD-Af for 39414@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iyxpK-0005HD-2T; Tue, 04 Feb 2020 08:01:14 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50238 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iyxp7-0007nn-Sv; Tue, 04 Feb 2020 08:01:11 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 39414@debbugs.gnu.org Subject: [PATCH 1/2] gnu: commencement: Avoid hard-coded GCC version numbers. Date: Tue, 4 Feb 2020 14:00:41 +0100 Message-Id: <20200204130042.27757-1-ludo@gnu.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , janneke@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/packages/commencement.scm (gcc-mesboot1, gcc-mesboot): Use 'package-version' instead of hard-coding the version number. --- gnu/packages/commencement.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 851bb02163..f011891725 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -938,7 +938,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (package (inherit gcc-mesboot0) (name "gcc-mesboot1") - (version "4.7.4") + (version (package-version gcc-4.7)) (source (bootstrap-origin (origin (inherit (package-source gcc-4.7)) (patches (search-patches "gcc-boot-4.7.4.patch"))))) @@ -1265,7 +1265,7 @@ exec " gcc "/bin/" program (package (inherit gcc-mesboot1) (name "gcc-mesboot") - (version "4.9.4") + (version (package-version gcc-4.9)) (source (bootstrap-origin (package-source gcc-4.9))) (native-inputs `(("binutils" ,binutils-mesboot) ("gcc-wrapper" ,gcc-mesboot1-wrapper) -- 2.25.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 04 08:01:26 2020 Received: (at 39414) by debbugs.gnu.org; 4 Feb 2020 13:01:26 +0000 Received: from localhost ([127.0.0.1]:42771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpV-0006lh-Qu for submit@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpT-0006lI-PH for 39414@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iyxpO-0005ZK-HW; Tue, 04 Feb 2020 08:01:18 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50238 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iyxpK-0007nn-GM; Tue, 04 Feb 2020 08:01:15 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 39414@debbugs.gnu.org Subject: [PATCH 2/2] gnu: commencement: Rationalize search path handling. Date: Tue, 4 Feb 2020 14:00:42 +0100 Message-Id: <20200204130042.27757-2-ludo@gnu.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200204130042.27757-1-ludo@gnu.org> References: <20200204130042.27757-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , janneke@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This commit ensures that only packages that correspond to compilers have a search path set. It also reduces manual handling of search path environment variables. * gnu/packages/commencement.scm (tcc-boot0)[native-search-paths]: Remove copy/pasted comment. (gcc-core-mesboot)[arguments]: In 'install2' phase, do not copy TCC/include to OUT/include. [native-search-paths]: Remove leading slash in "lib/gcc-lib/…" directory name. (mesboot-headers)[native-search-paths]: Remove. (glibc-mesboot0)[native-search-paths]: Remove. (gcc-mesboot0)[native-inputs]: Reorder so that we have libc, then kernel-headers, then gcc. [arguments]: Rewrite 'setenv' phase to only set CONFIG_SHELL and create 'config.cache'. (gcc-mesboot1)[native-inputs]: Reorder similarly. [arguments]: In 'setenv' phase, only set CONFIG_SHELL, C_INCLUDE_PATH, and CPLUS_INCLUDE_PATH. (glibc-headers-mesboot)[arguments]: In 'setenv' phase, replace references to '%build-inputs' by references to 'inputs'; simplify setting of CONFIG_SHELL and SHELL; simplify patching of /bin/pwd in the "configure" file; leave C_INCLUDE_PATH and LIBRARY_PATH unset. (glibc-mesboot)[native-search-paths]: Remove. (gcc-mesboot)[native-inputs]: Reorder. [arguments]: Remove clause for #:phases that would change the 'setenv' phase. --- gnu/packages/commencement.scm | 197 ++++++++-------------------------- 1 file changed, 46 insertions(+), 151 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index f011891725..adc4447454 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2014 Andreas Enge ;;; Copyright © 2012 Nikita Karetnikov ;;; Copyright © 2014, 2015, 2017 Mark H Weaver @@ -148,11 +148,6 @@ (lambda _ (invoke "sh" "install.sh")))))) (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. (list (search-path-specification (variable "C_INCLUDE_PATH") (files '("share/mes/include"))) @@ -266,11 +261,6 @@ (lambda _ (invoke "sh" "install.sh")))))) (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. (list (search-path-specification (variable "C_INCLUDE_PATH") (files '("include"))) @@ -627,18 +617,14 @@ ac_cv_c_float_format='IEEE (little-endian)' (string-append tcc-lib "/libc+gnu.o") (string-append tcc-lib "/libtcc1.o")) (invoke "ls" "-ltrF" gcc-dir) - (copy-recursively (string-append tcc "/include") - (string-append out "/include")) #t)))))) (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. (list (search-path-specification (variable "C_INCLUDE_PATH") - (files '("include" "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"))) + (files '("include" + + ;; Needed to get things like GCC's . + "lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"))) (search-path-specification (variable "LIBRARY_PATH") (files '("lib"))))))) @@ -669,16 +655,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (mkdir-p include) (copy-recursively "include" out) (copy-recursively headers out) - #t)))))) - (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))))))) + #t)))))))) (define glibc-mesboot0 ;; GNU C Library 2.2.5 is the most recent glibc that we managed to build @@ -760,67 +737,38 @@ ac_cv_c_float_format='IEEE (little-endian)' (lambda* (#:key configure-flags #:allow-other-keys) (format (current-error-port) "running ./configure ~a\n" (string-join configure-flags)) - (apply invoke "./configure" configure-flags)))))) - (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "CPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib"))))))) + (apply invoke "./configure" configure-flags)))))))) (define gcc-mesboot0 (package (inherit gcc-core-mesboot) (name "gcc-mesboot0") (native-inputs `(("binutils" ,binutils-mesboot0) - ("gcc" ,gcc-core-mesboot) + + ;; GCC-CORE-MESBOOT must appear last because it also + ;; provides libc headers from Mes that we want to shadow + ;; with those of GLIBC-MESBOOT0. ("libc" ,glibc-mesboot0) + ("kernel-headers" ,%bootstrap-linux-libre-headers) + ("gcc" ,gcc-core-mesboot) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) ("diffutils" ,diffutils-mesboot) - ("kernel-headers" ,%bootstrap-linux-libre-headers) ("make" ,make-mesboot0))) (arguments (substitute-keyword-arguments (package-arguments gcc-core-mesboot) ((#:phases phases) `(modify-phases ,phases (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include" - ":" kernel-headers "/include" - ":" glibc "/include")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - ;; FIXME: add glibc dirs to paths manually - (setenv "LIBRARY_PATH" (string-join - (list (string-append glibc "/lib") - (getenv "LIBRARY_PATH")) - ":")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - (with-output-to-file "config.cache" - (lambda _ - (display " + (lambda _ + (setenv "CONFIG_SHELL" (which "sh")) + (with-output-to-file "config.cache" + (lambda _ + (display " ac_cv_c_float_format='IEEE (little-endian)' "))) - #t))) + #t)) (replace 'install2 (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -946,13 +894,14 @@ ac_cv_c_float_format='IEEE (little-endian)' ("mpfr-source" ,(package-source mpfr-boot)) ("mpc-source" ,(package-source mpc-boot)))) (native-inputs `(("binutils" ,binutils-mesboot) - ("gcc" ,gcc-mesboot0) + ("libc" ,glibc-mesboot0) + ("kernel-headers" ,%bootstrap-linux-libre-headers) + ("gcc" ,gcc-mesboot0) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) ("diffutils" ,diffutils-mesboot) - ("kernel-headers" ,%bootstrap-linux-libre-headers) ("make" ,make-mesboot))) (arguments (substitute-keyword-arguments (package-arguments gcc-core-mesboot) @@ -994,24 +943,18 @@ ac_cv_c_float_format='IEEE (little-endian)' #t))) (delete 'remove-info) (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - #t))) + (lambda _ + (setenv "CONFIG_SHELL" (which "sh")) + + ;; Allow MPFR headers to be found. + (setenv "C_INCLUDE_PATH" + (string-append (getcwd) "/mpfr/src:" + (getenv "C_INCLUDE_PATH"))) + + ;; Set the C++ search path so that C headers can be found as + ;; libstdc++ is being compiled. + (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")) + #t)) (delete 'install2))) ((#:configure-flags configure-flags) `(let ((out (assoc-ref %outputs "out")) @@ -1158,22 +1101,18 @@ exec " gcc "/bin/" program ((#:phases phases) `(modify-phases ,phases (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (headers (assoc-ref %build-inputs "headers")) - (bash (assoc-ref %build-inputs "bash")) - (coreutils (assoc-ref %build-inputs "coreutils")) - (libc (assoc-ref %build-inputs "libc")) - (gcc (assoc-ref %build-inputs "gcc")) + (lambda* (#:key inputs #:allow-other-keys) + (let* ((headers (assoc-ref inputs "headers")) + (libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc")) (cppflags (string-append " -I " (getcwd) "/nptl/sysdeps/pthread/bits" " -D BOOTSTRAP_GLIBC=1")) (cflags (string-append " -L " (getcwd) " -L " libc "/lib"))) (setenv "libc_cv_friendly_stddef" "yes") - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "SHELL" (getenv "CONFIG_SHELL")) - (format (current-error-port) "CONFIG_SHELL=~s\n" (getenv "CONFIG_SHELL")) + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "SHELL" (which "sh")) (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)) @@ -1181,10 +1120,7 @@ exec " gcc "/bin/" program ;; avoid -fstack-protector (setenv "libc_cv_ssp" "false") (substitute* "configure" - (("/bin/pwd") (string-append coreutils "/bin/pwd"))) - (setenv "C_INCLUDE_PATH" (string-append libc "/include" - headers "/include")) - (setenv "LIBRARY_PATH" (string-append libc "/lib")) + (("/bin/pwd") "pwd")) #t))) (replace 'install (lambda* (#:key outputs make-flags #:allow-other-keys) @@ -1244,22 +1180,7 @@ exec " gcc "/bin/" program (install-flags (cons "install" make-flags))) (apply invoke "make" install-flags) (copy-recursively kernel-headers out) - #t)))))))) - (native-search-paths ;; FIXME: move to glibc-mesboot0 - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "CPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib"))))))) + #t)))))))))) (define gcc-mesboot (package @@ -1268,14 +1189,15 @@ exec " gcc "/bin/" program (version (package-version gcc-4.9)) (source (bootstrap-origin (package-source gcc-4.9))) (native-inputs `(("binutils" ,binutils-mesboot) + + ("libc" ,glibc-mesboot) + ("kernel-headers" ,%bootstrap-linux-libre-headers) ("gcc-wrapper" ,gcc-mesboot1-wrapper) ("gcc" ,gcc-mesboot1) - ("libc" ,glibc-mesboot) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) ("diffutils" ,diffutils-mesboot) - ("kernel-headers" ,%bootstrap-linux-libre-headers) ("make" ,make-mesboot))) (arguments `(#:validate-runpath? #f @@ -1318,34 +1240,7 @@ exec " gcc "/bin/" program "--disable-libstdcxx-pch" ;; for libcpp ... - "--disable-build-with-cxx"))) - ((#:phases phases) - `(modify-phases ,phases - (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.7.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "CPLUS_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.7.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - #t)))))))))) + "--disable-build-with-cxx")))))))) (define gcc-mesboot-wrapper ;; We need this so gcc-mesboot can be used to create shared binaries that -- 2.25.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 01:17:08 2020 Received: (at 39414) by debbugs.gnu.org; 6 Feb 2020 06:17:08 +0000 Received: from localhost ([127.0.0.1]:47018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izaTM-0004TE-16 for submit@debbugs.gnu.org; Thu, 06 Feb 2020 01:17:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izaTJ-0004Sf-Lx for 39414@debbugs.gnu.org; Thu, 06 Feb 2020 01:17:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izaTD-0003QS-84; Thu, 06 Feb 2020 01:16:59 -0500 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=40754 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1izaTC-0002io-S6; Thu, 06 Feb 2020 01:16:59 -0500 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH 1/2] gnu: commencement: Avoid hard-coded GCC version numbers. Organization: AvatarAcademy.nl References: <20200204130042.27757-1-ludo@gnu.org> X-Url: http://AvatarAcademy.nl Date: Thu, 06 Feb 2020 07:16:54 +0100 In-Reply-To: <20200204130042.27757-1-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cou\?\= \=\?utf-8\?Q\?rt\=C3\=A8s\=22's\?\= message of "Tue, 4 Feb 2020 14:00:41 +0100") Message-ID: <875zgk5jft.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: 39414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Ludovic Court=C3=A8s writes: > * gnu/packages/commencement.scm (gcc-mesboot1, gcc-mesboot): Use > 'package-version' instead of hard-coding the version number. Makes sense, LGTM. janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 01:25:49 2020 Received: (at 39414) by debbugs.gnu.org; 6 Feb 2020 06:25:49 +0000 Received: from localhost ([127.0.0.1]:47028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izabl-0004g3-8y for submit@debbugs.gnu.org; Thu, 06 Feb 2020 01:25:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izabk-0004fr-7B for 39414@debbugs.gnu.org; Thu, 06 Feb 2020 01:25:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izabf-0000HZ-2P; Thu, 06 Feb 2020 01:25:43 -0500 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=40756 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1izabX-0003Ig-JM; Thu, 06 Feb 2020 01:25:36 -0500 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH 2/2] gnu: commencement: Rationalize search path handling. Organization: AvatarAcademy.nl References: <20200204130042.27757-1-ludo@gnu.org> <20200204130042.27757-2-ludo@gnu.org> X-Url: http://AvatarAcademy.nl Date: Thu, 06 Feb 2020 07:25:33 +0100 In-Reply-To: <20200204130042.27757-2-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cou\?\= \=\?utf-8\?Q\?rt\=C3\=A8s\=22's\?\= message of "Tue, 4 Feb 2020 14:00:42 +0100") Message-ID: <871rr85j1e.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: 39414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Ludovic Court=C3=A8s writes: > This commit ensures that only packages that correspond to compilers have > a search path set. It also reduces manual handling of search path > environment variables. Beautiful, thank you! > (native-inputs `(("binutils" ,binutils-mesboot0) > - ("gcc" ,gcc-core-mesboot) > + > + ;; GCC-CORE-MESBOOT must appear last because it also > + ;; provides libc headers from Mes that we want to s= hadow > + ;; with those of GLIBC-MESBOOT0. > ("libc" ,glibc-mesboot0) > + ("kernel-headers" ,%bootstrap-linux-libre-headers) > + ("gcc" ,gcc-core-mesboot) >=20=20 > ("bash" ,%bootstrap-coreutils&co) > ("coreutils" ,%bootstrap-coreutils&co) > ("diffutils" ,diffutils-mesboot) > - ("kernel-headers" ,%bootstrap-linux-libre-headers) > ("make" ,make-mesboot0))) Here it gets real interesting; it seems above you actually fix (or work around?) a bug that allowed you to... > (arguments > (substitute-keyword-arguments (package-arguments gcc-core-mesboot) > ((#:phases phases) > `(modify-phases ,phases > (replace 'setenv > - (lambda* (#:key outputs #:allow-other-keys) > - (let ((out (assoc-ref outputs "out")) > - (bash (assoc-ref %build-inputs "bash")) > - (gcc (assoc-ref %build-inputs "gcc")) > - (glibc (assoc-ref %build-inputs "libc")) > - (kernel-headers (assoc-ref %build-inputs "kernel-he= aders"))) > - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) > - (format (current-error-port) "C_INCLUDE_PATH=3D~a\n" (g= etenv "C_INCLUDE_PATH")) > - (setenv "C_INCLUDE_PATH" (string-append > - gcc "/lib/gcc-lib/i686-unknow= n-linux-gnu/2.95.3/include" > - ":" kernel-headers "/include" > - ":" glibc "/include")) > - (format (current-error-port) "C_INCLUDE_PATH=3D~a\n" (g= etenv "C_INCLUDE_PATH")) > - (format (current-error-port) "LIBRARY_PATH=3D~a\n" (get= env "LIBRARY_PATH")) > - ;; FIXME: add glibc dirs to paths manually > - (setenv "LIBRARY_PATH" (string-join > - (list (string-append glibc "/li= b") > - (getenv "LIBRARY_PATH")) > - ":")) > - (format (current-error-port) "LIBRARY_PATH=3D~a\n" (get= env "LIBRARY_PATH")) > - (with-output-to-file "config.cache" > - (lambda _ > - (display " > + (lambda _ > + (setenv "CONFIG_SHELL" (which "sh")) > + (with-output-to-file "config.cache" > + (lambda _ > + (display " > ac_cv_c_float_format=3D'IEEE (little-endian)' > "))) > - #t))) > + #t)) remove this monster. Although I am especially happy with it, I am unsure exactly how it works. > - (lambda* (#:key outputs #:allow-other-keys) > - (let* ((out (assoc-ref outputs "out")) > - (binutils (assoc-ref %build-inputs "binutils")) > - (bash (assoc-ref %build-inputs "bash")) > - (gcc (assoc-ref %build-inputs "gcc")) > - (glibc (assoc-ref %build-inputs "libc")) > - (kernel-headers (assoc-ref %build-inputs "kernel-h= eaders"))) > - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) > - (setenv "C_INCLUDE_PATH" (string-append > - gcc "/lib/gcc-lib/i686-unknow= n-linux-gnu/2.95.3/include" > - ":" kernel-headers "/include" > - ":" glibc "/include" > - ":" (getcwd) "/mpfr/src")) > - (setenv "LIBRARY_PATH" (string-append glibc "/lib" > - ":" gcc "/lib")) > - (format (current-error-port) "C_INCLUDE_PATH=3D~a\n" (g= etenv "C_INCLUDE_PATH")) > - (format (current-error-port) "LIBRARY_PATH=3D~a\n" (get= env "LIBRARY_PATH")) > - #t))) > + (lambda _ > + (setenv "CONFIG_SHELL" (which "sh")) > + > + ;; Allow MPFR headers to be found. > + (setenv "C_INCLUDE_PATH" > + (string-append (getcwd) "/mpfr/src:" > + (getenv "C_INCLUDE_PATH"))) > + > + ;; Set the C++ search path so that C headers can be found= as > + ;; libstdc++ is being compiled. > + (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")) > + #t)) Similar here, > - "--disable-build-with-cxx"))) > - ((#:phases phases) > - `(modify-phases ,phases > - (replace 'setenv > - (lambda* (#:key outputs #:allow-other-keys) > - (let* ((out (assoc-ref outputs "out")) > - (binutils (assoc-ref %build-inputs "binutils")) > - (bash (assoc-ref %build-inputs "bash")) > - (gcc (assoc-ref %build-inputs "gcc")) > - (glibc (assoc-ref %build-inputs "libc")) > - (kernel-headers (assoc-ref %build-inputs "kern= el-headers"))) > - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh= ")) > - (setenv "C_INCLUDE_PATH" (string-append > - gcc "/lib/gcc-lib/i686-un= known-linux-gnu/4.7.4/include" > - ":" kernel-headers "/incl= ude" > - ":" glibc "/include" > - ":" (getcwd) "/mpfr/src")) > - (setenv "CPLUS_INCLUDE_PATH" (string-append > - gcc "/lib/gcc-lib/i68= 6-unknown-linux-gnu/4.7.4/include" > - ":" kernel-headers "/= include" > - ":" glibc "/include" > - ":" (getcwd) "/mpfr/s= rc")) > - (setenv "LIBRARY_PATH" (string-append glibc "/lib" > - ":" gcc "/lib= ")) > - (format (current-error-port) "C_INCLUDE_PATH=3D~a\n= " (getenv "C_INCLUDE_PATH")) > - (format (current-error-port) "CPLUS_INCLUDE_PATH=3D= ~a\n" (getenv "CPLUS_INCLUDE_PATH")) > - (format (current-error-port) "LIBRARY_PATH=3D~a\n" = (getenv "LIBRARY_PATH")) > - #t)))))))))) > + "--disable-build-with-cxx")))))))) and same here. I tried your commit and it works for me. Rebasing `wip-bootstrap' onto it was some work as you might imagine. The good news is that I finally got it to "work" again (`wip-bootstrap' @ gitlab); the bad news is that I have kept (or put back, actually) one of these 'setenv phases in `gcc-mesboot0'. Well, that's for later worry; so this will need another look when merging the scheme-only "wip-bootsrap". For this patch: LVGTM (looks /very/ good to me!). Thank you! janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 01:39:11 2020 Received: (at 39414) by debbugs.gnu.org; 6 Feb 2020 06:39:11 +0000 Received: from localhost ([127.0.0.1]:47032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izaog-00053n-M2 for submit@debbugs.gnu.org; Thu, 06 Feb 2020 01:39:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izaof-00053b-AG for 39414@debbugs.gnu.org; Thu, 06 Feb 2020 01:39:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izaoa-0000HR-2E; Thu, 06 Feb 2020 01:39:04 -0500 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=40758 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1izaoZ-00077R-IF; Thu, 06 Feb 2020 01:39:03 -0500 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#39414] [PATCH core-updates 0/2] Clarify search path handling in commencement.scm Organization: AvatarAcademy.nl References: <20200204125314.27494-1-ludo@gnu.org> X-Url: http://AvatarAcademy.nl Date: Thu, 06 Feb 2020 07:39:00 +0100 In-Reply-To: <20200204125314.27494-1-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cou\?\= \=\?utf-8\?Q\?rt\=C3\=A8s\=22's\?\= message of "Tue, 4 Feb 2020 13:53:14 +0100") Message-ID: <87wo9043uj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: 39414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Ludovic Court=C3=A8s writes: Hello Ludo', > The patch below for current =E2=80=98core-updates=E2=80=99 is an attempt = to clarify > search path handling in commencement.scm by: (Weird, this initial mail got sorted into a new debbugs-submit folder, only found it later) > 1. Having =E2=80=98native-search-paths=E2=80=99 fields only for compile= rs=E2=80=94e.g., > =E2=80=9CC_INCLUDE_PATH=E2=80=9D belongs to the compiler, not to lib= c. > > 2. Avoiding phases that manually fiddle with search path > environment variables: normally, this is handled automatically > by the =E2=80=98set-paths=E2=80=99 phase based on the declared searc= h paths, > so manual fiddling should be a last resort and it should be > well commented so we remember why it=E2=80=99s there. > > This is an attempt to reduce complexity and keep things declarative > as much as possible. I=E2=80=99ve tested it on top of > 46312064de8ae0cca531fddbc4b5ec8421e5d866 and =E2=80=9Cguix build coreutil= s=E2=80=9D > succeeds. Very nice, thank you. I was happy to get it to build and did not imagine all this fiddling could actually be workarounds that could (should!) all be removed. Not only will this help readability and maintenance, it will make porting this to other distributions (NixOS) a lot easier too. > There=E2=80=99s another pattern that I found hard to follow that has to do > with the reuse of build phases. > > For example, there=E2=80=99s a build phase named =E2=80=98setenv=E2=80=99= (perhaps we should > find a more descriptive name :-)) in the various GCCs that is reused > or replaced; when looking at a specific package, it=E2=80=99s difficult to > see which phases it really runs because this particular phase is > inherited and modified on several layers. If I can make time for it, > I=E2=80=99ll see if I can come up with a proposal to clarify this, but at= any > rate, it=E2=80=99s probably something to keep in mind for future changes. > > Thoughts? (I=E2=80=99m particularly interested in your feedback, janneke= !) Yes, I agree. A first step could be to use better names and possibly split it up into serveral stages: set-configure-shells, set-cc-paths? Doing this will probably only need overriding the set-cc-paths. I'm not sure how to make the inherit+replace issue more obvious but it has been biting me and annoying me too. Maybe when we get into this replace trickery it is better to not reuse parent's stages at all > (arguments > (substitute-keyword-arguments (package-arguments gcc-core-mesboot) but fully rewrite (arguments ...)? I haven't looked into the consequences. In any case, with patch it has gotten a lot better already, thank you! janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 09:22:47 2020 Received: (at 39414) by debbugs.gnu.org; 6 Feb 2020 14:22:47 +0000 Received: from localhost ([127.0.0.1]:47187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izi3K-00034q-I0 for submit@debbugs.gnu.org; Thu, 06 Feb 2020 09:22:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izi3J-00034e-0U for 39414@debbugs.gnu.org; Thu, 06 Feb 2020 09:22:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izi3D-0004LW-SO; Thu, 06 Feb 2020 09:22:39 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=55912 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1izi3D-0008Cn-Fv; Thu, 06 Feb 2020 09:22:39 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jan Nieuwenhuizen Subject: Re: [PATCH 2/2] gnu: commencement: Rationalize search path handling. References: <20200204130042.27757-1-ludo@gnu.org> <20200204130042.27757-2-ludo@gnu.org> <871rr85j1e.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 =?utf-8?Q?Pluvi=C3=B4se?= an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 06 Feb 2020 15:22:37 +0100 In-Reply-To: <871rr85j1e.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Thu, 06 Feb 2020 07:25:33 +0100") Message-ID: <87zhdv7q36.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: 39414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello! :-) Jan Nieuwenhuizen skribis: >> (native-inputs `(("binutils" ,binutils-mesboot0) >> - ("gcc" ,gcc-core-mesboot) >> + >> + ;; GCC-CORE-MESBOOT must appear last because it al= so >> + ;; provides libc headers from Mes that we want to = shadow >> + ;; with those of GLIBC-MESBOOT0. >> ("libc" ,glibc-mesboot0) >> + ("kernel-headers" ,%bootstrap-linux-libre-headers) >> + ("gcc" ,gcc-core-mesboot) >>=20=20 >> ("bash" ,%bootstrap-coreutils&co) >> ("coreutils" ,%bootstrap-coreutils&co) >> ("diffutils" ,diffutils-mesboot) >> - ("kernel-headers" ,%bootstrap-linux-libre-headers) >> ("make" ,make-mesboot0))) > > Here it gets real interesting; it seems above you actually fix (or work > around?) a bug that allowed you to... [...] >> - (setenv "C_INCLUDE_PATH" (string-append >> - gcc "/lib/gcc-lib/i686-unkno= wn-linux-gnu/2.95.3/include" >> - ":" kernel-headers "/include" >> - ":" glibc "/include")) >> - (format (current-error-port) "C_INCLUDE_PATH=3D~a\n" (= getenv "C_INCLUDE_PATH")) >> - (format (current-error-port) "LIBRARY_PATH=3D~a\n" (ge= tenv "LIBRARY_PATH")) >> - ;; FIXME: add glibc dirs to paths manually >> - (setenv "LIBRARY_PATH" (string-join >> - (list (string-append glibc "/l= ib") >> - (getenv "LIBRARY_PATH")) >> - ":")) >> - (format (current-error-port) "LIBRARY_PATH=3D~a\n" (ge= tenv "LIBRARY_PATH")) >> - (with-output-to-file "config.cache" >> - (lambda _ >> - (display " >> + (lambda _ >> + (setenv "CONFIG_SHELL" (which "sh")) >> + (with-output-to-file "config.cache" >> + (lambda _ >> + (display " >> ac_cv_c_float_format=3D'IEEE (little-endian)' >> "))) >> - #t))) >> + #t)) > > remove this monster. Although I am especially happy with it, I am > unsure exactly how it works. I analyzed what the monster does: it constructs *PATH exactly like the search path machinery would do. The big difference I noticed was that it excluded =E2=80=98gcc-core-mesboot=E2=80=99 from the search path. I und= erstood this was because =E2=80=98gcc-core-mesboot=E2=80=99 contained libc headers (from= Mes) and we didn=E2=80=99t want them to shadow glibc headers. So I first moved =E2=80=98gcc-core-mesboot=E2=80=99 down in the ordering, b= ut then found out that we could just remove the include/ directory from =E2=80=98gcc-core-mesboot=E2=80=99 altogether, which I did. (I=E2=80=99ll fix the comment that says that =E2=80=98gcc-core-mesboot=E2= =80=99 provides libc headers from Mes because that=E2=80=99s no longer the case.) >> - (setenv "C_INCLUDE_PATH" (string-append >> - gcc "/lib/gcc-lib/i686-unkno= wn-linux-gnu/2.95.3/include" >> - ":" kernel-headers "/include" >> - ":" glibc "/include" >> - ":" (getcwd) "/mpfr/src")) >> - (setenv "LIBRARY_PATH" (string-append glibc "/lib" >> - ":" gcc "/lib")) >> - (format (current-error-port) "C_INCLUDE_PATH=3D~a\n" (= getenv "C_INCLUDE_PATH")) >> - (format (current-error-port) "LIBRARY_PATH=3D~a\n" (ge= tenv "LIBRARY_PATH")) >> - #t))) >> + (lambda _ >> + (setenv "CONFIG_SHELL" (which "sh")) >> + >> + ;; Allow MPFR headers to be found. >> + (setenv "C_INCLUDE_PATH" >> + (string-append (getcwd) "/mpfr/src:" >> + (getenv "C_INCLUDE_PATH"))) >> + >> + ;; Set the C++ search path so that C headers can be foun= d as >> + ;; libstdc++ is being compiled. >> + (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")) >> + #t)) > > Similar here, Here I found that the only difference was adding =E2=80=9Cmpfr/src=E2=80=9D= to =E2=80=98C_INCLUDE_PATH=E2=80=99. >> - (setenv "C_INCLUDE_PATH" (string-append >> - gcc "/lib/gcc-lib/i686-u= nknown-linux-gnu/4.7.4/include" >> - ":" kernel-headers "/inc= lude" >> - ":" glibc "/include" >> - ":" (getcwd) "/mpfr/src"= )) >> - (setenv "CPLUS_INCLUDE_PATH" (string-append >> - gcc "/lib/gcc-lib/i6= 86-unknown-linux-gnu/4.7.4/include" >> - ":" kernel-headers "= /include" >> - ":" glibc "/include" >> - ":" (getcwd) "/mpfr/= src")) >> - (setenv "LIBRARY_PATH" (string-append glibc "/lib" >> - ":" gcc "/li= b")) >> - (format (current-error-port) "C_INCLUDE_PATH=3D~a\= n" (getenv "C_INCLUDE_PATH")) >> - (format (current-error-port) "CPLUS_INCLUDE_PATH= =3D~a\n" (getenv "CPLUS_INCLUDE_PATH")) >> - (format (current-error-port) "LIBRARY_PATH=3D~a\n"= (getenv "LIBRARY_PATH")) >> - #t)))))))))) >> + "--disable-build-with-cxx")))))))) > > and same here. Same story. > I tried your commit and it works for me. Rebasing `wip-bootstrap' onto > it was some work as you might imagine. The good news is that I finally > got it to "work" again (`wip-bootstrap' @ gitlab); the bad news is > that I have kept (or put back, actually) one of these 'setenv phases in > `gcc-mesboot0'. Well, that's for later worry; so this will need another > look when merging the scheme-only "wip-bootsrap". Yes, we=E2=80=99ll have to see what can be done to not put these phases bac= k in. My approach was to start by looking at what the =E2=80=98set-paths=E2=80=99= phase prints and see what was missing or incorrect in the values it computes. Thanks for testing & reviewing! I=E2=80=99ll push shortly. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 09:26:20 2020 Received: (at 39414) by debbugs.gnu.org; 6 Feb 2020 14:26:20 +0000 Received: from localhost ([127.0.0.1]:47191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izi6l-0003AG-QN for submit@debbugs.gnu.org; Thu, 06 Feb 2020 09:26:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izi6j-0003A4-Tx for 39414@debbugs.gnu.org; Thu, 06 Feb 2020 09:26:18 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izi6d-0003ah-K4; Thu, 06 Feb 2020 09:26:11 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=55914 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1izi6S-0000DV-Cd; Thu, 06 Feb 2020 09:26:10 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jan Nieuwenhuizen Subject: Re: [bug#39414] [PATCH core-updates 0/2] Clarify search path handling in commencement.scm References: <20200204125314.27494-1-ludo@gnu.org> <87wo9043uj.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 =?utf-8?Q?Pluvi=C3=B4se?= an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 06 Feb 2020 15:25:58 +0100 In-Reply-To: <87wo9043uj.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Thu, 06 Feb 2020 07:39:00 +0100") Message-ID: <87r1z77pxl.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414 Cc: 39414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Jan Nieuwenhuizen skribis: >> 1. Having =E2=80=98native-search-paths=E2=80=99 fields only for compil= ers=E2=80=94e.g., >> =E2=80=9CC_INCLUDE_PATH=E2=80=9D belongs to the compiler, not to li= bc. >> >> 2. Avoiding phases that manually fiddle with search path >> environment variables: normally, this is handled automatically >> by the =E2=80=98set-paths=E2=80=99 phase based on the declared sear= ch paths, >> so manual fiddling should be a last resort and it should be >> well commented so we remember why it=E2=80=99s there. >> >> This is an attempt to reduce complexity and keep things declarative >> as much as possible. I=E2=80=99ve tested it on top of >> 46312064de8ae0cca531fddbc4b5ec8421e5d866 and =E2=80=9Cguix build coreuti= ls=E2=80=9D >> succeeds. > > Very nice, thank you. I was happy to get it to build and did not > imagine all this fiddling could actually be workarounds that could > (should!) all be removed. Not only will this help readability and > maintenance, it will make porting this to other distributions (NixOS) a > lot easier too. Yes, I hope so! >> There=E2=80=99s another pattern that I found hard to follow that has to = do >> with the reuse of build phases. >> >> For example, there=E2=80=99s a build phase named =E2=80=98setenv=E2=80= =99 (perhaps we should >> find a more descriptive name :-)) in the various GCCs that is reused >> or replaced; when looking at a specific package, it=E2=80=99s difficult = to >> see which phases it really runs because this particular phase is >> inherited and modified on several layers. If I can make time for it, >> I=E2=80=99ll see if I can come up with a proposal to clarify this, but a= t any >> rate, it=E2=80=99s probably something to keep in mind for future changes. >> >> Thoughts? (I=E2=80=99m particularly interested in your feedback, jannek= e!) > > Yes, I agree. A first step could be to use better names and possibly > split it up into serveral stages: set-configure-shells, set-cc-paths? > > Doing this will probably only need overriding the set-cc-paths. I'm not > sure how to make the inherit+replace issue more obvious but it has > been biting me and annoying me too. Yes, I=E2=80=99m not sure exactly how to do it. > Maybe when we get into this replace trickery it is better to not reuse > parent's stages at all > >> (arguments >> (substitute-keyword-arguments (package-arguments gcc-core-mesboot) > > but fully rewrite (arguments ...)? Yes, either that or always inherit from the same package=E2=80=94e.g., alwa= ys inherit from =E2=80=98gcc=E2=80=99 instead of inheriting from =E2=80=98gcc-= mesboot1=E2=80=99, which inherits from =E2=80=98gcc-mesboot0=E2=80=99, and so on. That way one does= n=E2=80=99t have to walk the inheritance chain to understand what the phases are. Another option is to also make the interesting phases generic enough that we don=E2=80=99t have to modify them in package variants. We=E2=80=99ll see! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 12:48:23 2020 Received: (at 39414-done) by debbugs.gnu.org; 6 Feb 2020 17:48:23 +0000 Received: from localhost ([127.0.0.1]:48375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izlGI-0008CL-RU for submit@debbugs.gnu.org; Thu, 06 Feb 2020 12:48:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izlGH-0008C8-0G for 39414-done@debbugs.gnu.org; Thu, 06 Feb 2020 12:48:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izlGB-0004xA-Qt; Thu, 06 Feb 2020 12:48:15 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=34010 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1izlGB-0000wd-Bi; Thu, 06 Feb 2020 12:48:15 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jan Nieuwenhuizen Subject: Re: [bug#39414] [PATCH 2/2] gnu: commencement: Rationalize search path handling. References: <20200204130042.27757-1-ludo@gnu.org> <20200204130042.27757-2-ludo@gnu.org> <871rr85j1e.fsf@gnu.org> <87zhdv7q36.fsf@gnu.org> Date: Thu, 06 Feb 2020 18:48:11 +0100 In-Reply-To: <87zhdv7q36.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 06 Feb 2020 15:22:37 +0100") Message-ID: <87y2tf6204.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39414-done Cc: 39414-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Pushed as 558b0bbe291b2f2cd38b7f4eadc827e2ed102c54! Ludo'. From unknown Fri Jun 13 10:43:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 06 Mar 2020 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator