guix-devel
[Top][All Lists]
Advanced

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

Re: Store channel specification in profile


From: Pierre Neidhardt
Subject: Re: Store channel specification in profile
Date: Sat, 08 Feb 2020 18:09:44 +0100

Ludovic Courtès <address@hidden> writes:

> Turns out I just watched your talk (since I couldn’t be there at the
> time!).  I was surprised you didn’t explicitly mention ‘guix search’ and
> the shortcomings you’d like to address (well, not directly), but I liked
> the perspectives!

I guess I took "guix search" for granted and assumed everyone knew what
I was talking about :p

> I would, however, use sexps as a serialization format.  Compared to an
> API, an object serialized to an sexp has the advantage that we can write
> code to handle changes in the serialization format, so it’s future-proof
> if we get it right.  But then: we’re back to ‘manifest’.  :-)
>
> I hope this is a bit clearer, but I realize it’s tricky to discuss such
> things!

Indeed, because we were on the same page all along: my "keyed code snippet"
was about the serialization format, not the data structure!

So agreed on all points here.

> ‘manifest’ looks like this:
>
>   (manifest
>     (version 3)
>     …)
>
> We have an explicit ‘read-manifest’ procedure that can handle version 3,
> but also prior versions, and this is all transparent.
>
> You cannot do that with code.  Code is just evaluated, and if it’s
> incompatible, if fails in some unspecified way.

Same thing, what I had in mind was to store the version number in the
_serialized_ specifications.scm, as for the manifest.

This way I believe we can support multiple version for specifications.scm.
Am I missing something?

> I agree that ‘--export’ is less convenient.  Note that ‘guix system
> reconfigure’ does exactly what you have in mind: it stores a
> ‘channels.scm’ and a ‘config.scm’ file in the system (in addition to
> serialized & versioned metadata in the ‘provenance’ file) because that’s
> so convenient:
>
>   guix time-machine -C /run/current-system/channels.scm --
>     system build --save-provenance -C /run/current-system/configuration.scm

Nice example, thanks for sharing.

> But in this case it’s OK: ‘channels.scm’ uses a tiny teeny subset of the
> API, and ‘configuration.scm’ is evaluated in the right context where the
> APIs it expects are available.
>
> Does that make sense?
>
> We cannot do the same thing with profiles because of the possibly
> multiple provenances.

With the serialization I proposed, the provenance is serialize
per-package.  Do you think it would still be a problem?

> We could store package transformations as manifest entry properties.
>
> However, that’ll be an approximation: the exact implementation of
> ‘--with-input’, for instance, can vary over time.

Hmmm, even if we have the provenance?  If so, we could re-use a given
version of Guix to apply the transformation.  Maybe too
sophisticated for what it's worth.

> All I’m saying is that we can only approximate all these things.
> Because of that, it may make more sense to not over-engineer the thing
> and focus on making a rough approximation.

Absolutely.

> After all, the goal of the functionality we’re discussing is to allow
> users to move towards the declarative ‘manifest.scm’ style, right?

Yes, so I'll try to sum up what I want to achieve in one sentence:
"automate the textual serialization of profile specifications to
simplify their backup/deployment/reproduction".

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

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