Opened 7 weeks ago

Last modified 7 weeks ago

#1792 new defect

Some eggs install into system /share and /bin (even when CHICKEN_INSTALL_REPOSITORY is set); this fails when the directory is RO

Reported by: Norman Gray Owned by:
Priority: major Milestone: someday
Component: unknown Version: 5.2.0
Keywords: Cc:
Estimated difficulty:

Description

I'm using Nixpkgs (hence the paths below), but the same would be true in another case when the system /share is for whatever reason not expected to be writable by chicken-install.

Since .../share is expected to be read-only in this context, I've defined a separate repository for eggs to be installed in:

CHICKEN_REPOSITORY_PATH=$HOME/.chicken-install:/nix/store/1sy3rv81crwlviknmqnfs1cwz3bbqr1g-chicken-5.2.0/lib/chicken/11
CHICKEN_INSTALL_REPOSITORY=$HOME/.chicken-install
CHICKEN_INCLUDE_PATH=/nix/store/na72pj8gy1gyqd0llz6myvk8dzd4q5i0-compiler-rt-libc-7.1.0/share:/nix/store/1sy3rv81crwlviknmqnfs1cwz3bbqr1g-chicken-5.2.0/share

That works OK for several eggs, but srfi-29 fails:

      installing srfi-29
    mkdir: cannot create directory ‘/nix/store/1sy3rv81crwlviknmqnfs1cwz3bbqr1g-chicken-5.2.0/share/chicken/srfi-29-bundles’: Permission denied

and sure enough, $HOME/.cache/chicken-install/srfi-29/srfi-29.install.sh includes

    mkdir -p ${DESTDIR}'/nix/store/1sy3rv81crwlviknmqnfs1cwz3bbqr1g-chicken-5.2.0/share/chicken'
    mkdir -p ${DESTDIR}'/nix/store/1sy3rv81crwlviknmqnfs1cwz3bbqr1g-chicken-5.2.0/share/chicken/srfi-29-bundles'
    install -m 644 '/Users/norman/.cache/chicken-install/srfi-29/srfi-29-bundles/srfi-29' ${DESTDIR}'/nix/store/1sy3rv81crwlviknmqnfs1cwz3bbqr1g-chicken-5.2.0/share/chicken/srfi-29-bundles'

That is, it seems to unconditionally want to install in the system share directory.

The same is true of some other eggs (I'm not sure this is an exhaustive list: Kon Lovett on-list suggested that these, like srfi-29, specify a 'data files’ component to the extension, which chicken-install places in '(chicken-home)’):

sqlite3: tried to install stuff into system /share

spock and manual-labor: tried to install stuff into system /bin and /share

In case anyone isn't aware NixOS, and Nixpkgs as a package system for other OSs, is predicated on the idea that the system directories are owned entirely by the Nix system, so that .../share/FOO is out of bounds. I'm using Nixpkgs 2.3.16 on macOS 11.6, though I don't think either of those versions is relevant to the issue).

Change History (2)

comment:1 Changed 7 weeks ago by evhan

The location of these files can be controlled by CHICKEN_INSTALL_PREFIX. This is what the Nix helpers in the beaker egg use, for example, to make sure these files end up in the build directory.

Interestingly this isn't documented so it might not be intended for end users to change, I'm not sure. But either way files like these go in a different location than the ones that get stuffed into the egg repository (the thing controlled by CHICKEN_INSTALL_REPOSITORY).

comment:2 Changed 7 weeks ago by Norman Gray

I'd guessed that there had to be something that Nixpkgs was doing, to let things like beaker work, but couldn't find anything that seemed relevant on on http://wiki.call-cc.org/man/5/Extension%20tools and in particular CHICKEN_INSTALL_PREFIX isn't mentioned there.

So if this is indeed a supported feature, this might come down to being a documentation issue.

I'm not fluent in the Nix language, so I don't really know what the beaker script is doing, there, other than in rather broad terms.

Note: See TracTickets for help on using tickets.