bug#24450: [PATCHv2] Re: pypi importer outputs strange character series in optional dependency case.

2019-05-19 Thread Maxim Cournoyer
Hi Ricardo!

Ricardo Wurmus  writes:

> Hi Maxim,
>
> I would very much like to see your improvements to the pypi importer to
> be merged.  Have you been able to separate the independent changes as
> suggested by Ludo?

I'm thrilled that someone has an interest in this :-)

I took my time, but finally got around to restructure the changes a
bit.  I hope it'll be easier to review this time around!

Thank you!

Maxim

From 54e44b7397f17910d95dbdb233d23e5c97c095aa Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer 
Date: Thu, 28 Mar 2019 00:26:00 -0400
Subject: [PATCH 1/9] import: pypi: Do not consider requirements.txt files.

* guix/import/pypi.scm (guess-requirements): Update comment.
[guess-requirements-from-source]: Do not attempt to parse the file
requirements.txt.  Streamline logic.
---
 guix/import/pypi.scm | 35 +--
 tests/pypi.scm   | 23 +++
 2 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 3a20fc4b9b..8269aa61d7 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -206,35 +206,26 @@ cannot determine package dependencies"))
   (call-with-temporary-directory
(lambda (dir)
  (let* ((pypi-name (string-take dirname (string-rindex dirname #\-)))
-(req-files (list (string-append dirname "/requirements.txt")
- (string-append dirname "/" pypi-name ".egg-info"
-"/requires.txt")))
-(exit-codes (map (lambda (file-name)
-   (parameterize ((current-error-port (%make-void-port "rw+"))
-  (current-output-port (%make-void-port "rw+")))
- (system* "tar" "xf" tarball "-C" dir file-name)))
- req-files)))
-   ;; Only one of these files needs to exist.
-   (if (any zero? exit-codes)
-   (match (find-files dir)
- ((file . _)
-  (read-requirements file))
- (()
-  (warning (G_ "No requirements file found.\n"
+(requires.txt (string-append dirname "/" pypi-name
+ ".egg-info" "/requires.txt"))
+(exit-code (parameterize ((current-error-port (%make-void-port "rw+"))
+  (current-output-port (%make-void-port "rw+")))
+ (system* "tar" "xf" tarball "-C" dir requires.txt
+   (if (zero? exit-code)
+   (read-requirements (string-append dir "/" requires.txt))
(begin
- (warning (G_ "Failed to extract requirements files\n"))
+ (warning
+  (G_ "Failed to extract file: ~a from source.~%")
+  requires.txt)
  '())
   '(
 
-  ;; First, try to compute the requirements using the wheel, since that is the
-  ;; most reliable option. If a wheel is not provided for this package, try
-  ;; getting them by reading either the "requirements.txt" file or the
-  ;; "requires.txt" from the egg-info directory from the source tarball. Note
-  ;; that "requirements.txt" is not mandatory, so this is likely to fail.
+  ;; First, try to compute the requirements using the wheel, else, fallback to
+  ;; reading the "requires.txt" from the egg-info directory from the source
+  ;; tarball.
   (or (guess-requirements-from-wheel)
   (guess-requirements-from-source)))
 
-
 (define (compute-inputs source-url wheel-url tarball)
   "Given the SOURCE-URL of an already downloaded TARBALL, return a list of
 name/variable pairs describing the required inputs of this package.  Also
diff --git a/tests/pypi.scm b/tests/pypi.scm
index 6daa44a6e7..335be42644 100644
--- a/tests/pypi.scm
+++ b/tests/pypi.scm
@@ -23,7 +23,7 @@
   #:use-module (gcrypt hash)
   #:use-module (guix tests)
   #:use-module (guix build-system python)
-  #:use-module ((guix build utils) #:select (delete-file-recursively which))
+  #:use-module ((guix build utils) #:select (delete-file-recursively which mkdir-p))
   #:use-module (srfi srfi-64)
   #:use-module (ice-9 match))
 
@@ -55,11 +55,10 @@
 (define test-source-hash
   "")
 
-(define test-requirements
-"# A comment
- # A comment after a space
+(define test-requires.txt "\
 bar
-baz > 13.37")
+baz > 13.37
+")
 
 (define test-metadata
   "{
@@ -107,10 +106,10 @@ baz > 13.37")
  (match url
("https://example.com/foo-1.0.0.tar.gz;
 (begin
-  (mkdir "foo-1.0.0")
-  (with-output-to-file "foo-1.0.0/requirements.txt"
+  (mkdir-p "foo-1.0.0/foo.egg-info/")
+  

bug#35625: Python3 Cannot Find Existing Shared Library within guix environment

2019-05-19 Thread Jesse Gibbons
The good news is this bug is no longer an impediment to installing the
package because I took a(n arguably foolish) risk and disabled the tests
in the package definition (see attachment: rednotebook.scm). The bad
news is this bug persists when I run the installed package. When I
install rednotebook and run it, I get an error like the following:

Adding 
/gnu/store/cb2qs9gg7jlb83qc9k1aballzrfvia35-rednotebook-2.11.1/lib/python3.7/site-packages
to sys.path 2019-05-19 18:00:57,995 INFO Writing log to file
"/home/jesse/.rednotebook/rednotebook.log" 2019-05-19 18:00:57,995
INFO System encoding: utf-8 2019-05-19 18:00:57,995 INFO
Language code: en_US 2019-05-19 18:00:58,054 WARNING  For spell
checking, please install enchant (python3-enchant).

** (.rednotebook-real:5662): WARNING **: 18:00:58.089: Failed to load
shared library 'libwebkit2gtk-4.0.so.37' referenced by the typelib:
libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file
or directory

** (.rednotebook-real:5662): WARNING **: 18:00:58.089: Failed to load
shared library 'libjavascriptcoregtk-4.0.so.18' referenced by the
typelib: libjavascriptcoregtk-4.0.so.18: cannot open shared object
file: No such file or
directory 
/gnu/store/f34bv1iaghh7hsymqm57abi8p1lyavv6-python-pygobject-3.28.3/lib/python3.7/site-packages/gi/types.py:226:
Warning: cannot derive 'rednotebook+gui+browser+Browser' from
non-derivable parent type 'void' _gi.type_register(cls,
namespace.get('__gtype_name__')) Traceback (most recent call last):
File
"/gnu/store/cb2qs9gg7jlb83qc9k1aballzrfvia35-rednotebook-2.11.1/bin/.rednotebook-real",
line 6, in  import journal ModuleNotFoundError: No module named
'journal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File
"/gnu/store/cb2qs9gg7jlb83qc9k1aballzrfvia35-rednotebook-2.11.1/bin/.rednotebook-real",
line 11, in  import rednotebook.journal File
"/gnu/store/cb2qs9gg7jlb83qc9k1aballzrfvia35-rednotebook-2.11.1/lib/python3.7/site-packages/rednotebook/journal.py",
line 168, in  from rednotebook.gui.main_window import
MainWindow File
"/gnu/store/cb2qs9gg7jlb83qc9k1aballzrfvia35-rednotebook-2.11.1/lib/python3.7/site-packages/rednotebook/gui/main_window.py",
line 45, in  from rednotebook.gui import browser File
"/gnu/store/cb2qs9gg7jlb83qc9k1aballzrfvia35-rednotebook-2.11.1/lib/python3.7/site-packages/rednotebook/gui/browser.py",
line 41, in  class Browser(WebKit2.WebView): File
"/gnu/store/f34bv1iaghh7hsymqm57abi8p1lyavv6-python-pygobject-3.28.3/lib/python3.7/site-packages/gi/types.py",
line 235, in __init__ super(GObjectMeta, cls).__init__(name, bases,
dict_) File
"/gnu/store/f34bv1iaghh7hsymqm57abi8p1lyavv6-python-pygobject-3.28.3/lib/python3.7/site-packages/gi/types.py",
line 214, in __init__ cls._type_register(cls.__dict__) File
"/gnu/store/f34bv1iaghh7hsymqm57abi8p1lyavv6-python-pygobject-3.28.3/lib/python3.7/site-packages/gi/types.py",
line 226, in _type_register _gi.type_register(cls,
namespace.get('__gtype_name__')) RuntimeError: could not create new
GType: rednotebook+gui+browser+Browser (subclass of void)


Looks like this bug infests more than a temporary guix
environment. The program crashes unable to find some essential class
definitions even when I add a directory containing the necessary shared
libraries to $LD_LIBRARY_PATH and check that GI_TYPELIB_PATH has the
necessary typelib files.

#!
see https://github.com/jendrikseipp/rednotebook
!#
(define-module (custom packages rednotebook)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system python)
  #:use-module (guix licenses))
(define-public rednotebook

  (package
   (name "rednotebook")
   (version "2.11.1")
   (source
(origin
 (method url-fetch)
 (uri (string-append
	   "https://github.com/jendrikseipp/rednotebook/archive/v;
	   version
	   ".tar.gz"))
 (sha256
  (base32
   "15n1ziypfj3lzpvhha7r637zrb259l9yrcsvkic9cg5mndiaivs3"
   (build-system python-build-system)
   (arguments `(#:tests? #f))
   (inputs
`(("python" ,(@ (gnu packages python) python-3
   (propagated-inputs
`(("python-pygobject"
   ,(@ (gnu packages glib) python-pygobject))
  ("gtk+" ,(@ (gnu packages gtk) gtk+))
  ("gtksourceview"
   ,(@ (gnu packages gtk) gtksourceview-3))
  ("webkitgtk"
   ,(@ (gnu packages webkit) webkitgtk-2.24))
  ("python-pyyaml"
   ,(@ (gnu packages python-xyz) python-pyyaml
   (home-page "https://www.rednotebook.app;)
   (synopsis #f)
   (description
"RedNotebook is a modern desktop journal. It lets you format, tag and search your entries. You can also add pictures, links and customizable templates, spell check your notes, and export to plain text, HTML, Latex or PDF.")
   (license gpl2+))
  )


bug#35625: Python3 Cannot Find Existing Shared Library within guix environment

2019-05-19 Thread Jesse Gibbons
On Wed, 8 May 2019 09:31:50 -0600
Jesse Gibbons  wrote:

> On Wed, 8 May 2019 14:38:02 +0200
> Gábor Boskovits  wrote:
> 
> > Hello Jesse,
> > 
> > Jesse Gibbons  ezt írta (időpont: 2019. máj.
> > 8., Sze, 0:33):
> >   
> > > I brought this to the help mailing list, and now I see it as a
> > > particular bug in guix. When I change into a guix environment and
> > > try to run a Python project that uses the WebKitGTK2 library, it
> > > cannot find the specified shared library, even though it is in
> > > $LIBRARY_PATH. As a result, the project crashes. This does not
> > > happen when I call guix build. On a side note, guix build fails
> > > due to another error (possibly related).
> > >
> > > Thanks in advance for looking into this.
> > > -Jesse
> > >
> > >
> > > So it seems that the guix environment  misses some environment
> > > variables.
> > Can you check if this is still the case, when you keep the build
> > output using guix build --keep-failed --check, and then guix
> > environment , and source the environment variables dropped
> > at the kept build directory?  
> 
> I followed those steps. It doesn't seem to make a difference. I think
> I am running code not called when guix builds, but I think it is
> leaking into a problem that causes 'guix build' to fail.
> The help list suggests there might be something hard-coded. I will
> check for that.
> 
> > 
> > If that helps, then can you send the two environments?  
> I'm not certain how to get the variables initially set under 'guix
> environment' but here's the environment variables dropped by guix
> build:
> 
> export
> 

bug#35746: Evolution calendar gets the timezone wrong

2019-05-19 Thread sirmacik
Timothy Sample dixit (2019-05-18, 14:43):

> Hi again,
>
> Timothy Sample  writes:
>
> > Hello,
> >
> > Ludovic Courtès  writes:
> >
> >> Hi Ben,
> >>
> >> Ben Sturmfels  skribis:
> >>
> >>> In Evolution though, all my calendar events show up in UTC time, so I
> >>> have appointments showing up at eg. 1am.
> >>>
> >>> When I go to Edit, Preferences, Calendar and Task, General, under
> >>> timezone it says:
> >>>
> >>> [x] Use system time (UTC)
> >>
> >> Could you figure out how Evolution determines what the current time zone
> >> is?
> >>
> >> Guix provides /etc/localtime, which is what libc functions use, but I’m
> >> guessing Evolution uses a custom framework, possibly involving a
> >> hard-to-believe network of D-Bus services.
> >
> > I just looked through the source code, and learned that it really,
> > really wants “/etc/localtime” to be a symlink, because it wants to
> > resolve which timezone alias the user is using, not just the data.  If
> > it is not a symlink, it runs through a bunch of system specific checks
> > (looking up configuration files, etc.) and then tries to compare inodes
> > and finally file contents.  I get why it wants the name and not just the
> > data, but I’m not sure why it tries to figure out the absolute canonical
> > source file for the timezone data instead of just taking the data from
> > “/etc/localtime”.
> >
> > It’s easy to patch “evolution-data-server”, but maybe we could do
> > better?  It seems the “right” way to do what they are doing is to check
> > the “TZ” environment variable.  However, we don’t set that anymore
> > because it causes problems with setuid programs
> > (cf. ).  We have a comment that says that
> > “TZ” is unnecessary, but it actually has a bit more information than
> > just having data in “/etc/localtime”, since it could be the name of a
> > timezone alias.  A small improvement might be to make “/etc/localtime” a
> > symlink, but that might run into the same issues described the bug.
>
> Okay, so it turns I don’t know what “TZ” is!  :p
>
> It does not contain the timezone name, like “America/New_York”, but
> rather its designation, like “EST”.  What “evolution-data-server” wants
> is the name.
>
> > I’ve noticed a few other problems with timezones in the GNOME ecosystem,
> > which is why I was curious about this.  Perhaps they all have a common
> > root cause.
> >
> > I’m happy to patch this as stop-gap measure, but is there some way we
> > could “do the right thing” here?
>
> I guess there is no standard way to get the name of the system timezone,
> and that is why “evolution-data-server” goes to such great lengths to
> figure it out.
>
> Sorry for the noise!
>
>
> -- Tim
>

Hey Guix,

This problem seems to be also present also for other programs such as
GNU IceCat which reads UTC timezone every time, despite Europe/Warsaw
being set in my config.scm.


--
sirmacik
PGP: 0xE0DC81D523891771





bug#35785: guix won't download if locale is set to swedish

2019-05-19 Thread Einar Largenius


> Could you paste the complete output of ‘guix pull -v2’ when running
> under that locale?

Yes sorry. I have not setup email yet on that system so I need to
manually transcribe any output. This should be the complete output:

Updating channel 'guix' from Git repository at 
'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
  guix   https://git.savannah.gnu.org/git/guix.git  f5557bd
guix pull: error: lstat: Filen eller katalogen finns inte: 
"ftp://sourceware.org/pub/libffi-3.2.1.tar.gz;





bug#35783: Guile-Parted crashes the installer on i686-linux

2019-05-19 Thread Mathieu Othacehe


Hey Ludo,

> Longer-term it would be good to audit Guile-Parted: it probably
> shouldn’t be possible for Guile-Parted to refer to “defunct” Parted
> objects.

Yup, with hindsight I realize that keeping Guile-Parted so low-level was
a mistake. With a few more abstractions (gnu installer parted) could be
less complicated.

Anyway, thanks for pushing this patch.

Mathieu





bug#35783: Guile-Parted crashes the installer on i686-linux

2019-05-19 Thread Ludovic Courtès
Hi,

I went ahead and pushed the patch as
d68de958b60426798ed62797ff7c96c327a672ac.

I’ll build the release from that commit.

Thanks,
Ludo’.