help-guix
[Top][All Lists]
Advanced

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

Re: rolling back only a single package


From: cdelia
Subject: Re: rolling back only a single package
Date: Sun, 30 Dec 2018 19:57:06 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Tonton <address@hidden> writes:

> Hello, and welcome :)

Thanks!

>
> For packages where multiple versions are defined you can choose with
> address@hidden e.g. address@hidden for the oldest guile on my system. A
> simple way to see the versions is with the 'guix package --show=packagename'
> flag. e.g. 'guix package --show=guile' will give you an entry per guile
> version available.
>
> It seems you are looking for a version of a package where the previous
> definition was not kept on upgrade. Most likely because guix so far has not
> kept old versions of leaf packages (i.e. packages with no dependencies);
> which is why guile and python have several versions but xmobar has none.
>

ok

> I think the choice to not keep old definitions is to ease maintenance. But
> this might be a valid discussion to have as we move towards 1.0. Maybe we
> should have a policy of keeping one old version when we upgrade, as a kind of
> fallback.
>

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/

and I think that should be enough. Maybe we can add a convenience user
interface, to query what guix version/commit a certain package version
can be found.

> It occurs to me that maybe this is not a problem because of functional/purity
> aspect of guix, and the package just needs a better definition? idk.
>
> 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.

> 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 address@hidden
>
> 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?

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
-------------------------------------------------------------------------------------------------

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 address@hidden
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?


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.




reply via email to

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