iriscouch / build-couchdb

Batteries-included CouchDB build system
227 stars 36 forks source link

Any chance of a relocatable build? #35

Open timbertson opened 12 years ago

timbertson commented 12 years ago

Perhaps it's beyond the scope of this project, but I would love to be able to distribute couchdb using zero install. One property that is essential for 0install feeds (packages) is that they be relocatable once built.

After a fresh build, I cound 119 instances of /path/to/build hardcoded in the build/ directory. I don't know how many of them would prevent couchdb running if it were relocated, but I'm guessing it's quite a few.

I know you're using autotools, and I know that relocatable macros exist (e.g AX_COMPUTE_RELATIVE_PATHS), but that's about the limit of my applicable knowledge here. Is it likely to be even remotely possible to make couchdb relocatable?

jhs commented 12 years ago

The problem is that only some components use autotools. In fact, if everything used autotools (or any arbitrary common build system) then build-couchdb would barely have a reason to exist. Also, just because something uses autotools doesn't guarantee the developers cut zero corners and did everything by the book.

However, I have gotten relocatable builds working in the past, at least if a post-install script is permitted to run. If you can find the couchbase single server 1.x packages, check their post install script. That's my code, but I don't recall what license it's under. But anyway it's 20 lines of Bash or so and it simply searches and replaces all those paths once the installed location is known.

timbertson commented 12 years ago

Ahh, sadly that sort of thing won't do, at least for my interests - not only do 0install implementations have to be relocatable, they need to be read-only once built (since implementations are cryptographically signed, any modification will break the signature validity).

It would really need to use relative paths (or environment variables, at least as optional overrides for hard-coded paths), but not many people seem to end up with a build system like that :(

jhs commented 12 years ago

Yeah, well we could still look at the script and see if we could just fix all the bugs that it is papering over. I seem to recall it was only 4 or so files with this problem. Maybe they could be made to use relative paths. For example, the main "bin/couchdb" file has an absolute path, but it could probably be made to use a relative URL.

On Sat, Feb 25, 2012 at 12:06 PM, Tim Cuthbertson reply@reply.github.com wrote:

Ahh, sadly that sort of thing won't do, at least for my interests - not only do 0install implementations have to be relocatable, they need to be read-only once built (since implementations are cryptographically signed, any modification will break the signature validity).

It would really need to use relative paths (or environment variables, at least as optional overrides for hard-coded paths), but not many people seem to end up with a build system like that :(


Reply to this email directly or view it on GitHub: https://github.com/iriscouch/build-couchdb/issues/35#issuecomment-4172385

Iris Couch

timbertson commented 12 years ago

Sorry for taking so long to look at this, but I couldn't actually find any such script in the old releases. Don't suppose you have a link anywhere?