5

I'm trying to get Perl's Finance::Quote module working after MacOS upgrade to 11.4. One of the dependencies is B::Keywords. B::Keywords installation fails a test with this error:

> sudo cpan B::Keywords
[...]
Can't open /System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h: No such file or directory at t/11keywords.t line 25

Digging around, I see that keywords.h exists on my system in this location:

/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h

Is there a way to tell cpan (or cpanm, or some other installation tool) where to look for these headers? Or, any other approach to get this working would be welcome.

Rob
  • 781
  • 5
  • 19
psiz
  • 69
  • 5

1 Answers1

5

It seems like they removed the keywords.h from the CORE directory (relative to the path given from $Config{archlibexp}) for the system perl on macOS 10.14, see this bug report.

The reason you are not able to install B::Keywords is due to a failed test 11keywords.t see line 24. Some possible solutions:

  • Install the module without running the tests (sudo cpan -T B::Keywords)
  • Submit an issue at the GitHub issue tracker so the author of the module can fix the problem.
  • Install the module with perlbrew instead of using the system perl (I tested this and it worked fine here).
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
  • 3
    Note that Apple recommends that you not use the system perl it distributes: https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/FileSystemProtections/FileSystemProtections.html#//apple_ref/doc/uid/TP40016462-CH2-SW1 – brian d foy Jul 01 '21 at 15:54
  • 1
    Thanks Håkon and Brian --- I was reluctant to go the perlbrew route but if Apple is recommending against use of System perl that might be the best approach. – psiz Jul 01 '21 at 16:52
  • 1
    You've already left the eco system by not using the package manager used to install the `perl`. At that point, you might as well install your own. – ikegami Jul 01 '21 at 22:32