Planning to package Veloren in Guix

2022-02-12 Thread Tobias Platen
Hello,

Today I released my prerecorded talk about Gaming on Guix[1], where I
mentioned Veloren. So next I want to package Veloren, which is written
in Rust. 

Tobias

[1] https://tube.tchncs.de/w/wNhzvYHdSiiGNx8zFr3n7H




Re: emacs tramp in remote guix

2022-02-12 Thread Maxime Devos
Antonio Carlos Padoan Junior schreef op za 12-02-2022 om 19:04 [+0100]:
> Josselin Poiret  writes:
> 
> > 
> > I personally use
> > 
> >   (require 'tramp)
> >   (connection-local-set-profile-variables
> >    'guix-system
> >    '((tramp-remote-path . (tramp-own-remote-path
> >   (connection-local-set-profiles
> >    '(:application tramp :protocol "sudo" :machine "hostname")
> >    'guix-system)
> > 
> > for tramp on my own machine.  The symbol 'tramp-own-remote-path uses the
> > login shell of the target to determine the environment to use, so is
> > well suited for guix.  You may need to adjust the :protocol and :machine
> > keys of the connection-local-set-profiles call for your use case though.
> > 
> > Best,
> 
> Thanks Josselin and Mikhail!
> 
> Cleaning the tramp file did the job! It works now!
> 
> I will check closely Josselin proposition as well, it seems I have
> something new to learn there.
> 
> IMHO, giving the importance emacs has in guix distribution this is
> something that merits a place on guix cookbook perhaps.

I think that ideally, the tramp package in Guix would be patched to
recognise ~/.guix-profile/etc/profile and /etc/profile (when present,
on the remote machine) and use that to determine the PATH for the
remote machine (or some other system, whatever works) .

Thne tramp would work out-of-the-box, without having to consult a
cookbook or manual and without having to know that this information is
located there.

Greetings,
Maxime.


signature.asc
Description: This is a digitally signed message part


Re: emacs tramp in remote guix

2022-02-12 Thread Antonio Carlos Padoan Junior


Josselin Poiret  writes:

>
> I personally use
>
>   (require 'tramp)
>   (connection-local-set-profile-variables
>'guix-system
>'((tramp-remote-path . (tramp-own-remote-path
>   (connection-local-set-profiles
>'(:application tramp :protocol "sudo" :machine "hostname")
>'guix-system)
>
> for tramp on my own machine.  The symbol 'tramp-own-remote-path uses the
> login shell of the target to determine the environment to use, so is
> well suited for guix.  You may need to adjust the :protocol and :machine
> keys of the connection-local-set-profiles call for your use case though.
>
> Best,

Thanks Josselin and Mikhail!

Cleaning the tramp file did the job! It works now!

I will check closely Josselin proposition as well, it seems I have
something new to learn there.

IMHO, giving the importance emacs has in guix distribution this is
something that merits a place on guix cookbook perhaps.

Best regards
-- 
Antonio Carlos PADOAN JUNIOR
Phone: +33(0)6 5035 1196
GPG fingerprint:
243F 237F 2DD3 4DCA 4EA3  1341 2481 90F9 B421 A6C9



Guix Scripts and Unit Testing

2022-02-12 Thread Phil
Hi Guix,

I have some Guix scripts which take the form of manifests
(--manifest=file), packages (--load=file), or are called using "guix
repl".  Some of these are complex enough to warrant writing unit tests for
using srfi-64.  However, I'm having some difficulty trying to work out how
to run unit tests over procedures that are also used to descirbe manifests
and repl scripts, and was looking for some advice - details below!

Normally in vanilla Guile I'd structure my code to call a main procedure
using the Guile meta-switch, thus the script could also be imported by a
test script using "use-modules" or executed using the meta-switch:
https://www.gnu.org/software/guile/manual/html_node/The-Meta-Switch.html

However there is no way of doing this (that I can figure out) when the
script is being passed to "guix envrionment" or "guix repl" - meaning the
contents of my "main" procedure cannot be bound by a function in the script.

To try to work around this, I separated my scripts into a library module to
be unit tested, and a short runner which will call into the library module
to generate the manifest, however this approach produces unexpected
behaviour - for example if I have a simple *gurobi-manifest.scm* like so:







*(add-to-load-path (dirname (current-filename))) ;; put the script's
location on the module path(use-modules (gurobi-transform-lib)) ;; load the
script library(newline)(packages->manifest (list my-package-with-my-gurobi*

*  (specification->package "python"))) ;; add
python for convenience*

The procedure we call to generate the package - *my-package-with-my-gurobi*,
is in a file called *gurobi-transform-lib.scm* in the same directory as the
manifest above.

The initial call to the *my-package-with-my-gurobi* succeeds (The stdout
below shows this) but failure quickly follows, with a subsequent call to
the library failing:








*$ guix environment -m gurobi-manifest.scmSetting Gurobi Version: 9.1.2 <-
everything looks OK to start withSetting Test Package: simmguix
environment: error: failed to load
'gurobi-manifest.scm':ice-9/boot-9.scm:3329:6: In procedure
resolve-interface:no code for module (gurobi-transform-lib)*

*$*

If I cut and paste the library and manifest into the same file everything
works as expected.

Thus the best workaround I have at the moment is to have the unit tests run
directly from the manifest script, every time the manifest is used, but
this is only practical for a very small number of unit tests, and even then
it's a bit ugly.

Can anyone suggest a better way of having the unit tests in a separate file
which can import procedures used in repl or manifest scripts in such a way
that they still work or can be used as repl or manifest scripts themselves?

In the above example, I was hoping to have something like:

*guix repl -- gurobi-transform-lib-tests.scm*

Any ideas greatfully received!

Cheers,
Phil.


Re: emacs tramp in remote guix

2022-02-12 Thread Josselin Poiret
Hello everyone,

Mikhail Kryshen  writes:

> Hello,
>
> Antonio Carlos Padoan Junior  writes:
>
>> Hello everybody,
>>
>> I'm trying to use emacs tramp to connect to a guix machine but tramp
>> complains it can't find an appropriate 'ls' command.
>>
>> I tried to help tramp setting the following:
>>   (add-to-list 'tramp-remote-path "/run/current-system/profile/bin")
>
> For me this works.
>
>> But I'm still not lucky. I always get the same error.  Is there any
>> elegant way to correctly use tramp with a remote guix machine?
>
> You may need to delete ~/.emacs.d/tramp before starting Emacs for the
> setting to take effect.

I personally use
--8<---cut here---start->8---
  (require 'tramp)
  (connection-local-set-profile-variables
   'guix-system
   '((tramp-remote-path . (tramp-own-remote-path
  (connection-local-set-profiles
   '(:application tramp :protocol "sudo" :machine "hostname")
   'guix-system)
--8<---cut here---end--->8---
for tramp on my own machine.  The symbol 'tramp-own-remote-path uses the
login shell of the target to determine the environment to use, so is
well suited for guix.  You may need to adjust the :protocol and :machine
keys of the connection-local-set-profiles call for your use case though.

Best,
-- 
Josselin Poiret