bug#37955: warning: '.desktop' file refers to '', which cannot be found

2022-10-10 Thread Tobias Geerinckx-Rice via Bug reports for GNU Guix
I moved the informational background above the changelog and 
pushed this to c-u as 685110045c04a60bf18163aab1c230f944c871c9.


Thanks!

T G-R


signature.asc
Description: PGP signature


bug#37955: warning: '.desktop' file refers to '', which cannot be found

2022-10-09 Thread Brendan Tildesley



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.






bug#37955: warning: '.desktop' file refers to '', which cannot be found

2021-04-10 Thread Pierre Neidhardt
Brendan Tildesley  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/


signature.asc
Description: PGP signature


bug#37955: warning: '.desktop' file refers to '', which cannot be found

2021-04-09 Thread Brendan Tildesley via Bug reports for GNU Guix


> On 04/09/2021 7:39 PM Pierre Neidhardt  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.





bug#37955: warning: '.desktop' file refers to '', which cannot be found

2021-04-09 Thread Pierre Neidhardt
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/


signature.asc
Description: PGP signature


bug#37955: warning: '.desktop' file refers to '', which cannot be found

2021-04-09 Thread Brendan Tildesley via Bug reports for GNU Guix

> On 04/09/2021 1:23 PM Pierre Neidhardt  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.From 64c200f3630de13ec3487cb5c756b47b133c6ecf Mon Sep 17 00:00:00 2001
From: Brendan Tildesley 
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



bug#37955: warning: '.desktop' file refers to '', which cannot be found

2021-04-09 Thread Pierre Neidhardt
Thanks for the investigation.  Would you like to send a patch?


signature.asc
Description: PGP signature


bug#37955: warning: '.desktop' file refers to '', which cannot be found

2021-04-09 Thread Brendan Tildesley via Bug reports for GNU Guix
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.