From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix some failing tests in BSD systems Date: Mon, 4 Jan 2021 19:10:07 +0200 Message-ID: <6e35988f-fdf0-5384-1aaa-e8e21effead9@yandex.ru> References: <83a6tpdiuf.fsf@gnu.org> <5e881738-2df3-d5e3-9a46-bc4304ff4092@yandex.ru> <835z4dcrah.fsf@gnu.org> <5d574d90-34b1-0fb1-8b3a-83e7709eadfc@yandex.ru> <83pn2kbsy5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24125"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: emacs-devel@gnu.org, mardani29@yahoo.es To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 04 18:11:13 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwTNx-00065C-CU for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Jan 2021 18:11:13 +0100 Original-Received: from localhost ([::1]:58588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwTNw-0000MP-ES for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Jan 2021 12:11:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwTN0-00086C-Pr for emacs-devel@gnu.org; Mon, 04 Jan 2021 12:10:14 -0500 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:38789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwTMz-0001tp-9l; Mon, 04 Jan 2021 12:10:14 -0500 Original-Received: by mail-ej1-x635.google.com with SMTP id 6so37748761ejz.5; Mon, 04 Jan 2021 09:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=TIuSNm6C2oTIIy8UBw0xMYHtlS6q/GM2w7cBixBv9Ng=; b=GMDSt8129DvGUCmGwPcAWKdYUKej+rAcLUhxld63a7EWQwax/0sQwZs3rPut9J7if7 HUGrWkXs/dK5LNxyfKgQVMa4v+iz7f5jdF7oNqkaM05XZqmfRYhmOJuurQ1ebSPtpFuv pEknsA+mPDE5h6CGv3hLha/Rplq18k1eChoNmo7igH8fFasTgKu4vug51mablLbMg5ua g0ZKjSMr0CIdUYBTr8BynU8zRf1s4JAE/RFHppgh1sauhv2hOlNSkW2HGKoAbIgcsboB V88qEU/7qVmiiDULFDVIdcE6D+mM4moQyaKiquJkngmGbG6oCu1S2RLmL1T4ElPVXFFK Uu8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TIuSNm6C2oTIIy8UBw0xMYHtlS6q/GM2w7cBixBv9Ng=; b=JZFwzX/WjBIojTGt512d/sLZg7M2D42YMIAAOk64soVqjQPXK5lRK1/Eut+DT826HD ycwIaz22T18056tDeshBU0GDQqibLCvNDD5PLjRQQhLGE39KKcc9uc7tmfofQaFsCsK/ azdn2VNC6yFJp2kzjxri10V7oOmEp68R53EWzgK2Z5FprWONl7jx1lfNlWELke+bP92n IWO1bZfXgEP2jbWnwhRgrXgmm2Sc2vO2laxqDeJ5ABjFO6tPq+3UX3O9NbGFEE8BSyS7 MiAJdqiUYJgOag2/InUbGWA/87qzFhcYo5SZZCQZpDdK3FkBzqqwzZlZBb08iUk40SDG UqSQ== X-Gm-Message-State: AOAM532zt/Q64ilIpaiajA/cUmcCiN6RE8MIkAM8Er+1SgAVdPQTciw6 ixQcgWU0MjVHgwvJRotntRM/ot7xhIVQgw== X-Google-Smtp-Source: ABdhPJxC9yrnyjnqJfN6NbjAvuOjKM9FkRl8G76hffFKj3NlHPrLKPiwU8dRH9IHPHW0E9gNDyHOQg== X-Received: by 2002:a17:906:e58:: with SMTP id q24mr67717918eji.438.1609780211289; Mon, 04 Jan 2021 09:10:11 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k23sm23784408ejs.100.2021.01.04.09.10.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 09:10:10 -0800 (PST) In-Reply-To: <83pn2kbsy5.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=raaahh@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:262446 Archived-At: On 04.01.2021 17:52, Eli Zaretskii wrote: >> The changes you are referring to are both in the test code. There's >> nothing inherently wrong in using concat in such code, as long as we >> test what we want to test. > > There's nothing wrong with that, sure, but you risk false failures due > to issues like the one here. However, if you are okay with that, I > don't mind. It just was strange to see such code. It's a matter of the interpretation. For one, if I saw this behavior with GNU find (which is installed on my machine), I'd want to fix it rather than just update the test. No harm in doing that just for BSD find either. >> If you actually meant to suggest an alternative comparison strategy >> (like in Daniel's latest patch), then I think the test becomes >> unnecessarily lax. After all, we want to also check how the string >> "looks" (because the user will see it verbatim), not just what file it >> points at. > > I don't think you can reliably know how the file name will be > formatted by a particular variety of 'find', not IME. But I'm not > going to argue about this. I think we can try. The fact that we've only seen such a report now is a good indicator. So, Daniel, how does the patch below work for you? It should also fix the same behavior in dired-do-find-regexp. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d417382c0d..a87f054146 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -291,7 +291,8 @@ project--files-in-directory (localdir (file-local-name (expand-file-name dir))) (command (format "%s %s %s -type f %s -print0" find-program - localdir + ;; Omit the / for BSD find's sake. + (directory-file-name localdir) (xref--find-ignores-arguments ignores localdir) (if files (concat (shell-quote-argument "(") diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index d2b5acd555..32efc2807c 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1374,7 +1374,9 @@ xref-matches-in-directory ;; do that reliably enough, without creating false negatives? (command (xref--rgrep-command (xref--regexp-to-extended regexp) files - (file-local-name (expand-file-name dir)) + ;; Omit the / for BSD find's sake. + (directory-file-name + (file-local-name (expand-file-name dir))) ignores)) (def default-directory) (buf (get-buffer-create " *xref-grep*"))