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";
�� �� sha256 ��= "0y5yqmb2hjfya2s4a8pkrz0q6pdm01vrfhvfj5knk6slgsy8c2my"; }
�� { name �� ��= "Neo-JSON-Core-SvenVanCaekenberghe.37";
�� �� package = "Neo-JSON-Core-SvenVanCaekenberghe.37";
�� �� sha256 ��= "054hcp1lcriby5a8gpc54gcrd9agbpjv6f0n81bk7f091n9m01z0"; }
�� { name �� ��= "Neo-JSON-Tests-SvenVanCaekenberghe.36";
�� �� package = "Neo-JSON-Tests-SvenVanCaekenberghe.36";
�� �� 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.
Any advice to make this work?
(Could I perhaps bypass Metacello entirely and just load the mcz files directly? Guessing not...?)