all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Timothy Sample <samplet@ngyro.com>
To: "Pierre-Henry F." <contact@phfrohring.com>
Cc: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: Re: Help defining a trivial package.
Date: Wed, 04 Sep 2019 13:34:15 -0400	[thread overview]
Message-ID: <875zm8ynhk.fsf@ngyro.com> (raw)
In-Reply-To: <i0glmLrRfBnGVayM9zM5QB7sug0WXoefQd4MJDk0LAp6s3loJOVgLaprdklxP58FFq5Zv9V44bB3Izp7m70ggTjWKcjF1OYjLbewVYQwVSY=@phfrohring.com> (Pierre-Henry F.'s message of "Wed, 04 Sep 2019 11:21:41 +0000")

Hello!

I’m glad the Python code was helpful.  :)  I’ve commented on some of
your other points below.

"Pierre-Henry F." <contact@phfrohring.com> writes:

> Development:
>
>     $ guix environment --manifest=./guix/manifest.scm --pure --container
>     $ # Develop things. Add dependencies at will in manifest.scm
>
>
> Build release:
>
>     $ ./deployment/make_release
>     Built release: release_4.tar.lz
>
>
> Deployment:
>
>     $ guix build --keep-failed --verbosity=2 --file=./blog.scm
>     …
>     /gnu/store/…-blog-4
>
>
> Test:
>
>     $ /gnu/store/…-blog-4/bin/program
>     Hello world!
>
>
> What would be very helpful:
>
>     - Define blog.scm such that ~$ guix environment blog~ has the same effect as
>       ~$ guix environment --manifest=./guix/manifest.scm --pure --container~

This really depends on what’s in “manifest.scm”.  If it contains tools
for building the blog, it would be same, but I take it that
“manifest.scm” has tools for hacking on the blog, too (like editors or
whatever).  In this case, it’s actually a feature that they’re separate.
It keeps the build and runtime time dependencies apart from the
development dependencies.  You can always combine the two, so that
“manifest.scm” only has to contain the extra stuff:

    guix environment --pure --container \
        -l blog.scm --ad-hoc -m manifest.scm

This will pull in all the build and runtime dependencies of the package
defined in “blog.scm” plus all the extra tools from “manifest.scm”.

>     - Define a package ~blog_executable.scm~ derived from ~blog.scm~ such that
>       ~$ guix package -i blog_executable~ has the same effect has
>       ~$ guix build --file=./blog_v2.scm~, but actually install the thing.
>
>       ~blog_executable.scm~ is essentially ~blog.scm~ but stripped down to the bare
>       minimum to get the executable working.

This is definitely possible.  All you need to do is make sure that the
package defined in “blog_executable.scm” has its source field set
properly.  What I’ve done in the past is use Guile-Git to use all of the
files that Git knows about as the source of the package.  This makes
sure transient build artifacts are not included (since they are likely
ignored by Git).  If you like, take a look at this file:

    https://git.savannah.nongnu.org/cgit/gash.git/tree/guix.scm

It is the main Guix package definition that I use when developing Gash
(a shell written in Guile that I maintain).  If you clone the repo, you
can run “guix package -f guix.scm” to build and install Gash from the
latest Git sources (the ones you just cloned).  There are two things to
note, though.  First, if you use it for testing the build, it can get
confusing as to which files are included: is it files in the working
tree, files in the index, or files from the latest commit?  I honestly
get confused and miss things all the time!  The second thing is that
since I wrote that package definition, Guix got a procedure called
“git-predicate” in “(guix git-download)” that does basically the same
thing as my “make-select”.  I recommend using the Guix procedure if
possible, I just haven’t looked into it yet.  :)

> If all the above is true then I hope that we (multiple devs) can have the guarantee
> to have the same dev environment and a simple deployment build that's just the
> development environment minus dev dependencies.
>
> With these things in place, a deployment should be deterministic and as simple as a:
>
>     $ guix package -i blog_executable
>
>
> To sum up, here are the questions I try to answer:
>
>     - How to define ~blog.scm~ such that ~$ guix environment blog~ works?
>     - How to define ~blog_executable.scm~ such that ~$ guix package -i blog_executable~ works?

I hope what I wrote above helps answer these questions!


-- Tim

      reply	other threads:[~2019-09-04 17:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 19:42 Help defining a trivial package Pierre-Henry F.
2019-08-25 12:17 ` Timothy Sample
2019-08-29 11:23   ` Pierre-Henry F.
2019-08-29 15:26     ` Timothy Sample
     [not found]       ` <Al-P-mUDUQnoUvF4kgNS_NeITvHjEDEvxG8Gmk9aMiXX2FTUfL0lbZAq5h4m54GIGNXPwM271CzLWwt5sgOt1JI6Z1wxqxSwWmpnPHu7I5A=@phfrohring.com>
2019-09-03  1:58         ` Timothy Sample
2019-09-04 11:21           ` Pierre-Henry F.
2019-09-04 17:34             ` Timothy Sample [this message]

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=875zm8ynhk.fsf@ngyro.com \
    --to=samplet@ngyro.com \
    --cc=contact@phfrohring.com \
    --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.