Re: Bug? Haskell GHC wont' work since ghc@8.6?

2021-01-10 Thread yasu
Hi John,

Oh, I see!  I wonder if it possible to have a more convinient

haskell-for-a-casual-developer like package or:

parameterize the command itself, say:
guix install ghc -option1=blah, -option2=blah,
and provide default options as well?

In the very least, a warning message explaining this after:
guix install ghc

Might do.

Lots of ideas :-)

Cheers,
yasu





On Sun, 2021-01-10 at 22:18 -0800, John Soo wrote:
> Hi yasu,
> 
> This question comes up on the mailing list every so often, but I
> don’t think it is a bug. I want to be able to choose the c toolchain
> ghc uses myself. I would rather introduce some Haskell specific
> documentation.
> 
> We discussed during the guix day that we would love to have some
> language specific setup documentation. I had issues like this in
> mind.
> 
> - John 




Bug? Haskell GHC wont' work since ghc@8.6?

2021-01-10 Thread John Soo
  
  

  
  
  
Hi yasu,  

  
This question comes up on the mailing list every so often, but I don’t think it 
is a bug. I want to be able to choose the c toolchain ghc uses myself. I would 
rather introduce some Haskell specific documentation.
  

  
We discussed during the guix day that we would love to have some language 
specific setup documentation. I had issues like this in mind.
  

  
- John   
  
  
  
  

  
 

Re: packaging a golang package

2021-01-10 Thread Timmy Douglas


I also tried Helio's branch, rebased on the latest, with the following
changes:

diff --git a/guix/import/go-modules.scm b/guix/import/go-modules.scm
index 20fc5c9642..811c9f60ae 100644
--- a/guix/import/go-modules.scm
+++ b/guix/import/go-modules.scm
@@ -290,7 +290,7 @@ VERSION, MODULE-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION, 
and LICENSE."
(() "")
(_ home-page)))
  (synopsis ,synopsis)
- (description ,(beautify-description description))
+ (description ,(beautify-description (or description "")))
  (license ,(match license
  (() #f)
  ((license) license)
@@ -327,12 +327,11 @@ specified, attempt to fetch that version. Otherwise, 
fetch the latest version."
 (define* (go-module-recursive-import name #:optional version)
   "Given a module NAME and, optionally its VERSION, produce package definitions
 for itself and every dependency, recursively."
-  (recursive-import (if version (string-append name "@" version) name) #f
+  (recursive-import (if version (string-append name "@" version) name)
 #:repo->guix-package
-(lambda (name repo)
+(lambda* (name #:key repo version)
   (let-values (((name version) (package-name->name+version 
name)))
-(go-module->guix-package name version))
-)
+(go-module->guix-package name version)))
 #:guix-name go-module-name+version->package-name+version))



I liked how Helio's version uses the go proxy to simplify the parsing of
the package lists, but I ran this:

./pre-inst-env guix import go-modules -r github.com/coredns/coredns

and it took what felt like thirty minutes before failing with:

error: failed to retrieve package information from 
"https://proxy.golang.org/replace/@v/(.info": 410 ("Gone")
Backtrace:
In ice-9/boot-9.scm:
  1736:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
  17 (apply-smob/0 #)
In ice-9/boot-9.scm:
718:2 16 (call-with-prompt _ _ #)
In ice-9/eval.scm:
619:8 15 (_ #(#(#)))
In guix/ui.scm:
  2154:12 14 (run-guix-command _ . _)
In guix/scripts/import.scm:
   121:11 13 (guix-import . _)
In ice-9/eval.scm:
159:9 12 (_ _)
In guix/import/utils.scm:
   464:27 11 (recursive-import _ #:repo->guix-package _ #:guix-name _ ?)
In srfi/srfi-1.scm:
   586:29 10 (map1 (("github.com/davecgh/go-spew@v1.1.1" #f) (# #) ?))
   586:29  9 (map1 (("github.com/google/go-cmp@v0.4.0" #f) ("g?" ?) ?))
   586:29  8 (map1 (("github.com/google/gofuzz@v1.1.0" #f) ("g?" ?) ?))
   586:29  7 (map1 (("github.com/kr/pretty@v0.2.0" #f) ("githu?" ?) ?))
   586:29  6 (map1 (("github.com/spf13/pflag@v1.0.5" #f) ("gol?" ?) ?))
   586:29  5 (map1 (("golang.org/x/tools@v0.0.0-20200505023115?" ?) ?))
   586:29  4 (map1 (("gopkg.in/check.v1@v1.0.0-20190902080502-?" ?) ?))
   586:29  3 (map1 (("k8s.io/klog/v2@v2.2.0" #f) ("sigs.k8s.io?" ?) ?))
   586:29  2 (map1 (("sigs.k8s.io/yaml@v1.2.0" #f) ("replace@(" #f)))
   586:17  1 (map1 (("replace@(" #f)))
In guix/import/utils.scm:
   453:33  0 (lookup-node "replace@(" #f)

guix/import/utils.scm:453:33: In procedure lookup-node:
Wrong number of values returned to continuation (expected 2)


Looks like it ran into the replace syntax and didn't parse it correctly?
https://golang.org/ref/mod#go-mod-file


I sort of wonder if the `git-fetch` portion of go packages should be
something like `git-fetch-and-restore-go-modules` Maybe something like
`go mod vendor` could be used an the hash would be calculated on that?
I'm not familiar enough with the internals of go modules, but I'm not
really seeing the value in generating a bunch of package metadata on all
the module dependencies.



Re: Bug? Haskell GHC wont' work since ghc@8.6?

2021-01-10 Thread yasu
Hi John,
Thank you, after installing gcc-toolchain, it worked!
Then this is indeed a bug that should be very simple to fix?   Just
require gcc-toolchain (or some of its required features) as a GHC's
dependency?
I am also curious, what kind of testing (if any?) does Guix perform for
packages??  Or is GHC already marked as broken?
(Apology for repeated question marks :-))
~/co/haskell-tiny-intro/exercise (master *)$ guix install gcc-
toolchain...~/co/haskell-tiny-intro/exercise (master *)$ ghc a.hs[1 of
1] Compiling Main ( a.hs, a.o )Linking a ...~/co/haskell-
tiny-intro/exercise (master *)$ ghc --versionThe Glorious Glasgow
Haskell Compilation System, version 8.8.3
Cheers,
Yasu
On Sun, 2021-01-10 at 21:49 -0800, John Soo wrote:

> Hi yasu,
> Compiling with ghc requires a c toolchain (like gcc-toolchain)
> installed to work. Can you try again after installing gcc-toolchain?
>  Ghc has not been perfect for me recently but I use it quite a lot.
> 
> Hope that helps,
> 
> John


Re: Bug? Haskell GHC wont' work since ghc@8.6?

2021-01-10 Thread John Soo
 Hi yasu, 

 
Compiling with ghc requires a c toolchain (like gcc-toolchain) installed to 
work. Can you try again after installing gcc-toolchain?Ghc has not been 
perfect for me recently but I use it quite a lot.
 

 
Hope that helps,
 

 
John
 


Bug? Haskell GHC wont' work since ghc@8.6?

2021-01-10 Thread yasu
This one ought to be very simple to solve (or at least confirm).   Does
anyone use Haskell daily?

I am a very casual user of Haskell (GHC) and when I tried to compile
something just now, I noticed that it can't even compile the simplest
possible program..., unless I downgrade to ghc@8.4 or lower. Newer
versions, including ghc@8.6.5, didn't work, throwing the error message
below instead.

~/co/haskell-tiny-intro/exercise (master *)$ cat a.hs
main = putStrLn "a"

~/co/haskell-tiny-intro/exercise (master *)$ ghc a.hs
Linking a ...
.gcc-wrapped: error: unrecognized command line option '-no-pie'
`gcc' failed in phase `C Compiler'. (Exit code: 1)

Cheers,
Yasu




Re: Find installed library version of GNU Guix commit x

2021-01-10 Thread Zelphir Kaltstahl
Hi all!

I thought about it again and perhaps the simplest variation of the
question is:

How to list versions of installed packages of temporary "environments"
(best from command line, using a guix command)?

Regards,
Zelphir

On 1/7/21 8:03 PM, Zelphir Kaltstahl wrote:
>
> Hi simon!
>
> I'll try to paraphrase my question:
>
> If I run:
>
> 
> guix time-machine \
>  --channels="${DIR}/channels.scm" -- \
>  environment \
>  --manifest="${DIR}/manifest.scm"
> 
>
> Using the files I wrote about, how would I go about knowing, which
> version of guile-json I am really using? What command can I run, that
> will list me the versions of packages, which I installed into the
> environment, which I am temporarily creating using the above command?
>
> With version, I mean something like "3.5.0".
>
> When I do:
>
> 
> guix install guile-json
> The following package will be installed:
>guile-json 4.4.1
> ...
> 
>
> I see the version. How can I look up that info in the created environment?
>
> Regards,
> Zelphir
>
> On 1/7/21 1:30 PM, zimoun wrote:
>> Hi,
>>
>> On Wed, 6 Jan 2021 at 20:52, Zelphir Kaltstahl
>>  wrote:
>>
>>> I would like to know a command line way of finding the version of a
>>> library, which I install, when I am using time-machine as follows:
>> [...]
>>
>>> So I already learned today:
>>>
>>> 1. Revisions seem to be the same thing as commit ids in the version
>>> control system. Just a different name for the same thing.
>>>
>>> 2. Apparently package derivations are "the versions following from a git
>>> commit of Guix", but there can be more shown, than I expected.
>>>
>>> Can you help me Guix noob out?^^
>> What are you asking?  Sorry, I am confused and I am not sure to understand.
>>
>> About the Data Service, the commit ranges work per "state".  See [1]
>> for an example.  Therefore, they are not always accurate.
>>
>> 1: https://lists.gnu.org/archive/html/guix-devel/2020-11/msg00420.html
>>
>>
>> All the best,
>> simon
> -- 
> repositories: https://notabug.org/ZelphirKaltstahl

-- 
repositories: https://notabug.org/ZelphirKaltstahl



Re: How to replace a system package with a patched version in system configuration?

2021-01-10 Thread miyamoto moesasji
I use a heavily customised keyboard layout
(https://github.com/moesasji/xkeyboard-config/commit/23fdb4a6966fd65b98b1fd303cfaecf8fcae8556);
as I result I need to add my customized layout to the system before I
can use the existing keyboard configuration mechanism in guix for the
system as a whole.

The reason I want to patch xkeyboard-config is that is what is used in
keyboard.scm to define the various keyboard formats used by Guix

On Sun, Jan 10, 2021 at 12:26 PM John Soo  wrote:
>
> Hello,
>
> The operating system and several services and bootloader configurations 
> already have keyboard-layouts as parameters. What keyboard configuration do 
> you need?
>
> Hth,
>
> John



Re: How to replace a system package with a patched version in system configuration?

2021-01-10 Thread John Soo
 Hello, 

 
The operating system and several services and bootloader configurations already 
have keyboard-layouts as parameters. What keyboard configuration do you need?
 

 
Hth,
 

 
John
 


How to replace a system package with a patched version in system configuration?

2021-01-10 Thread miyamoto moesasji
I want to add my custom keyboard layout by patching xkeyboard-config
so that this layout can
be used in the rest of the system configuration.

>From the manual on defining package variants it is clear how to define
such a patched variant.
However it is not at all clear to me how to use the various
package-rewrite options in that
manual page to make my system configuration use the patched
xkeyboard-config. The only
related question
(https://lists.gnu.org/archive/html/help-guix/2018-07/msg8.html)
that I
have been able to find managed to work around it.

As I'm at a loss how to do this cleanly**: could someone give me a
pointer on how to adapt the
default desktop example
(https://guix.gnu.org/manual/en/html_node/Using-the-Configuration-System.html)
to add a patched system package such as xkeyboard-config?

**) I can see that a work-around is to use a custom guix channel.
However that seems a lot of
additional work as it would require keeping the channel in sync. There
must be a cleaner approach
to achieve this.