From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: Erroneous uses of regex in the invokation of FIND-FILES Date: Sat, 21 Sep 2019 05:31:11 +0900 Message-ID: <877e627lrk.fsf@gmail.com> References: <864l29iki4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44126) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBPYk-0001PV-Bj for guix-devel@gnu.org; Fri, 20 Sep 2019 16:31:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBPYj-0003Hf-7k for guix-devel@gnu.org; Fri, 20 Sep 2019 16:31:18 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44607) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBPYj-0003HL-0a for guix-devel@gnu.org; Fri, 20 Sep 2019 16:31:17 -0400 Received: by mail-pf1-x444.google.com with SMTP id q21so5240231pfn.11 for ; Fri, 20 Sep 2019 13:31:16 -0700 (PDT) In-Reply-To: <864l29iki4.fsf@gmail.com> (Alex Vong's message of "Thu, 22 Aug 2019 18:04:35 +0800") 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: Alex Vong Cc: guix-devel@gnu.org Hi again, Alex Vong writes: > Hello guix, > > I find out that there are a lof of erroneous uses of regex in the > invokation of FIND-FILES. The correct usage should be: > > (find-files "." "\\.c$") > > Instead people write: > > (find-files "." ".*\\.c") > > which match unwanted files. > > For examples, in the procedure CUSTOM-GCC, the correct regex should be: > > "(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)$" > > instead of: > > ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)" > > Please correct me if I am wrong. > > Right now, the erroneous use of regex in CUSTOM-GCC casues the 'bin/' > directory of the output of gccgo, gcc-objc and gcc-objc++ to be empty. Looking at this some more, I'm not sure what we expect to see in the bin/ directory of gcc-objc, As I found out earlier, the files present before any deletion are those: --8<---------------cut here---------------start------------->8--- c++ cpp g++ gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool x86_64-unknown-linux-gnu-c++ x86_64-unknown-linux-gnu-g++ x86_64-unknown-linux-gnu-gcc x86_64-unknown-linux-gnu-gcc-8.3.0 x86_64-unknown-linux-gnu-gcc-ar x86_64-unknown-linux-gnu-gcc-nm x86_64-unknown-linux-gnu-gcc-ranlib --8<---------------cut here---------------end--------------->8--- All of those files don't appear to be specific to gcc-objc (they are also part of regular gcc) and thus it appear that removing them fits the bill (the patch name says it exists to remove broken or conflicting files). The way that these GCC packages affect the GCC installation is by mean of extending the search path of the GCC libraries, e.g.: --8<---------------cut here---------------start------------->8--- (define-public gcc-objc-5 (custom-gcc gcc-5 "gcc-objc" '("objc") (list (search-path-specification (variable "OBJC_INCLUDE_PATH") (files '("include"))) (search-path-specification (variable "LIBRARY_PATH") (files '("lib" "lib64")))))) --8<---------------cut here---------------end--------------->8--- not by providing custom binaries. Here's the list of files of the regular gcc package: --8<---------------cut here---------------end--------------->8--- ls -l /gnu/store/ginrh3x6qi4w2i005gics37wzz5b78s7-gcc-5.5.0/bin total 9308 c++ cpp g++ gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool x86_64-unknown-linux-gnu-c++ x86_64-unknown-linux-gnu-g++ x86_64-unknown-linux-gnu-gcc x86_64-unknown-linux-gnu-gcc-5.5.0 x86_64-unknown-linux-gnu-gcc-ar x86_64-unknown-linux-gnu-gcc-nm x86_64-unknown-linux-gnu-gcc-ranlib --8<---------------cut here---------------end--------------->8--- It's confusing though that an empty bin directory is left behind. We could fix this. Maxim