in reply to Re: How to author a module with optional XS
in thread How to author a module with optional XS
I wouldn't want a module to silently install the pure-perl code and claim success just because it tripped over some trivial, easily-fixed problem building the XS code
Well, that's a good point. Trying to automatically make it fast could just as easily fail and make it silently not-fast.
What about trying to detect presence of a functioning C compiler during Makefile.PL and then spitting out a dependency on the ::XS variant? Something like:
Are there official methods to detect whether XS is supported by a Perl environment? I thought maybe I could find out whether Devel::CheckLib finds a compiler, but it appears that Devel::CheckLib probably can't be installed unless it does find a compiler. So I can't list Devel::CheckLib as a dependency for a module that I want to be installable on compiler-less perls.
Maybe I shouldn't worry about compiler-less perl environments? (are there any where a compiler *can't* be installed?) and just focus on making sure my module can work properly with fat-packing, since I think that is the main reason that people try to avoid XS dependencies?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to author a module with optional XS
by hv (Prior) on Aug 30, 2023 at 23:44 UTC | |
by afoken (Chancellor) on Aug 31, 2023 at 13:57 UTC | |
by NERDVANA (Priest) on Sep 02, 2023 at 07:01 UTC | |
by etj (Priest) on Mar 02, 2025 at 12:15 UTC | |
|
Re^3: How to author a module with optional XS
by Anonymous Monk on Sep 01, 2023 at 05:02 UTC | |
by Anonymous Monk on Sep 01, 2023 at 09:58 UTC |