all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* core-updates: fonts-dir-builder fails
@ 2017-08-08 11:31 Ricardo Wurmus
  2017-08-08 14:07 ` Ricardo Wurmus
  2017-08-08 14:23 ` Danny Milosavljevic
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2017-08-08 11:31 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

I’m trying to install python-wrapper on core-updates:

--8<---------------cut here---------------start------------->8---
guix package -i python-wrapper
guix package: warning: Your Guix installation is 17 days old.
guix package: warning: Consider running 'guix pull' followed by
'guix package -u' to get up-to-date packages and security updates.

The following package will be installed:
   python-wrapper	3.5.3	/gnu/store/v4i3zfiwk6vl0mhdz580diqs0p6sc8vg-python-wrapper-3.5.3

The following derivations will be built:
   /gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv
   /gnu/store/z67djrjh1qkwjf5fyn1k2bzzklb8a6x4-gtk-icon-themes.drv
   /gnu/store/yw7yyw2dsigyl65vmmgigq50mk8l28qi-info-dir.drv
   /gnu/store/wrk9iiqlj4rhdhypsyjs4q6zc8yjk22z-gtk-im-modules.drv
   /gnu/store/c782skai641dhjkmfwhsi6wzh6m4h966-xdg-desktop-database.drv
   /gnu/store/921c4xby2clrimhmww4ky1m8kzhlvp9c-xdg-mime-database.drv
   /gnu/store/8j5bll1y0c3zrifrp984gd3gfarf0ra4-fonts-dir.drv
   /gnu/store/mlakmrr26ypn5ngchi7zjh90i6r6849b-manual-database.drv
Backtrace:
In ice-9/boot-9.scm:
 160: 14 [catch #t #<catch-closure 8c5e00> ...]
In unknown file:
   ?: 13 [apply-smob/1 #<catch-closure 8c5e00>]
In ice-9/boot-9.scm:
  66: 12 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 11 [eval # #]
In ice-9/boot-9.scm:
2412: 10 [save-module-excursion #<procedure 8e67c0 at ice-9/boot-9.scm:4084:3 ()>]
4089: 9 [#<procedure 8e67c0 at ice-9/boot-9.scm:4084:3 ()>]
1734: 8 [%start-stack load-stack #<procedure 8f6c60 at ice-9/boot-9.scm:4080:10 ()>]
1739: 7 [#<procedure 8f86c0 ()>]
In unknown file:
   ?: 6 [primitive-load "/gnu/store/k7nyk3yaxi4b9y184232x7i1anxfhrbb-fonts-dir-builder"]
In ice-9/boot-9.scm:
 778: 5 [for-each #<procedure 1b266c0 at ice-9/eval.scm:416:20 (a)> #]
In ice-9/r4rs.scm:
  90: 4 [dynamic-wind #<procedure 1b26690 at ice-9/eval.scm:416:20 ()> ...]
In ice-9/eval.scm:
 432: 3 [eval # #]
 399: 2 [eval # #]
In ./guix/build/utils.scm:
 162: 1 [call-with-ascii-input-file "fonts.scale" ...]
In unknown file:
   ?: 0 [open-file "fonts.scale" "rb"]

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: "fonts.scale"
builder for `/gnu/store/8j5bll1y0c3zrifrp984gd3gfarf0ra4-fonts-dir.drv' failed with exit code 1
cannot build derivation `/gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv': 1 dependencies couldn't be built
guix package: error: build failed: build of `/gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv' failed
--8<---------------cut here---------------end--------------->8---

Could this be because (@@ (guix profiles) fonts-dir-file) first deletes
the file and then checks if the file is empty?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

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

* Re: core-updates: fonts-dir-builder fails
  2017-08-08 11:31 core-updates: fonts-dir-builder fails Ricardo Wurmus
@ 2017-08-08 14:07 ` Ricardo Wurmus
  2017-08-08 14:23 ` Danny Milosavljevic
  1 sibling, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2017-08-08 14:07 UTC (permalink / raw)
  To: guix-devel

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


Ricardo Wurmus <rekado@elephly.net> writes:

> Hi Guix,
>
> I’m trying to install python-wrapper on core-updates:
>
> --8<---------------cut here---------------start------------->8---
[…]
> ERROR: In procedure open-file:
> ERROR: In procedure open-file: No such file or directory: "fonts.scale"
> builder for `/gnu/store/8j5bll1y0c3zrifrp984gd3gfarf0ra4-fonts-dir.drv' failed with exit code 1
> cannot build derivation `/gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv': 1 dependencies couldn't be built
> guix package: error: build failed: build of `/gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv' failed
> --8<---------------cut here---------------end--------------->8---
>
> Could this be because (@@ (guix profiles) fonts-dir-file) first deletes
> the file and then checks if the file is empty?

That’s exactly what happens.  I’ve fixed this locally with this patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-profiles-Only-check-file-contents-if-the-file-exists.patch --]
[-- Type: text/x-patch, Size: 1435 bytes --]

From 47b399ef085514b9269c881723cfd3ec8f1dc564 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Tue, 8 Aug 2017 16:05:58 +0200
Subject: [PATCH] profiles: Only check file contents if the file exists.

* guix/profiles.scm (fonts-dir-file): Check that files exist before using
"empty-file?".
---
 guix/profiles.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index b3732f61e..0eb99f40d 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1095,9 +1095,11 @@ files for the fonts of the @var{manifest} entries."
                                 (unless (and (zero? (system* mkfontscale))
                                              (zero? (system* mkfontdir)))
                                   (exit #f))
-                                (when (empty-file? fonts-scale-file)
+                                (when (and (file-exists? fonts-scale-file)
+                                           (empty-file? fonts-scale-file))
                                   (delete-file fonts-scale-file))
-                                (when (empty-file? fonts-dir-file)
+                                (when (and (file-exists? fonts-dir-file)
+                                           (empty-file? fonts-dir-file))
                                   (delete-file fonts-dir-file))))
                             directories)))))))
 
-- 
2.13.3


[-- Attachment #3: Type: text/plain, Size: 131 bytes --]


What do you think?  Should I push this?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

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

* Re: core-updates: fonts-dir-builder fails
  2017-08-08 11:31 core-updates: fonts-dir-builder fails Ricardo Wurmus
  2017-08-08 14:07 ` Ricardo Wurmus
@ 2017-08-08 14:23 ` Danny Milosavljevic
  1 sibling, 0 replies; 3+ messages in thread
From: Danny Milosavljevic @ 2017-08-08 14:23 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi Ricardo,

> ERROR: In procedure open-file:
> ERROR: In procedure open-file: No such file or directory: "fonts.scale"
> builder for `/gnu/store/8j5bll1y0c3zrifrp984gd3gfarf0ra4-fonts-dir.drv' failed with exit code 1
> cannot build derivation `/gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv': 1 dependencies couldn't be built
> guix package: error: build failed: build of `/gnu/store/md131pdqsvxmxna3ndwd5334x6876m54-profile.drv' failed
> --8<---------------cut here---------------end--------------->8---
> 
> Could this be because (@@ (guix profiles) fonts-dir-file) first deletes
> the file and then checks if the file is empty?

It removes the fonts.scale, then invokes mkfontscale (which is supposed to create fonts.scale) and then it checks whether the fonts.scale is empty (in which case i would be unnecessary to store it).

Apparently it can happen that mkfontscale doesn't create a fonts.scale at all - maybe when there are no fonts in that directory?

If so, then it might make sense to amend the check at the end to 

                                (when (and (file-exists? fonts-scale-file) (empty-file? fonts-scale-file))
                                  (delete-file fonts-scale-file))
                                (when (and (file-exists? fonts-dir-file) (empty-file? fonts-dir-file))
                                  (delete-file fonts-dir-file))))

In the interest of defensive programming I think one ought to do that anyway.

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

end of thread, other threads:[~2017-08-08 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08 11:31 core-updates: fonts-dir-builder fails Ricardo Wurmus
2017-08-08 14:07 ` Ricardo Wurmus
2017-08-08 14:23 ` Danny Milosavljevic

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.