Implement a FUSE filesystem mounted under /something and add /something to your PATH.
When invoking a command like go, if go is not found earlier in the PATH, the shell will check if /something/go exists, and the FUSE implementation will be asked if that file exists.
To answer that question, the FS will query the configured APK repo, find packages either named go, or that providescmd:go. There may be many different versions that match, but we'll just select the latest version of the package. Then it can install all the dependencies of that package, and the package itself, into some other location on disk, so it can be served from there for future invocations.
The result is, I can run my mounted FUSE filesystem, and invoke arbitrary commands which are downloaded and installed just-in-time.
Open Questions:
after installing package-a and its deps, I might install package-b and its deps, which may conflict in some way. Installing latest versions of everything seems like it should fix this, but package-b might require a specific version of a dep.
Implement a FUSE filesystem mounted under
/something
and add/something
to yourPATH
.When invoking a command like
go
, ifgo
is not found earlier in thePATH
, the shell will check if/something/go
exists, and the FUSE implementation will be asked if that file exists.To answer that question, the FS will query the configured APK repo, find packages either named
go
, or thatprovides
cmd:go
. There may be many different versions that match, but we'll just select the latest version of the package. Then it can install all the dependencies of that package, and the package itself, into some other location on disk, so it can be served from there for future invocations.The result is, I can run my mounted FUSE filesystem, and invoke arbitrary commands which are downloaded and installed just-in-time.
Open Questions:
package-a
and its deps, I might installpackage-b
and its deps, which may conflict in some way. Installing latest versions of everything seems like it should fix this, butpackage-b
might require a specific version of a dep.