Hi,
On 2026-08-06 10:12, Untrusem wrote:
As it takes around 40 mins to build scheme bytecode files, I don't do
that and this makes feedback loop hella slow.
Every guix command `import, build, shell` will take around 10mins just
to first find the <package,file> and then start the operation.
for instance, `./pre-inst-env guix import -i <some file> go -r
<some-package>` would
take over 20 mins or more depending on the package, it doesn't even
matter if you use `-e "(@@ (gnu packages <file>) <package>)"` to
pinpoint stuff while building.
From my experience the guix commands given after `pre-inst-env` are
doing the byte code compilation when necessary, but they are not saving
the byte code compiled .go files next to the .scm files, `make` on
the other hand does. So if the commands after `pre-inst-env` are
taking a lot of time, and are printing a lot of lines like:
;;; note: source file
/home/user/Repositories/Public/guix/guix/gnu/packages/databases.scm
;;; newer than compiled
/home/user/Repositories/Public/guix/guix/gnu/packages/databases.go
;;; note: source file
/home/user/Repositories/Public/guix/guix/gnu/packages/dns.scm
;;; newer than compiled
/home/user/Repositories/Public/guix/guix/gnu/packages/dns.go
then only `make` can help you. And it really does help, the guix
commands after pre-inst-env are supposed be as quick as the regular
ones, and you are only supposed to see lines like above for the files
you are actually working on. This took me a while to realize.
What usually happens is, that by switching branches, git will modify
the .scm files, and they will appear newer, even though the content
stays the same. Eg. switching branches, but then rebasing on top of
the same branch `make` was running just a few moments ago.
There are two tactics to prevent this from happening:
1. Use git worktrees. Some contributors do, hopefully they will share
their workflow, I do not use them.
2. Use the `git-restore-mtime` command from the `git-tools` package.
This tool will reset the mtime for all the files tracked by git to the
timestamp of their last commit. And it is fast, it takes 16 seconds
for me on the guix repo (once guix shell is already cached). Eg.:
```
guix shell git-tools -- git-restore-mtime
```
But be aware that this also resets the timestamps of the files you are
working on (and maybe not commited yet), so you might need to manually
`touch` those, in order to actually use the freshly edited .scm files
instead of the .go files.
On 2026-08-06 10:12, Untrusem wrote:
- `make` takes upto 30-40 mins to compile guix checkout
- {import,build,shell} takes upto 10-20 mins
Yes, `make` indeed can take 40 minutes, but it saves the byte
compiled .go files, and if you make sure that the .scm files stay
older than the .go files, then the guix commands after `pre-inst-env`
should be just as quick, as the regular guix commands. You can erase
the 10-20 minutes from the 2nd point, and the feedback loop will be
more satisfying.
Best regards,
Gabor