New Brazilian Portuguese PO file for 'guix' (version 1.2.0-pre3)

2021-01-03 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.

A revised PO file for textual domain 'guix' has been submitted
by the Brazilian Portuguese team of translators.  The file is available at:

https://translationproject.org/latest/guix/pt_BR.po

(We can arrange things so that in the future such files are automatically
e-mailed to you when they arrive.  Ask at the address below if you want this.)

All other PO files for your package are available in:

https://translationproject.org/latest/guix/

Please consider including all of these in your next release, whether
official or a pretest.

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

The following HTML page has been updated:

https://translationproject.org/domain/guix.html

If any question arises, please contact the translation coordinator.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.





Re: Staging branch

2021-01-03 Thread Leo Famulari
On Sat, Jan 02, 2021 at 08:38:27PM -0800, John Soo wrote:
> For what it is worth I have rebased on staging and reconfiguring my
> system on it built successfully.  Also my manifest built successfully.

Thank you very much for testing it. I'd glad to hear that everything is
working for you.



Re: Specify substitute url in GUI installer

2021-01-03 Thread Mathieu Othacehe


Hello,

> However, it's sad that there's no option for user to specify substitute
> url in GUI installer of Guix ISO. It means that people new to Guix still
> have to tolerate the slow connection during the installation.
>
> Can we add such option for GUI installer?

Adding such an option shouldn't be too hard, as there's already the
possibility to add an HTTP mirror from the parameters menu.

The problem is to authorize the substitute server. I don't think it's
reasonable to ask the user to enter the server public key manually. An
option would be to fetch the public key from
"https://the-substitute-sever/signing-key.pub;, display it, and propose
the user to authorize or not this server.

WDYT?

Mathieu



Re: ZFS on Guix

2021-01-03 Thread Danny Milosavljevic
Hi,

the reason is that our "zfs" package uses

  ("util-linux" ,util-linux "lib")

and then does

   (substitute* "lib/libzfs/libzfs_mount.c"
 (("/bin/mount") (string-append util-linux "/bin/mount"))
 (("/bin/umount") (string-append util-linux "/bin/umount")))

.

That can't work.

zfs interna that will be patched by the Guix package are:

./lib/libzfs/libzfs_mount.c

do_mount(const char *src, const char *mntpt, char *opts)

char *argv[9] = {
"/bin/mount",
"--no-canonicalize",
"-t", MNTTYPE_ZFS,
"-o", opts,
(char *)src,
(char *)mntpt,
(char *)NULL };

Easy fix would be to change our package to have both

  ("util-linux:lib" ,util-linux "lib")

and

  ("util-linux" ,util-linux)

.


pgpA8InGZ7kW2.pgp
Description: OpenPGP digital signature


Re: [RFC] Improve Python package quality

2021-01-03 Thread Tobias Geerinckx-Rice

Lars(-Dominik?),

I'll defer to others on the finer points of 
(Scheme-string-embedded-)Python, but just wanted to say:


Lars-Dominik Braun 写道:
My proposal adds some build-time checks to guarentee three 
properties:


This is utterly awesome.  Thank you so much.

Kind regards,

T G-R


signature.asc
Description: PGP signature


Specify substitute url in GUI installer

2021-01-03 Thread Zhu Zihao
Hi, Guix users!

Thanks to the  (from SJTU). We finally set up
a Guix substitute mirror in SJTU LUG.

You can try with command line option
"--substitute-urls=https://mirrors.sjtug.sjtu.edu.cn/guix;

However, it's sad that there's no option for user to specify substitute
url in GUI installer of Guix ISO. It means that people new to Guix still
have to tolerate the slow connection during the installation.

Can we add such option for GUI installer?

-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao


signature.asc
Description: PGP signature


Re: [RFC] Improve Python package quality

2021-01-03 Thread Hartmut Goebel

Hi Lars,

this is a good idea. (Since you where mentioning setuptools, I first was 
afraid your solution would be tightened to setuptools, but it is not. 
Well done!)


Some comments (most of which are nit-picking):


+;; Python 2 support.

+"from __future__ import print_function"

This comment should go behind the line of code, as it only related to 
that single line.



+" req = str (dist.as_requirement ())"

+;; dist.activate() is not enough to actually check requirements, we 
have to


+;; .require() it.

+" pkg_resources.require (req)"

I suggest putting the comments into the python source. This would allow 
to indent them according the the python code, which would make it easier 
to understand. This would also allow to use a single multi-line 
guile-string, which allows to easiyl copy the script out and in from the 
guile-source for testing it.




+" except Exception as e:"

+" print (req, e)"

+" sys.exit (1)"


raise SystemExit(1)



+" print ('...trying to load endpoint', group, name)"


Please follow PEP8 (no space before opening parentheses) - also at other 
places.




+" for name in dist.get_metadata_lines ('top_level.txt'):"

+" print ('...trying to load module', name)"


Add `end=""`, thus the "result" can be printed on the same line.


+" except ModuleNotFoundError:"

+" print ('..WARNING: module', name, 'not found, continuing')"


Print result terse, on same line, without repeating the name:

  print (' WARNING: not found')


+" continue")


Add printing success:

    else:
   print("passed")


+ (add-installed-pythonpath inputs outputs)

+ ;; Make sure the working directory is empty (i.e. no Python modules 
in it)


+ (with-directory-excursion "/tmp"


Would is be better to use mkdtemp here to ge a fresh, empty directory?


--
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |



[RFC] Improve Python package quality

2021-01-03 Thread Lars-Dominik Braun
Hi,

I’d like to propose adding an additional phase to python-build-system to
improve Guix’ Python package quality.

Python is an interpreted language without any compile-time checks. Any
errors are only visible at run-time, including missing or wrong imports.
Additionally most Python packages use an additional packaging layer
through setuptools, which also declares mandatory and optional
dependencies.

This can result in buildable, but broken packages. An example of a
botched upgrade is fixed in commit
22e06297b1982f75aaadddba616b1052e506e4a0. The package python-httpx was
upgraded, but that new version declared a dependency to a newer
python-httpcore via setuptools, which wasn’t available and thus packages
depending on python-httpx were broken.

My proposal adds some build-time checks to guarentee three properties:

1) Depending on the package (distribution in Python language) via
setuptools works. This ensures dependencies are complete and have the
correct version as determined by setup.{py,cfg}.
2) Console entry points can be loaded. This ensures scripts installed to
bin/ actually work.
3) Top-level modules can be imported. This ensures the package is
actually usable and has no undeclared dependencies.

The attached patch implements all three. I’ve been rebuilding a few
Python packages using the patch and uncovered some issues already. I’m
sure it’s not perfect yet and thus I’m open to improvements. If this
idea is well received I’m willing to rebuild and fix *all* Python
packages broken by this new phase. I’m also aware this change needs to
go to core-updates.

Cheers,
Lars

>From 919fd78b1aff6c277baca396ef962a5dcd4e23ae Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun 
Date: Sun, 3 Jan 2021 10:30:29 +0100
Subject: [PATCH] [WIP] build-system/python: Validate installed package

* guix/build/python-build-system.scm (validate-loadable): New phase.
(%standard-phases): Use it.
---
 guix/build/python-build-system.scm | 51 ++
 1 file changed, 51 insertions(+)

diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index 09bd8465c8..edb772a7a4 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -148,6 +148,56 @@
   (format #t "test suite not run~%"))
   #t)
 
+(define* (validate-loadable #:key tests? inputs outputs #:allow-other-keys)
+  "Ensure packages depending on this package via setuptools work properly,
+their advertised endpoints work and their top level modules are importable
+without errors."
+  (let ((script (string-join
+'(
+;; Python 2 support.
+"from __future__ import print_function"
+"import pkg_resources, sys, importlib"
+;; Only check site-packages installed by this package, but not dependencies
+;; (which pkg_resources.working_set would include). Path supplied via argv.
+"ws = pkg_resources.find_distributions (sys.argv[1])"
+"for dist in ws:"
+"print ('validating', repr (dist.project_name), dist.location)"
+"try:"
+"req = str (dist.as_requirement ())"
+;; dist.activate() is not enough to actually check requirements, we have to
+;; .require() it.
+"pkg_resources.require (req)"
+"except Exception as e:"
+"print (req, e)"
+"sys.exit (1)"
+;; Try to load entry points of console scripts too, making sure they work. They
+;; should be removed if they don’t. Other groups may not be safe, as they can
+;; depend on optional packages.
+"for group, v in dist.get_entry_map ().items ():"
+"   if group not in {'console_scripts', }:"
+"   continue"
+"   for name, ep in v.items ():"
+"   print ('...trying to load endpoint', group, name)"
+"   ep.load ()"
+;; And finally try to load top level modules. This should not have any
+;; side-effects.
+"for name in dist.get_metadata_lines ('top_level.txt'):"
+"print ('...trying to load module', name)"
+"try:"
+"importlib.import_module (name)"
+;; Ignore non-existent modules, we only want to know if the existing ones work.
+"except ModuleNotFoundError:"
+"print ('..WARNING: module', name, 'not found, continuing')"
+"continue")
+"\n")))
+(add-installed-pythonpath inputs outputs)
+;; Make sure the working directory is empty (i.e. no Python modules in it)
+(with-directory-excursion "/tmp"
+;; XXX: Cloak command run. Long and unreadable if it fails, provide an
+;; explanation instead.
+  (invoke "python" "-c" script (site-packages inputs outputs
+  #t)
+
 (define (python-version python)
   (let* ((version (last (string-split python #\-)))
  (components  (string-split version #\.))
@@ -267,6 +317,7 @@ installed with setuptools."
 (replace 'install install)
 (add-after 'install 'check check)
 (add-after 'install 'wrap wrap)
+(add-after 'check 'validate-loadable validate-loadable)
 (add-before 'strip 'rename-pth-file rename-pth-file)))
 
 (define* (python-build #:key