Hi Everyone, I have been exploring trying to use guix in a scenario where the machines may or may not have an internet connection to them. I maintain a fleet of non GuixSD machines which all have the same guix revision. As such i have been experimenting with 'guix archive' as a way to build packages, profiles on one machine and import them as is on another.
For a simple case such as building packages and them importing their nar closure on another machine, it works. I have even been able to figure out how to take a 'guix pull' or 'guix time-machine' on one machine and then import it to another machine for upgrades or for quickly having a time-machine operation without needing to wait for everything to pull and build on each machine. While trying to work with profiles made with manifests using 'guix package -p -m' i noticed some confusing behavior which i dont understand: Lets say I have machine A, I use guix time-machine with a certain channels file to make a profile with the following manifest: (specifications->manifest (list "lzo" "python" "python-lzo")) I use 'guix archive' to turn this profile and all its dependencies into a nar, then import it on another machine B. I have to rebuild the profile manually with linux commands like: ln -sv /gnu/store/qdziri4c8lx1pi0mmzhh913ab11p0lsr-profile ~/test_profile-1-link ln -sv ~/test_profile-1-link ~/test_profile I could additionally manually make the symlinks needed in /var/guix/gcroots/auto/ so that this profile doesnt get garbage collected. After doing this, on machine B, I try running 'guix time-machine -C /home/chris/channels-minimal.scm -- package -p ~/test_profile/ -m test_profile-manifest.scm' where 'test_profile-manifest.scm' is: (specifications->manifest (list "lzo" "python" "python-lzo" "python-redis")) What i would expect is, guix makes the second generation of test_profile, and would only pull from the internet "python-redis" as the rest of the packages were already present in the store. But guix starts pulling everything all over again from internet and I cant really figure out why. Because in theory, they are both using the same guix time-machine revision and as such when building packages will result in the same hashes, so it should work as expected On searching a bit more, a possible reason for this may be grafts? 'guix archive --export' when exporting the profile seems to only export all the gnu store directories after the packages were grafted. It wont export the ungrafted variants of the packages. So when you run even just 'guix time-machine -C /home/chris/channels-minimal.scm -- package -p ~/test_profile/ -m test_profile-manifest.scm' where 'test_profile-manifest.scm' was the original list of just lzo, python, python-lzo, guix will still pull all the ungrafted packages, then realize the grafts already exist and stop! Please do correct me if I am wrong on what ive found. If this is how it is, why doesn't guix know before hand what the final profile will be comprised of after grafts? is this correct behavior? Atleast in terms of use with guix archive, this defeats the point of trying to save bandwidth and seems like it can be improved Ive also noticed there are some additional packages related to making profiles, it doesnt seem like there is a way to list these packages in a way where you could export them such as how you could with 'guix gc --requisites' or is this list static? Regards, Christin
