On Mon, Apr 17, 2017 at 12:47:38PM +0200, Luke Gorrie wrote: > On 17 April 2017 at 11:33, Luke Gorrie <l...@snabb.co> wrote: > > Fighting the VM build in another window. Just now I am able to build the > 32-bit VM from master and run both the Pharo 5 and Pharo 6 images. The > next > problem is the issue of accessing $HOME. The actual error is > ExternalLibraryFunction>>invokeWithArguments: failing to call getenv() > from > libc. Simplest way that I can reproduce it here is Smalltalk os > environment > at: 'HOME'. > > > I have resolved this now. > > The problem was the VM primitive ioLoadModule() not being able to find libc. > It > has some heuristics for where to look but they don't work on NixOS. I added > the > relevant folder into $LD_LIBRARY_PATH in my wrapper script and now it is > happy. > > There will be a lot of this in my future... finding hard-coded paths for > things > like shared libraries and un-hard-coding them. I am not sure what to do in > cases where the paths are in Smalltalk code inside an image, that's harder to > patch than the VM sources or ELF headers etc.
I've hit this as well building the snap package, e.g. CairoLibrary>>unixModuleName. I modified the method directly, but probably it would be better to create a UnixPlatform>>findLibrary: method to look after it centrally. Cheers, Alistair