nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.82k stars 215 forks source link

Autotools #36

Closed worr closed 10 years ago

worr commented 10 years ago

Added autotools and added reallocarray(3) from OpenBSD to ensure that realloc can safely be called without worrying about integer overflow issues.

nelhage commented 10 years ago

I'm really not excited about adding autotools. It's an awful lot of complexity that mostly doesn't add much, since reptyr is super-unportable regardless. I really value having the simple "just run make" build.

If we want reallocarray -- which I agree with in general, but it seems more stylistic here, since I don't think you can possibly have that many fd's -- I'd probably just inline it as "xreallocarray" or some other name, instead of sucking in all that complexity.

worr commented 10 years ago

I'm trying to do some work to make reptyr a bit more portable, and this was the first logical step to doing so.

Yeah, I'll admit that it is highly unlikely that you'd encounter integer overflowing multiplying no. fds, but this struck me as safer, regardless.

If you don't want to go down the portable road, I can just write/include xreallocarray and use that instead.

nelhage commented 10 years ago

@worr I'd be happy to see a more-portable reptyr (OOC, what platform(s) are you hoping to target?), but I'd rather hold off on the full-autotools route until it's clear we're getting value from it. My suspicion is that even if we added a (e.g.) FreeBSD port, we could get away with one file of definitions for Linux, and one for FreeBSD, and a simple conditional inclusion. The real value of autoconf is if there are N different axes along which platforms can be different, and you want to consider each of them individually.

worr commented 10 years ago

My eventual goal is Solaris 10, as I want to deploy it at my site which is a mixed RHEL and Solaris env.

I'll ditch autotools for now, unless it becomes absolutely necessary for my portability concerns.

nelhage commented 10 years ago

Cool, I'd love to see that. And I'm definitely open to autotools if it provides clear wins, I just prefer to avoid it until then, since the pure-'make' build flow is so much simpler.

I'm going to close this for now; Feel free to open another PR for either xreallocarray or similar, or for Solaris support as that developers!

nelhage commented 10 years ago

Cool, I'd love to see that. And I'm definitely open to autotools if it provides clear wins, I just prefer to avoid it until then, since the pure-'make' build flow is so much simpler.

I'm going to close this for now; Feel free to open another PR for either xreallocarray or similar, or for Solaris support as that developers!