unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: help-guix@gnu.org
Subject: Ignore / Exclude files and directories in a package definition
Date: Sun, 12 Sep 2021 18:10:53 +0000	[thread overview]
Message-ID: <d36e3252-1bbc-cadb-6122-60aa7af4f57a@posteo.de> (raw)

Hello Guix users,

I have another question about package definitions: How can I specify in a
package definition, that I want Guix to ignore some of the files and directories?

I wanted to update my package and thought: "Oh, I simply need to update the
version reference and the hash and that will be it!" but I did add a folder
called `guix-env` in which I usually put `manifest.scm`, `channels.scm` and
`env.sh`, a shell script, which gets me into a Guix environment, in which all
the dependencies listed in `manifest.scm` are installed from the channel
described in`channels.scm` using guix time machine.

When I test the installation of my updated package, Guix seems to pick up those
files and then shows errors in the logs:

~~~~
guix-env/channels.scm:1:6: warning: possibly unbound variable `channel'
guix-env/channels.scm:2:8: warning: possibly unbound variable `name'
guix-env/channels.scm:3:8: warning: possibly unbound variable `url'
guix-env/channels.scm:4:8: warning: possibly unbound variable `commit'
guix-env/channels.scm:6:8: warning: possibly unbound variable `introduction'
guix-env/channels.scm:7:10: warning: possibly unbound variable `make-channel-introduction'
guix-env/channels.scm:9:12: warning: possibly unbound variable `openpgp-fingerprint'
[ 1/13] Compiling...
wrote `/gnu/store/52bkbcm35rl647k3qlhb7q67p9wafxq2-guile-fslib-0.2.1/lib/guile/3.0/site-ccache/./file-reader.go'
[ 2/13] Compiling...
wrote `/gnu/store/52bkbcm35rl647k3qlhb7q67p9wafxq2-guile-fslib-0.2.1/lib/guile/3.0/site-ccache/./file-system.go'
[ 3/13] Compiling...
wrote `/gnu/store/52bkbcm35rl647k3qlhb7q67p9wafxq2-guile-fslib-0.2.1/lib/guile/3.0/site-ccache/./guix-env/manifest.go'
guix-env/manifest.scm:1:0: warning: possibly unbound variable `specifications->manifest'
[ 4/13] Compiling...
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Syntax error:
unknown location: unexpected syntax in form ()
process '/gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2/bin/guild guild compile -L . -o /gnu/store/52bkbcm35rl647k3qlhb7q67p9wafxq2-guile-fslib-0.2.1/lib/guile/3.0/site-ccache/./hall.go ././hall.scm -Wunbound-variable -Warity-mismatch -Wformat ' failed with status 256
~~~~

I am convinced, that this is, because at that point, there is no Guix context,
in which those things are defined, as Guix is processing a package and there
should not be any things defined, which do not belong to the package or are in
its inputs. But the thing is, I do not want Guix to pick up and look at those
files in the first place. I would like to put them on a ignore list.

I checked the following docs without finding any way of excluding the files:

(1) https://guix.gnu.org/manual/en/html_node/package-Reference.html
<https://guix.gnu.org/manual/en/html_node/package-Reference.html>

(2) https://guix.gnu.org/manual/en/html_node/Defining-Packages.html
<https://guix.gnu.org/manual/en/html_node/Defining-Packages.html>

(3) https://guix.gnu.org/manual/en/html_node/origin-Reference.html
<https://guix.gnu.org/manual/en/html_node/origin-Reference.html>

In theory I can always make a separate branch in my git repository of the
library and remove these files and then place the version tag on that branch,
but is it really necessary?

And also: If I exclude these files somehow, while keeping them on the commit in
the git repository of my library, do I need to change the guix hash calculation,
to also exclude them when the hash is calculated? I calculated the hash using
the following command inside the root directory of the library:

~~~~
guix hash --exclude-vcs --recursive .
~~~~

The library is at: https://notabug.org/ZelphirKaltstahl/guile-fslib
<https://notabug.org/ZelphirKaltstahl/guile-fslib>. If you look at the tags
`0.2.0` and compare with `0.2.1`, you can see the additional files, which I want
to exclude.

Best regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl


                 reply	other threads:[~2021-09-12 18:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=d36e3252-1bbc-cadb-6122-60aa7af4f57a@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).