Add native_extension category and perl cpanm package manager#108
Merged
Conversation
New native_extension category with four detectors: ruby/mkmf.toml extconf.rb at root or under ext/ python/cext.toml setup.py/pyproject.toml declaring Extension/ext_modules, or .pyx files php/phpize.toml config.m4 containing PHP_ARG_/PHP_NEW_EXTENSION node/node-gyp.toml binding.gyp or node-gyp/node-addon-api/nan/bindings deps perl/cpanm.toml gives Perl repos a package_managers entry (previously only Languages carried Perl, so consumers keying on package_managers[].name saw nothing). phpize is gated on php/c/cpp ecosystems rather than php alone since a PECL extension repo is C source with no .php files. Taxonomy role is build-tool for now; a native-extension role in oss-taxonomy can follow. Adds native_extension to CategoryOrder/CategoryLabels, one CONTRIBUTING row, regenerates the README What it detects section, and adds TestPerlProject and TestNativeExtensionProject with fixtures.
Refreshes the vendored terms.txt (picks up native-extension plus 28 other terms added upstream since the last sync) and switches the four native_extension TOMLs from build-tool to native-extension.
There was a problem hiding this comment.
Pull request overview
Adds a new native_extension tool category to help consumers identify repositories that ship compiled/native code, and introduces a Perl cpanm package manager detector so Perl ecosystems appear under package_managers as well as languages.
Changes:
- Added
native_extensioncategory and detectors for Ruby (mkmf), Python (setuptoolsExtension), PHP (phpize), and Node (node-gyp). - Added Perl
cpanmtool definition so Perl repos can be discovered viapackage_managers. - Updated reporting/display metadata (category order/labels) and added fixtures/tests to cover the new detections.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/perl-project/script.pl | Adds a minimal Perl source fixture for language detection. |
| testdata/perl-project/cpanfile | Adds a Perl dependency manifest fixture to trigger cpanm detection. |
| testdata/native-ext-project/setup.py | Python fixture declaring a native extension via Extension(...). |
| testdata/native-ext-project/package.json | Node fixture to establish the node ecosystem. |
| testdata/native-ext-project/Gemfile | Ruby fixture to establish the ruby ecosystem. |
| testdata/native-ext-project/foo.c | C fixture to establish the c ecosystem (for PECL-style repos). |
| testdata/native-ext-project/ext/foo/extconf.rb | Ruby native extension marker for mkmf detection. |
| testdata/native-ext-project/config.m4 | PHP extension marker for phpize detection via macro content checks. |
| testdata/native-ext-project/binding.gyp | Node native addon marker for node-gyp detection. |
| report/report.go | Adds native_extension to display ordering and human-readable labels. |
| README.md | Regenerates the “What it detects” section to include the new category/tools and cpanm. |
| knowledge/ruby/mkmf.toml | Adds mkmf native-extension tool definition. |
| knowledge/python/cext.toml | Adds setuptools Extension native-extension tool definition. |
| knowledge/php/phpize.toml | Adds phpize native-extension tool definition gated by PHP macro content checks. |
| knowledge/perl/cpanm.toml | Adds cpanm package manager tool definition for Perl. |
| knowledge/node/node-gyp.toml | Adds node-gyp native-extension tool definition. |
| detect/detect_test.go | Adds tests covering Perl cpanm and the new native_extension detectors. |
| CONTRIBUTING.md | Documents the new native_extension category. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mkmf: rake compile works from the repo root regardless of where extconf.rb lives (ext/<name>/ is the common case); the raw ruby extconf.rb only works after cd'ing into the ext dir. config.files now mirrors detect.files. cext: add [commands] and [config] to match the other native_extension entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
native_extensioncategory with four detectors so consumers can tell when a project ships compiled code without re-implementing the marker checks:ruby/mkmf.toml:extconf.rbat root or underext/python/cext.toml:setup.py/pyproject.tomldeclaringExtension(/ext_modules, or.pyxfilesphp/phpize.toml:config.m4containingPHP_ARG_/PHP_NEW_EXTENSION(gated on php/c/cpp since a PECL repo is C source with no.phpfiles)node/node-gyp.toml:binding.gypornode-gyp/node-addon-api/nan/bindingsdepsAlso adds
perl/cpanm.tomlso Perl repos get apackage_managersentry; previously onlyLanguagescarried Perl.native_extensionadded toCategoryOrder/CategoryLabels, one CONTRIBUTING row, README section regenerated.TestPerlProjectandTestNativeExtensionProjectcover the new detections plus a no-false-positive check against the plain ruby fixture.Taxonomy role is
build-toolfor now; happy to switch once anative-extensionrole lands in oss-taxonomy. The*.gemspec.extensionscontent check isn't included since[detect.file_contains]doesn't glob;extconf.rbpresence covers the same repos.