all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tonton <tonton@riseup.net>
To: cdelia@dc.uba.ar
Cc: help-guix@gnu.org
Subject: Re: rolling back only a single package
Date: Mon, 31 Dec 2018 16:17:26 +0100	[thread overview]
Message-ID: <20181231161726.477cba83@merlin.browniehive.net> (raw)
In-Reply-To: <87muom39od.fsf@dc.uba.ar>

On Sun, 30 Dec 2018 19:57:06 -0300
<cdelia@dc.uba.ar> wrote:

> Tonton <tonton@riseup.net> writes:
> 
> Yes, but I check the blog suggested by Björn:
> 
> https://www.gnu.org/software/guix/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/
>

Cool, I hadn't seen this post before. So yes, that sounds like a good way
forward. :)
 
> >
> > As a quick fix for xmobar I see it was updated to 0.28 in commit
> > ccd4fd3f2a614996bff5436cc22e4715a7eb1f31 and only two lines were
> > changed.  
> 
> I'm begging to think that it' a problem with GHC version. After all it
> doesn't make sense to have a segfault in haskell code. Besides, I read a
> comment on a readme in the github repo that points in that direction.
> 
> So even if a get this pkg definition to work, maybe xmobar will keep
> segfaulting now and then.
> 

Oh, yes. If the problem lies in the GHC version this package definition won't
solve it.

> > would create a file ~/my-guix-pakcages/my-xmobar.scm and put the
> > following in it:
> >
> > -------------------------------------------------------------------------------------------------
> > (define-module (my-xmobar) ;; The name "my-xmobar" have to be 
> > 					       ;; the same as the filename
> >   #:use-module (guix packages)
> >   #:use-module (guix download)
> >   #:use-module (gnu packages)
> >   #:use-module (gnu packages wm))
> >
> > (define-public my-xmobar
> >   (package
> >     (inherit xmobar)
> >     (name "xmobar")
> >     (version "0.27")
> >     (source (origin
> >              (method url-fetch)
> >                (uri (string-append "mirror://hackage/package/xmobar/"
> >                                    name "-" version ".tar.gz"))
> >               (sha256
> >                (base32
> >                 "0agx490q6sbmv3vfq33ys8dsrgwizj3bmha4i1pkxz5wp5q8cx3l"))))))
> > -------------------------------------------------------------------------------------------------
> >
> > Then add the file to your shells $GUIX_PACKAGE_PATH like 
> > 'export GUIX_PACKAGE_PATH=~/my-guix-pakcages/:$GUIX_PACKAGE_PATH'
> > in your .profile or similar. Open a new shell and run:
> > guix package -i xmobar@0.27
> >
> > Hope that helps. :)
> >  
> 
> It does! It's a good way to getting my hands dirty and learn.
> 
> So, this it's a little long, sorry...
> 
> Where do you get that commit hash?
> 

The commit hash earlier (ccd4fd3f2a614996bff5436cc22e4715a7eb1f31) is from
the guix repository at https://git.savannah.gnu.org/cgit/guix.git/

The hash in the package definition is from guix hash. I get it by running:

$ guix download https://hackage.haskell.org/package/xmobar-0.27/xmobar-0.27.tar.gz
Starting download of /tmp/guix-file.hS67K3
From https://hackage.haskell.org/package/xmobar-0.27/xmobar-0.27.tar.gz...
[...]
/gnu/store/l9bz25g4li7g3snasm35cc2c6qf3qmn7-xmobar-0.27.tar.gz
0agx490q6sbmv3vfq33ys8dsrgwizj3bmha4i1pkxz5wp5q8cx3l

$ guix hash /gnu/store/l9bz25g4li7g3snasm35cc2c6qf3qmn7-xmobar-0.27.tar.gz
0agx490q6sbmv3vfq33ys8dsrgwizj3bmha4i1pkxz5wp5q8cx3l

You might notice that the hash guix download yields is the same as guix
hash. I've been recommended running guix hash separately as a best
practice, I don't remember the specifics and it costs me nothing. :)

> Here is what I did to get the hash and see the differences.
> 
> -------------------------------------------------------------------------------------------------
> git clone https://github.com/jaor/xmobar
> 
> cd xmobar
> 
> $git rev-list -n1 0.28
> 661f1a529f0e8416560d0f5f121bce15a1cfc329
> 
> $git rev-list -n1 0.26
> f897fbe3645d5af96197ee6b9c2dc547f5c036cf
> 
> $git diff 11fa52601bc486b110252b7c6aa22bae2bafbd86
> 661f1a529f0e8416560d0f5f121bce15a1cfc329
> -------------------------------------------------------------------------------------------------
> 
> to know the sha265:
> 
> -------------------------------------------------------------------------------------------------
> $wget http://hackage.haskell.org/package/xmobar-0.26/xmobar-0.26.tar.gz
> $sha256 xmobar-0.26.tar.gz
> -------------------------------------------------------------------------------------------------
> 
See above, but here I think it's a better idea to use guix download and
guix hash. Also because guix download will get the tarball and put it in
your store, so you won't have to download it again while testing builds.

> Then I follow your advice and create a package. 
> 
> -------------------------------------------------------------------------------------------------
> (define-module (xmobar-0.26)
>   #:use-module (guix packages)
>   #:use-module (guix download)
>   #:use-module (gnu packages)
>   #:use-module (gnu packages wm))
> 
> (define-public xmobar-0.26
>   (package
>    (inherit xmobar)
>    (name "xmobar")
>    (version "0.27")
>    (source (origin
>             (method url-fetch)
>             (uri (string-append "mirror://hackage/package/xmobar/"
>                                 name "-" version ".tar.gz"))
>             (sha256
>             "ff7dd9af151e0336d35fa4741a76fe8a95762649c11877442449b321f106e4a5")))))
> -------------------------------------------------------------------------------------------------
>
> 
> Note that I didn't use (base32 "sha256-in-base32")
> 
> but I try with:
> 
> -------------------------------------------------------------------------------------------------
> $sha256 xmobar-0.26.tar.gz | base32
> -------------------------------------------------------------------------------------------------
> 
> and then using (base32 ...) and get the same error:
> 
> $guix package -i xmobar-0.26
> guix package: warning: failed to load '(xmobar-0.26)':
> no code for module (xmobar-0.26)
> guix package: error: xmobar-0.26: unknown package
> 
> (after set up the GUIX_PACKAGE_PATH, obviusly)
> 
> or even:
> 
> $guix package -i xmobar@0.26
> guix package: warning: failed to load '(xmobar-0.26)':
> no code for module (xmobar-0.26)
> guix package: error: xmobar: package not found for version 0.2¬
> 
> 
> mmm, what's wrong? maybe some dependency change? Or did I put the wrong
> sha256? The url it's fine, Why it can't found it?
> 

Awesome, great work :)

I'd double check GUIX_PACKAGE_PATH and that the filename is
xmobar-0.26.scm and it exists in GUIX_PACKAGE_PATH.
$ echo $GUIX_PACKAGE_PATH
$ find $(echo "$GUIX_PACKAGE_PATH" | sed 's/:/ /g') -name xmobar-0.26.scm

Then xmobar-0.26 is the variable name for your package definition used for guile hacking. While
xmobar@0.26 is sort of the package name used for tools like guix package and guix build.

Another great tool when writing package definitions is guix lint.

> 
> This way to do it it's good to learn how to extend packages and maybe
> beggining packagings other things. But with the problem at hand
> shouldn't we use the package definition that guix has and is know to work?
> 
> Anyway for that I'll check the Björn answer. This one has it's own merits
> XD.
> 

Look forward to seeing how you end up solving this. :)

Tonton

  reply	other threads:[~2018-12-31 15:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27 19:52 rolling back only a single package cdelia
2018-12-28  7:55 ` Pierre Neidhardt
     [not found]   ` <7bbd5b5a38121bf9a70c1fbe095c39b8@dc.uba.ar>
2018-12-28 22:19     ` cdelia
2018-12-28 11:35 ` Tonton
2018-12-30 22:57   ` cdelia
2018-12-31 15:17     ` Tonton [this message]
2018-12-28 13:34 ` Björn Höfling
2018-12-28 14:49   ` Ricardo Wurmus
2018-12-31  7:11     ` cdelia
2018-12-31  8:23       ` Ricardo Wurmus
2018-12-30 23:37   ` cdelia
2018-12-31  0:59   ` cdelia
     [not found] ` <45406B3B-5E5F-4444-9679-A5DB43D9AE50@pretty.Easy.privacy>
2018-12-28 22:15   ` cdelia
2018-12-29 18:35     ` swedebugia
2018-12-30 22:40       ` Catriel Omar D'Elía

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181231161726.477cba83@merlin.browniehive.net \
    --to=tonton@riseup.net \
    --cc=cdelia@dc.uba.ar \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.