Hacker News new | ask | show | jobs
by wycats 3733 days ago
All package managers (that I know of) for dynamic languages offer a mechanism for compiling native code for packages that include bindings to C libraries.

That mechanism could easily be used to achieve the same goal, even if there was no explicit "post-script" mechanism.

1 comments

Debian solved this particular problem a long time ago, with pbuilder(1): packages that are installed "from source" simply get compiled in a chroot. Strangely, nobody has ever copied the idea.

The modern hipster-language equivalent would probably be to make the package manager depend on the presence of Docker/rkt/systemd, and use it to pull down a dev-env container and build the native bindings in that.

Nix/NixOS - everything is build not only in a chroot, but also in various namespaces. Of course that doesn't help if you actually use a package (directly or indirectly) hence executing it outside of the build chroot.
Similar with Gobolinux, iirc. With a union mount on top to redirect the files written during the install step.

Afterwards the sub-directory in /Programs can basically be turned into an archive for future installs.

the problem with relying on chroot is that (AFAIK) it might not be available on all platforms supported by the language-specific package managers.
The new Docker runs on Microsoft Hyper-V and on Mac's equivalent. So that would actually be a solution.
in a very restricted sense maybe, but for example perl's CPAN also supports stuff like HP-UX, AIX, z/OS, NonStop and OS/400[0].

[0] http://www.cpan.org/ports/

Don't give them ideas!