NERDVANA has asked for the wisdom of the Perl Monks concerning the following question:
The usual pattern for optional-XS modules is to have one dist that is the pure-perl implementation and another dist that overrides the first with some XS speedups.
This works, but often people list the pure-perl module as a dependency and then sometimes the XS one doesn't get installed for the average end-user, letting them suffer with low performance not realizing they could speed it up with an additional module.
Has anyone explored the possibility of packaging the XS and PP together in the same dist so that the XS is compiled and installed iff a C compiler is available? Or even better, skips installing the XS if it fails to compile and install for any reason?
I was toying with the idea, and thought a quick way to get there without a bunch of Makefile.pm shenanigans would be if I create a normal XS dist and then include that as a subdirectory of the PP dist. Then I just start a subshell to run the nomal make process in that subdirectory, and if it fails, I ignore it and continue installing and testing the PP module.
Does anyone see any problems with that? Had this been solved better ways by other modules I could look at as an example?
|
|---|