Shepherd and the --silent option

2024-08-15 Thread Dariqq

Hi Guix,

Lately I've been a bit annoyed by messages from the home shepherd when 
logging in trough a tty.


The shepherd help output advertises --silent/--quiet options to not 
output to stdout but looking through the shepherd repository this 
options are doing nothing.


The other day I was able to hack something together which from limited 
testing seems to make those options work (with a corresponding patch to 
add --silent to the home-shepherd launch script). I have attached my 
surprisingly simple diff (which applies on top of devel branch).


It was not clear to me weather boolean variables should be suffixed 
wirth "?". When it got removed in [1] a long time ago it was unsuffixed.


I have tested the patched devel shepherd and a similar diff on top of 
0.10.5 and seems to work as I expect it: The output to stdout is no 
longer there but still available in the shepherd log file.


Slightly related I noticed an issue with the devel shepherd invoked via 
guix home not daemonizing blocking my login manager.


I hope this useful for someone else as well.
Dariqq

[1] 
https://git.savannah.gnu.org/cgit/shepherd.git/commit/?id=e86cfe28c14d734fe917e4935d72e7ad2cc9b299diff --git a/doc/shepherd.texi b/doc/shepherd.texi
index 6051ffa..52bd526 100644
--- a/doc/shepherd.texi
+++ b/doc/shepherd.texi
@@ -493,6 +493,10 @@ If @code{-} is specified as file name, commands will be read from
 standard input, one per line, as would be passed on a @command{herd}
 command line (@pxref{Invoking herd}).
 
+@item -S
+@itemx --silent
+Don't do output to stdout.
+
 @item --quiet
 Synonym for @code{--silent}.
 
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 8f1d727..7e8c68c 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -384,6 +384,7 @@ (define (main . args)
 	(socket-file default-socket-file)
 (pid-file#f)
 (secure  #t)
+(silent? #f)
 (logfile #f))
 ;; Process command line arguments.
 (process-args (program-name) args
@@ -395,15 +396,13 @@ (define (main . args)
 		#:takes-argument? #f
 		#:description (l10n "synonym for --silent")
 		#:action (lambda ()
-   ;; XXX: Currently has no effect.
-   #t))
+   (set! silent? #t)))
 		  (option
 		#:long-name "silent" #:short-name #\S
 		#:takes-argument? #f
 		#:description (l10n "don't do output to stdout")
 		#:action (lambda ()
-   ;; XXX: Currently has no effect.
-   #t))
+   (set! silent? #t)))
 		  (option
 		;; It might actually be desirable to have an
 		;; ``insecure'' setup in some circumstances, thus
@@ -469,7 +468,7 @@ (define (main . args)
(%current-service-output-port
 ;; Send output to log and clients.
 (make-shepherd-output-port
- (if syslog?
+ (if (or silent? syslog?)
  ;; By default we'd write both to /dev/log and to
  ;; stdout.  Redirect stdout to the bitbucket so we
  ;; don't log twice.


Re: Cookbook recipe from "The Repository as a Channel" section does not work for Guix with properly configured GUILE_LOAD_PATH

2024-08-15 Thread Nigko Yerden

Hello Attila Lendvai,

Thank you very much for your hints and references! Indeed I was puzzled by
weird behavior of 'current-filename'. I wrote another alternative
using '(module-filename (current-module))' based on
https://issues.guix.gnu.org/55464
See alt2 branch  of [1].

This variant does not need wrapping directory for the package file, and
has the same file structure as the main branch of [1]. The variable

(define package-dir
  (dirname
   (canonicalize-path
(search-path %load-path
 (module-filename (current-module))

is bounded to the current directory of 'test-repo-package.scm', so
the 'source' field of the package is

(local-file (string-append package-dir "/../..")
"test-repo-checkout"
#:recursive? #t
#:select? vcs-file?))

It seems to work even without macro wrapper.

Regards,
Nigko

[1] https://gitlab.com/anigko/test-channel.git



Re: Proposal: nss updates

2024-08-15 Thread Ian Eure



Maxim Cournoyer  writes:


Hi,

Ian Eure  writes:


Felix Lechner  writes:


Hi Ian,

On Mon, Jul 01 2024, Ian Eure wrote:


if you have strong feelings about -next vs. -latest


How about nss-rapid?  It provides the clue about what was 
packaged

to
someone who knows libnss.



I like it.  I’ll update the package descriptions to make this 
clear as

well.


Thanks for the explanations regarding the ESR and rapid release 
channels
of distribution for NSS.  I don't feel strongly about it, but 
the
'-latest' prefix is a bit easier to grok for someone not 
acquainted with

libnss.


I don’t have a strong preference either way, but lean towards 
calling it -rapid, as it matches the upstream terminology.  The 
package descriptions can disambiguate this, ex. adding "(ESR)" or 
similar to nss.


The recent 3.101.1 NSS release is an ESR, per the relesae 
notes[1].  What’s the process for getting that update into Guix? 
Since it’ll cause many rebuilds, it needs to go into a branch 
first.  core-updates seems like a reasonable place for it -- do I 
just send a patch and use prose to indicate that it should land in 
core-updates instead of master?  Or if I perform the work on the 
core-updates branch, do the patches indicate that when emailed?


Thanks,

 — Ian

[1]: 
https://firefox-source-docs.mozilla.org/security/nss/releases/nss_3_101_1.html