* Guix direct checkout hacking
@ 2019-03-16 11:24 Giovanni Biscuolo
2019-03-16 11:54 ` Danny Milosavljevic
0 siblings, 1 reply; 3+ messages in thread
From: Giovanni Biscuolo @ 2019-03-16 11:24 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 4819 bytes --]
Hi Guix!
I'm learning to hack Guix following Pierre Neidhardt (kudos!) tutorial
[1] and the contributing section [2] of the manual
I want to hack Guix in my local working dir ($GUIX_CHECKOUT in the
tutorial) cloned while ago and periodically updated, I'd also like to do
my testing in a *separate* dedicated subdirectory,
e.g. $GUIX_CHECKOUT/packaging-tutorial for *strong* separation of my
high-volatile-and-useless tests from upstream (and I'm too lazy to setup
a channel for this simple use-case)
I still don't use "The Perfect Setup" because I want to do this "the
hard way" :-), aka using a simple terminal application (no eshell) and
the command line
I've some question and comments...
1. the hacking environment (aka "Building from Git)
I regurarly "git pull" in $GUIX_CHECKOUT and then "guix environment
guix": is it sufficient and necessary to "/.bootstrap" and then
"/.configure" every time I enter the environment in order to have a
working build environment?
Do I really need to "make check" every time I "activate" the devel
environment or after every "git pull" of my $GUIX_CHECKOUT?
Do I neeed to regurarly "make clean-go" to get rid of compiled .go or I
can ignore this step? If this step should be regurarly done: when?
(this is not documented, just my curiosity)
2. building (aka Running Guix Before It Is Installed)
I start the build daemon in the environment:
sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
The above command starts the deamon in foreground and should be
"manually" backugrounded (CTRL-Z && bg %<n>) to be able to continue to
use the environment: further hacking *cannot* be done in another
termininal, out of the environment configured in 1.
Furthermore, the guix-deamon process started in the environment must be
"manually killed" at the end of the "hacking session" (exit the
environment): right?
Should this be documented in the "7.2 Running Guix Before It Is
Installed" section of the manual?
Lastly, testing the building of the hello packages, gives me this error:
--8<---------------cut here---------------start------------->8---
(anemone)[~/{git}/giovanni.biscuolo.net/guix]-
giovanni@anemone: time ./pre-inst-env guix build hello
;;; note: source file /home/giovanni/{git}/giovanni.biscuolo.net/guix/guix/config.scm
;;; newer than compiled /home/giovanni/.cache/guile/ccache/2.2-LE-8-3.A/home/giovanni/{git}/giovanni.biscuolo.net/guix/guix/config.scm.go
accepted connection from pid 8872, user giovanni
substitute: ;;; note: source file /home/giovanni/{git}/giovanni.biscuolo.net/guix/guix/config.scm
substitute: ;;; newer than compiled /home/giovanni/.cache/guile/ccache/2.2-LE-8-3.A/home/giovanni/{git}/giovanni.biscuolo.net/guix/guix/config.scm.go
substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
building /gnu/store/5fb2krx4aw8i54q066x16a1k6axf0cxm-hello-2.10.tar.gz.drv...
error: failed to run download program '/home/giovanni/{git}/giovanni.biscuolo.net/guix/nix/scripts/download': Permission denied
builder for `/gnu/store/5fb2krx4aw8i54q066x16a1k6axf0cxm-hello-2.10.tar.gz.drv' failed with exit code 1
build of /gnu/store/5fb2krx4aw8i54q066x16a1k6axf0cxm-hello-2.10.tar.gz.drv failed
View build log at '/usr/local/var/log/guix/drvs/5f/b2krx4aw8i54q066x16a1k6axf0cxm-hello-2.10.tar.gz.drv.bz2'.
cannot build derivation `/gnu/store/7b0rzwcbdml7z4njkv8jw7qb60y3hzra-hello-2.10.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/7b0rzwcbdml7z4njkv8jw7qb60y3hzra-hello-2.10.drv' failed
Some deprecated features have been used. Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information. Set it to "no" to suppress
this message.
--8<---------------cut here---------------end--------------->8---
what am I doing wrong?
I got the same error even after deleting
/home/giovanni/.cache/guile/ccache/2.2-LE-8-3.A/home/giovanni/{git}/giovanni.biscuolo.net/guix/guix/config.scm.go
I triple checked the "Running Guix Before It Is Installed" [3] section
of the manual and did all described in 1. tree times, I still cannot
figure out if I'm doing something wrong
I suspect I have a problem with the build process started in the
environment, but still don't know what and how to solve
(end of the first part)
Thanks!
Giovanni
[1] https://guix.info/blog/2018/a-packaging-tutorial-for-guix/
[2]
https://www.gnu.org/software/guix/manual/en/html_node/Contributing.html#Contributing
[3] https://www.gnu.org/software/guix/manual/en/html_node/Running-Guix-Before-It-Is-Installed.html#Running-Guix-Before-It-Is-Installed
--
Giovanni Biscuolo
Xelera IT Infrastructures
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Guix direct checkout hacking
2019-03-16 11:24 Guix direct checkout hacking Giovanni Biscuolo
@ 2019-03-16 11:54 ` Danny Milosavljevic
2019-03-16 14:39 ` Giovanni Biscuolo
0 siblings, 1 reply; 3+ messages in thread
From: Danny Milosavljevic @ 2019-03-16 11:54 UTC (permalink / raw)
To: Giovanni Biscuolo; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 2282 bytes --]
Hi,
On Sat, 16 Mar 2019 12:24:27 +0100
Giovanni Biscuolo <g@xelera.eu> wrote:
> I regurarly "git pull" in $GUIX_CHECKOUT and then "guix environment
> guix": is it sufficient and necessary to "/.bootstrap" and then
> "/.configure" every time I enter the environment in order to have a
> working build environment?
Not really. Only if dependencies get added or removed, or some
variables in the Makefiles get added or removed.
Personally, I'm too lazy to bootstrap every time. But I ./configure
pretty often ("./configure --localstatedir=/var").
> Do I really need to "make check" every time I "activate" the devel
> environment or after every "git pull" of my $GUIX_CHECKOUT?
Not really, but later on, it's nice to know whether your change broke
something or whether it was broken to begin with. Personally, I don't
run "make check" until I need to. I often need to backtrack then :)
> Do I neeed to regurarly "make clean-go" to get rid of compiled .go or I
> can ignore this step? If this step should be regurarly done: when?
> (this is not documented, just my curiosity)
I never do exactly this, but that's because clean-go regularily leaves
".go" files anyway.
Why this is necessary in the first place:
The problem is that there's some inline-tracking missing in the guile
handler for go files, so it can happen that one go file inlined something
that is already changed in the other go file (especially with macros).
The former won't be automatically recompiled and then you get an ABI
mismatch / funny behavior / crashes at runtime.
In the real world, I don't delete all ".go" file every time--it would
take way too long to recompile.
But if there are strange things happening later, I delete them and
run "make" in order to rebuild them.
> I start the build daemon in the environment:
>
> sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
I never do this since the build daemon almost never changes. So I just
use the system build daemon.
> error: failed to run download program '/home/giovanni/{git}/giovanni.biscuolo.net/guix/nix/scripts/download': Permission denied
Hmm, what are the permissions of that file?
Did you generate it using the same user ? (via ./configure, I think).
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Guix direct checkout hacking
2019-03-16 11:54 ` Danny Milosavljevic
@ 2019-03-16 14:39 ` Giovanni Biscuolo
0 siblings, 0 replies; 3+ messages in thread
From: Giovanni Biscuolo @ 2019-03-16 14:39 UTC (permalink / raw)
To: Danny Milosavljevic; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 4344 bytes --]
Hi Danny,
Danny Milosavljevic <dannym@scratchpost.org> writes:
> Hi,
>
> On Sat, 16 Mar 2019 12:24:27 +0100
> Giovanni Biscuolo <g@xelera.eu> wrote:
>
>> I regurarly "git pull" in $GUIX_CHECKOUT and then "guix environment
>> guix": is it sufficient and necessary to "/.bootstrap" and then
>> "/.configure" every time I enter the environment in order to have a
>> working build environment?
>
> Not really. Only if dependencies get added or removed,
bootstrap deps or packages deps (inputs)?
> or some variables in the Makefiles get added or removed.
OK, got it thanks
> Personally, I'm too lazy to bootstrap every time. But I ./configure
> pretty often ("./configure --localstatedir=/var").
uh: --localstatedir is **mandatory**
it defaults to /usr/local/var [1] as documented in GNU Coding Standards
7.2.5 [2] while I thought it defaulted to /var (GNU Coding Standards
it's another *really should* read to be a proficient Guix hacker, no?)
should we better document in
https://www.gnu.org/software/guix/manual/en/html_node/The-Store.html#The-Store?
that if not specified --localstatedir defaults to /usr/local/var as for
above mentioned coding standards?
>> Do I really need to "make check" every time I "activate" the devel
>> environment or after every "git pull" of my $GUIX_CHECKOUT?
>
> Not really, but later on, it's nice to know whether your change broke
> something or whether it was broken to begin with. Personally, I don't
> run "make check" until I need to. I often need to backtrack then :)
OK, got it thanks
>> Do I neeed to regurarly "make clean-go" to get rid of compiled .go or I
>> can ignore this step? If this step should be regurarly done: when?
>> (this is not documented, just my curiosity)
[...]
> In the real world, I don't delete all ".go" file every time--it would
> take way too long to recompile.
>
> But if there are strange things happening later, I delete them and
> run "make" in order to rebuild them.
OK got it, thanks
>> I start the build daemon in the environment:
>>
>> sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
>
> I never do this since the build daemon almost never changes. So I just
> use the system build daemon.
eh... got in now, too :-)
I thought I needed to start a separate daemon to be able to build, see [2]
>> error: failed to run download program '/home/giovanni/{git}/giovanni.biscuolo.net/guix/nix/scripts/download': Permission denied
>
> Hmm, what are the permissions of that file?
-rwxr-xr-x 1 giovanni giovanni 272 Mar 16 15:08 nix/scripts/download
> Did you generate it using the same user ? (via ./configure, I think).
yes
OK, so I reconfigured via "./configure --localstatedir=/var" and now:
--8<---------------cut here---------------start------------->8---
giovanni@anemone: time ./pre-inst-env guix build --verbosity=5 hello
guix build: error: getting attributes of path `/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz': No such file or directory
Some deprecated features have been used. Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information. Set it to "no" to suppress
this message
--8<---------------cut here---------------end--------------->8---
solved this with
--8<---------------cut here---------------start------------->8---
giovanni@anemone: guix gc --verify
reading the store...
checking path existence...
path `/gnu/store/5c88v80zi7gm928ajn739lnz5vc7vkfg-glibc-2.28.tar.xz' disappeared, removing from database...
path `/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz' disappeared, removing from database...
--8<---------------cut here---------------end--------------->8---
and now hello builds
Thanks!
[1] I fully realized this when running
--8<---------------cut here---------------start------------->8---
giovanni@anemone: ./pre-inst-env guix build hello
guix build: error: failed to connect to `/usr/local/var/guix/daemon-socket/socket': Connection refused
--8<---------------cut here---------------end--------------->8---
in the "guix build" environment
[2] https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables
--
Giovanni Biscuolo
Xelera IT Infrastructures
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-16 14:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-16 11:24 Guix direct checkout hacking Giovanni Biscuolo
2019-03-16 11:54 ` Danny Milosavljevic
2019-03-16 14:39 ` Giovanni Biscuolo
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).