unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37955: warning: '.desktop' file refers to '', which cannot be found
@ 2019-10-28  8:33 Pierre Neidhardt
  2021-04-09 10:56 ` Brendan Tildesley via Bug reports for GNU Guix
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2019-10-28  8:33 UTC (permalink / raw)
  To: 37955

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

Many packages report this (benign?) warning:

--8<---------------cut here---------------start------------->8---
starting phase `patch-dot-desktop-files'
adjusting 2 '.desktop' files in "/gnu/store/j8q725jv5my3gcqi1kgb2g99839xcbap-racket-7.3/share/applications"
warning: '.desktop' file refers to '', which cannot be found
...
--8<---------------cut here---------------end--------------->8---

Racket is one example.

The .desktop file is fine though, there is no empty string nor broken references.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2019-10-28  8:33 bug#37955: warning: '.desktop' file refers to '', which cannot be found Pierre Neidhardt
@ 2021-04-09 10:56 ` Brendan Tildesley via Bug reports for GNU Guix
  2021-04-09 11:23   ` Pierre Neidhardt
  2022-10-09  6:48 ` Brendan Tildesley
  2022-10-10 12:22 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2 siblings, 1 reply; 9+ messages in thread
From: Brendan Tildesley via Bug reports for GNU Guix @ 2021-04-09 10:56 UTC (permalink / raw)
  To: 37955@debbugs.gnu.org; +Cc: mail@ambrevar.xyz

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

The Exec paths in these files already refer to absolute paths, infact, /gnu/store paths
Thus the regex:

("^Exec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest)

with binary = empty string and rest = everything after Exec=

Why? The second subexpression [^/[:blank:]\r\n]* is bound to binary, but it means anything
that is a series of anything that is not /, space, or newline. absolute paths start with /, so it matches nothing (empty string), and continues to call (which "").


I notice this phase hasn't been edited in 5 years and has other issues, for example:

1. patch-dot-desktop-files only searches the output of the package for paths, not the inputs. This means for example xfce4-settings fails to patch references to exo-open in desktop files.

The code should be remade to be more /correct/, and handle all unexpected inputs. In this case the phase is accidentally doing the right thing by failing in a harmless way and correctly not patching the files, but emitting a warning.

[-- Attachment #2: Type: text/html, Size: 1947 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2021-04-09 10:56 ` Brendan Tildesley via Bug reports for GNU Guix
@ 2021-04-09 11:23   ` Pierre Neidhardt
  2021-04-09 11:53     ` Brendan Tildesley via Bug reports for GNU Guix
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2021-04-09 11:23 UTC (permalink / raw)
  To: Brendan Tildesley, 37955@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 63 bytes --]

Thanks for the investigation.  Would you like to send a patch?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2021-04-09 11:23   ` Pierre Neidhardt
@ 2021-04-09 11:53     ` Brendan Tildesley via Bug reports for GNU Guix
  2021-04-09 17:39       ` Pierre Neidhardt
  0 siblings, 1 reply; 9+ messages in thread
From: Brendan Tildesley via Bug reports for GNU Guix @ 2021-04-09 11:53 UTC (permalink / raw)
  To: 37955@debbugs.gnu.org; +Cc: Pierre Neidhardt

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]


> On 04/09/2021 1:23 PM Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> 
>  
> Thanks for the investigation.  Would you like to send a patch?

I'm not sure what the right way to fix it is. I may have come up with a brilliant idea. Untested patch attached.

[-- Attachment #2: 0001-build-gnu-build-system-Improve-patch-dot-desktop-fil.patch --]
[-- Type: text/x-patch, Size: 1595 bytes --]

From 64c200f3630de13ec3487cb5c756b47b133c6ecf Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Fri, 9 Apr 2021 21:43:54 +1000
Subject: [PATCH] build: gnu-build-system: Improve patch-dot-desktop-files.

* guix/build/gnu-build-system.scm (patch-dot-desktop-files):
When patching .desktop files, Exec= values beginning with '/', (or
spaces or newline characters) will result in the 'binary' symbol
matching an empty string. Changing *, meaning 0 or more, to +, meaning 1
or more ensures it will match a binary of atleast 1 length, or nothing.
---
 guix/build/gnu-build-system.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 2e7dff2034..99636c442a 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -725,9 +725,9 @@ which cannot be found~%"
                      ;; UTF-8-encoded.
                      (with-fluids ((%default-port-encoding "UTF-8"))
                        (substitute* files
-                         (("^Exec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest)
+                         (("^Exec=([^/[:blank:]\r\n]+)(.*)$" _ binary rest)
                           (string-append "Exec=" (which binary) rest))
-                         (("^TryExec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest)
+                         (("^TryExec=([^/[:blank:]\r\n]+)(.*)$" _ binary rest)
                           (string-append "TryExec="
                                          (which binary) rest)))))))))
             outputs)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2021-04-09 11:53     ` Brendan Tildesley via Bug reports for GNU Guix
@ 2021-04-09 17:39       ` Pierre Neidhardt
  2021-04-10  1:29         ` Brendan Tildesley via Bug reports for GNU Guix
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2021-04-09 17:39 UTC (permalink / raw)
  To: Brendan Tildesley, 37955@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

So if the path is already an absolute store path, then I suppose that
the whole phase is superfluous, isn't it?

Couldn't we just delete it?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2021-04-09 17:39       ` Pierre Neidhardt
@ 2021-04-10  1:29         ` Brendan Tildesley via Bug reports for GNU Guix
  2021-04-10  7:08           ` Pierre Neidhardt
  0 siblings, 1 reply; 9+ messages in thread
From: Brendan Tildesley via Bug reports for GNU Guix @ 2021-04-10  1:29 UTC (permalink / raw)
  To: 37955@debbugs.gnu.org; +Cc: Pierre Neidhardt


> On 04/09/2021 7:39 PM Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> 
>  
> So if the path is already an absolute store path, then I suppose that
> the whole phase is superfluous, isn't it?
> 
> Couldn't we just delete it?

Do you mean delete the phase entirely or just from Racket? It's not always the case that they are absolute paths. Racket probably just has some code to generate them automatically.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2021-04-10  1:29         ` Brendan Tildesley via Bug reports for GNU Guix
@ 2021-04-10  7:08           ` Pierre Neidhardt
  0 siblings, 0 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2021-04-10  7:08 UTC (permalink / raw)
  To: Brendan Tildesley, 37955@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

Brendan Tildesley <btild@mailbox.org> writes:

> Do you mean delete the phase entirely or just from Racket? It's not always the case that they are absolute paths. Racket probably just has some code to generate them automatically.

Good point!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2019-10-28  8:33 bug#37955: warning: '.desktop' file refers to '', which cannot be found Pierre Neidhardt
  2021-04-09 10:56 ` Brendan Tildesley via Bug reports for GNU Guix
@ 2022-10-09  6:48 ` Brendan Tildesley
  2022-10-10 12:22 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2 siblings, 0 replies; 9+ messages in thread
From: Brendan Tildesley @ 2022-10-09  6:48 UTC (permalink / raw)
  To: 37955, Pierre Neidhardt,


PING. Could the patch I sent get reviewed please? This would apply to
core-updates. It's been a while so I don't remember much about it myself
actually.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37955: warning: '.desktop' file refers to '', which cannot be found
  2019-10-28  8:33 bug#37955: warning: '.desktop' file refers to '', which cannot be found Pierre Neidhardt
  2021-04-09 10:56 ` Brendan Tildesley via Bug reports for GNU Guix
  2022-10-09  6:48 ` Brendan Tildesley
@ 2022-10-10 12:22 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2 siblings, 0 replies; 9+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2022-10-10 12:22 UTC (permalink / raw)
  To: 37955-done

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

I moved the informational background above the changelog and 
pushed this to c-u as 685110045c04a60bf18163aab1c230f944c871c9.

Thanks!

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-10 12:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28  8:33 bug#37955: warning: '.desktop' file refers to '', which cannot be found Pierre Neidhardt
2021-04-09 10:56 ` Brendan Tildesley via Bug reports for GNU Guix
2021-04-09 11:23   ` Pierre Neidhardt
2021-04-09 11:53     ` Brendan Tildesley via Bug reports for GNU Guix
2021-04-09 17:39       ` Pierre Neidhardt
2021-04-10  1:29         ` Brendan Tildesley via Bug reports for GNU Guix
2021-04-10  7:08           ` Pierre Neidhardt
2022-10-09  6:48 ` Brendan Tildesley
2022-10-10 12:22 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).