help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging Grafana


From: Csepp
Subject: Re: Packaging Grafana
Date: Sun, 15 Jan 2023 12:12:40 +0100

phodina via <help-guix@gnu.org> writes:

> Hi Guix,
>
> Grafana [1] is an awesome tool to visualize and analyze various kind of data.
>
> It's FOSS project under AGPL3+.
>
> The small drawback is it's written in Go and Typescript.
>
> As far as I understand for Go there's the file go.mod​ describing the
> dependencies [2] and for Typescript there's file package.json​.[3]
>
> I've tried to use the guix import​ command, however, it fails to add even the 
> Go dependencies.
>
> Also since the dependency chain is obviously huge how should the porting be 
> done?
>
> Any experience porting some similar package with dos and don'ts?
>
> The short term solution at least in my case is to use the prebuilt
> static binary which works after running patchelf on it. That's also
> how Nix package looks like. [4]
>
> Here's what the importer returns:
>
> $ guix import go -r github.com/grafana/grafana
> (define-public go-github-com-grafana-grafana
> (package
> (name "go-github-com-grafana-grafana")
> (version "5.4.5+incompatible")
> (source (origin
> (method git-fetch)
> (uri (git-reference
> (url "https://github.com/grafana/grafana";)
> (commit (go-version->git-ref version))))
> (file-name (git-file-name name version))
> (sha256
> (base32
> "1rgcy21amrh6syf21p2gpdbwzc2mcjw6wsbhwwr7v40rdx12rmcm"))))
> (build-system go-build-system)
> (arguments
> '(#:import-path "github.com/grafana/grafana"))
> (home-page "https://github.com/grafana/grafana";)
> (synopsis "")
> (description
> "@@url{https://grafana.com,Website} | 
> @@url{https://twitter.com/grafana,Twitter}
> | @@url{https://community.grafana.com,Community & Forum}") (license 
> license:asl2.0)))
>
> 1 https://grafana.com/
> 2 https://github.com/grafana/grafana/blob/main/go.mod
> 3 https://github.com/grafana/grafana/blob/main/package.json
> 4 
> https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix
>
> ----
> Petr

Honestly, I think our Go importer needs to be rewritten to just use Go's
libraries instead of trying to replicate all functionality in Guile.  It
does a lot of... let's say sub-optimal things currently, like cloning
full git repos, when Go is smart enough to only clone what it needs for
dependency resolution.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]