[Rubygems-developers] Two feature requests
batsman.geo at yahoo.com
Thu Sep 23 06:06:04 EDT 2004
On Thu, Sep 23, 2004 at 01:42:22AM -0400, Gavin Sinclair wrote:
> Assaph wrote:
> >> One of these, Chad knows about. The other is sorta new.
> > Here's another request: Allow running a post-install script. This will
> > alleviate the need to specify in the docs that the user must run the
> > script to finish the install (e.g. the rubygems-update gem).
> > Attached is a sample implementation (vs. todays cvs) and a test gemspec.
> > Please feel free to accept/modify/ignore, but comments are always
> > welcome :-)
> I disapprove of post-install scripts. They're convenient but they're a
> leaky abstraction. RubyGems is a terrific technology, but it shouldn't
> take over your computer. It shouldn't do anything that it doesn't know
> how to undo -- that's one reason library stubs sucked and why handling of
> application stubs needs slight improvement.
"Philosophical" issues asside, implementing post-install scripts can be
fairly involved because
* it's a sexy feature with ample potential for breakage; for instance, in
Assaph's implementation, system("ruby ...") will fail in several
platforms (e.g. in some Debian archs it's installed as ruby1.8). This
sort of assumptions slip into post-install scripts very easily and
could cause errors which are hard to trace
* you have to ensure the scripts are idempotent
* what should happen if the script fails? (assuming that can be detected,
which is often not the case) RubyGems is not atomic in that sense.
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
More information about the Rubygems-developers