Thanks, Tobias. I am now properly populating the store. I have switched to using 'guix graph --type=derivation' to pull in what seems to be the full set of dependencies. I am seeing a strange issue when importing a package. I can typically duplicate and import a file and it is copied to the original location, for example:

----------------------------------------
$ cp -a /gnu/store/v2zls012iwxyw6058cir7n2b792lsvc9-perl-5.30.2.tar.gz perl-5.30.2.tar.gz
$ guix download perl-5.30.2.tar.gz
/gnu/store/v2zls012iwxyw6058cir7n2b792lsvc9-perl-5.30.2.tar.gz
128nfdxcvxfn5kq55qcfrx2851ys8hv794dcdxbyny8rm7w7vnv6

$ cp -a /gnu/store/17acz7ks1f7xn6yp1a2y4g7vc6bhr8wc-make-3.82.tar.gz make-3.82.tar.gz
$ guix download make-3.82.tar.gz
/gnu/store/17acz7ks1f7xn6yp1a2y4g7vc6bhr8wc-make-3.82.tar.gz
1rs2f9hmvy3q6zkl15jnlmnpgffm0bhw5ax0h5c7q604wqrip69x
----------------------------------------

For the Python-3.5.9 tarball the first version loads in the expected way. The second tarball is restored to a new location:

----------------------------------------
$ cp -a /gnu/store/f99fblkzb6ip268sg096shhs7wzjyp55-Python-3.5.9.tar.xz Python-3.5.9.tar.xz
$ guix download Python-3.5.9.tar.xz
/gnu/store/f99fblkzb6ip268sg096shhs7wzjyp55-Python-3.5.9.tar.xz
0jdh9pvx6m6lfz2liwvvhn7vks7qrysqgwn517fkpxb77b33fjn2

$ cp -a /gnu/store/nj79fxxl5wvnq7jpj2wgbx0591gkjw41-Python-3.5.9.tar.xz Python-3.5.9.tar.xz
$ guix download Python-3.5.9.tar.xz
/gnu/store/9sa83nyjlm5dyhwys4imm1wa40mjaw1x-Python-3.5.9.tar.xz
0rkn451qfz3gbni57la00a5fbgish9jmm5bmhmgmf223vxwya447
----------------------------------------

Since the tarball is not restored to the original location the guix build command still attempts the download and fails the offline build.

Greg Hogan

On Fri, Dec 11, 2020 at 9:42 PM Tobias Geerinckx-Rice <me@tobias.gr> wrote:
Hullo Greg,

Greg Hogan 写道:
> If there is a better way to setup / configure / execute offline
> builds
> please let me know!

...yes :-)

> I am attempting an offline build without success. I have a Guix
> 1.2.0 node
> with internet access on which I download sources with transitive
> dependencies:
>   $ guix build --sources=transitive tzdata > ~/transfer

OK.

> I then copy the files as root to a Guix 1.2.0 node without
> internet access
> (only local network access):
>   # cat /home/<user>/transfer | xargs -n 1 -I{} scp -p {}
>   <ip>:{}

Now you've basically reinvented ‘guix copy --to=<ip>’, but in a
way that won't update the store database in /var/guix/db.  I'm
afraid that won't work.

Guix won't ‘see’ the files you copy to the remote store and will
consider them G to be C'd next time you run ‘guix gc’.  Or in this
case:

> Guix starts downloading and the transferred file is gone!

Same thing.

> I'm lost as to
> why a new download attempt is made as the file data and
> timestamps match
> the original server.

If the file isn't registered in the database, the store item is
never considered valid.  Guix doesn't (yet) care about the
data/timestamps at this point.

If there's a reason you can't/won't use ‘guix copy’, you might
work around that by copying each file in ~/transfer to, say,
<ip>:/tmp/staging (instead of <ip>:/gnu/store), then running ‘guix
download /tmp/staging/<file>...’ on the remote host.

Kind regards,

T G-R