unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Ignore / Exclude files and directories in a package definition
@ 2021-09-12 18:10 Zelphir Kaltstahl
  0 siblings, 0 replies; only message in thread
From: Zelphir Kaltstahl @ 2021-09-12 18:10 UTC (permalink / raw)
  To: help-guix

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-12 18:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 18:10 Ignore / Exclude files and directories in a package definition Zelphir Kaltstahl

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