shogo82148 / Redis-Fast

fast perl binding for Redis database
https://metacpan.org/release/Redis-Fast
Other
25 stars 21 forks source link

Use Alien::hiredis? #88

Open Grinnz opened 5 years ago

Grinnz commented 5 years ago

I created Alien::hiredis which is an Alien wrapper of the hiredis library for other modules to use. I wondered if you might consider using it as it confers a few advantages over the current build. It can use a system hiredis library if it's a sufficient version instead of building a new one; it can seamlessly handle things like making gmake available; and it separates those concerns of making the library available and keeping it up to date from this distribution (either via the system version or the version installed by Alien::hiredis).

The process of allowing or building versions of hiredis is controlled by the alienfile. Right now it allows any version 0.11.0 or newer and disallows 0.13.0 because of bugs in that version, but this can be adjusted. The only other consumer at present is Protocol::Redis::XS and I am open to suggestions for adjusting the system library versions allowed. Your usage of the Alien can also specify additional version restrictions, but you can only cause your Build.PL to abort, the decision to use the system version or build a new version occurs when installing Alien::hiredis.

The simple usage of the Alien is described in Alien::Build::Manual::AlienUser, Alien::Base::Wrapper and Alien::hiredis would be added as a configure dependency and then Alien::Base::Wrapper is used to provide the necessary Module::Build arguments to build against it.

There is also the option of dynamically requiring Alien::hiredis only in certain conditions which is more complex but affords more control to this distribution's build process.

Thanks for your consideration.