all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: 宋文武 <iyzsong@member.fsf.org>
Cc: guix-devel@gnu.org
Subject: Re: gnome-tweak-tool tweaks
Date: Sun, 12 Jun 2016 21:42:44 +0200	[thread overview]
Message-ID: <871t42kxcb.fsf@gnu.org> (raw)
In-Reply-To: <87y46cpeq4.fsf@member.fsf.org> ("宋文武"'s message of "Sat, 11 Jun 2016 11:49:07 +0800")

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

iyzsong@member.fsf.org (宋文武) skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> [...]
>>
>>> I/O error : Permission denied
>>> I/O error : Permission denied
>>> Failed to write XML file; For permission problems, try rerunning as root
>>
>> I found that string comes from ‘shared-mime-info’, which is itself used
>> by the ‘xdg-mime-database’ hook in (guix profiles) (a hook that runs
>> when the profile is created to update the MIME database):
>>
>> static gboolean save_xml_file(xmlDocPtr doc, const gchar *filename, GError **error)
>> {
>> #if LIBXML_VERSION > 20400
>> 	if (xmlSaveFormatFileEnc(filename, doc, "utf-8", 1) < 0)
>> 	{
>> 		g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
>> 			    "Failed to write XML file; For permission problems, try rerunning as root");
>> 		return FALSE;
>> 	}
>> #else
>>
>> 宋文武: any idea what the problem might be?  Perhaps
>> ‘update-mime-database’ is trying to write to /gnu/store/…-something?
> Yep, it happends when '$out/share/mime/application' is not writable.
> The xml files under 'application' are going to be generated by
> update-mime-database, and the shared-mime-info package has it
> pre-generated, so after union "share/mime", an un-writable 'application'
> directory point to the store will cause the problem.
>
> Commit 359f06aa fix this by union the "share/mime/packages" directory.

OK, thanks for the quick (brown?) fix!

>> Also, it’s a problem that ‘update-mime-database’ returns 0 here, as
>> seems to be the case.
> It returns 256 here for the problem, but the derivation still built and
> profile got updated, I have no idea about this :-
>
> Does a failing hook (returns #f) supposed to top the profile update?

I thought it did, but it doesn’t:

  (gexp->derivation "foo" #~(begin (mkdir #$output) #f))

leads a derivation that succeeds, contrary to
‘build-expression->derivation’.

To avoid that, we need an explicit (exit #f).

For now I prefer to address it at every call site (patch below) instead
of adding some magic to ‘gexp->derivation’, which would be hard to do in
a hygienic way.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1896 bytes --]

--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -510,9 +510,9 @@ MANIFEST."
                     info (string-append #$output "/share/info/dir"))))
 
         (mkdir-p (string-append #$output "/share/info"))
-        (every install-info
+        (exit (every install-info
                      (append-map info-files
-                           '#$(manifest-inputs manifest)))))
+                                 '#$(manifest-inputs manifest))))))
 
   (gexp->derivation "info-dir" build
                     #:modules '((guix build utils))
@@ -562,7 +562,7 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages."
                 (system* (string-append #+ghc "/bin/ghc-pkg") "recache"
                          (string-append "--package-db=" db-dir)))))
           (for-each delete-file (find-files db-dir "\\.conf$"))
-          success)))
+          (exit success))))
 
   (with-monad %store-monad
     ;; Don't depend on GHC when there's nothing to do.
@@ -710,7 +710,7 @@ MIME type."
             (mkdir-p (string-append #$output "/share"))
             (union-build destdir appdirs
                          #:log-port (%make-void-port "w"))
-            (zero? (system* update-desktop-database destdir)))))
+            (exit (zero? (system* update-desktop-database destdir))))))
 
     ;; Don't run the hook when 'desktop-file-utils' is not referenced.
     (if desktop-file-utils
@@ -745,7 +745,7 @@ entries.  It's used to query the MIME type of a given file."
             (union-build (string-append destdir "/packages") pkgdirs
                          #:log-port (%make-void-port "w"))
             (setenv "XDG_DATA_HOME" datadir)
-            (zero? (system* update-mime-database destdir)))))
+            (exit (zero? (system* update-mime-database destdir))))))
 
     ;; Don't run the hook when 'shared-mime-info' is referenced.
     (if shared-mime-info

  reply	other threads:[~2016-06-12 19:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06  6:09 gnome-tweak-tool tweaks Jan Nieuwenhuizen
2016-06-10 12:24 ` Ludovic Courtès
2016-06-11  3:49   ` 宋文武
2016-06-12 19:42     ` Ludovic Courtès [this message]
2016-06-11  7:21   ` Jan Nieuwenhuizen
2016-06-12 20:21     ` Ludovic Courtès
2016-06-12 21:18       ` Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871t42kxcb.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=iyzsong@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.