I have done some work on packaging up pharo projects for Nix so that images can be created in the sandboxed build environment. I am a bit stuck though.

I have a script that takes a project named and creates a specification of all the required mcz files, recursing into dependencies:

Here is the spec for a small project, NeoJSON:

[
�� { name �� ��= "ConfigurationOfNeoJSON-SvenVanCaekenberghe.20";
�� �� package = "ConfigurationOfNeoJSON-SvenVanCaekenberghe.20";
�� �� url �� �� = "http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo30/main//ConfigurationOfNeoJSON-SvenVanCaekenberghe.20.mcz";
�� �� sha256 ��= "0y5yqmb2hjfya2s4a8pkrz0q6pdm01vrfhvfj5knk6slgsy8c2my"; }
�� { name �� ��= "Neo-JSON-Core-SvenVanCaekenberghe.37";
�� �� package = "Neo-JSON-Core-SvenVanCaekenberghe.37";
�� �� url �� �� = "http://mc.stfx.eu/Neo/Neo-JSON-Core-SvenVanCaekenberghe.37.mcz";
�� �� sha256 ��= "054hcp1lcriby5a8gpc54gcrd9agbpjv6f0n81bk7f091n9m01z0"; }
�� { name �� ��= "Neo-JSON-Tests-SvenVanCaekenberghe.36";
�� �� package = "Neo-JSON-Tests-SvenVanCaekenberghe.36";
�� �� url �� �� = "http://mc.stfx.eu/Neo/Neo-JSON-Tests-SvenVanCaekenberghe.36.mcz";
�� �� sha256 ��= "1c3nxi09l785npjypjmzcn5bhy5sswp1agj7pfqs640vg7l80l4k"; }
]

Nix then uses this to construct a package cache directory with a local copy of each mcz file:

$ ls -1 /nix/store/41jbwrsdpcvh684ll3qqk9lcfrrvxy59-pharo-package-cache/
ConfigurationOfNeoJSON-SvenVanCaekenberghe.20.mcz
Neo-JSON-Core-SvenVanCaekenberghe.37.mcz
Neo-JSON-Tests-SvenVanCaekenberghe.36.mcz

So this looks promising: I have all the code and should be able to load it without using the network.

However - I do in practice get an error when I try to do this. I guess Metacello wants to access the network for some reasons I have not anticipated.

Here is my script:

Metacello new
�� configuration: 'NeoJSON';
�� cacheRepository: '/nix/store/rdy7wp3cx4z86wy537idkhjb0q70xzjp-pharo-package-cache/';
�� ignoreImage;
�� load.
Smalltalk saveAs: 'pharo'.
Smalltalk exitSuccess.

and my Metacello error here:��https://gist.github.com/lukego/ab105c257457e7b9a53f6378425df9a8

Any advice to make this work?

(Could I perhaps bypass Metacello entirely and just load the mcz files directly? Guessing not...?)