Skip to content

report if libmaxminddb is bundled or system - #289

Open
remicollet wants to merge 1 commit into
maxmind:mainfrom
remicollet:issue-info-bundled
Open

report if libmaxminddb is bundled or system#289
remicollet wants to merge 1 commit into
maxmind:mainfrom
remicollet:issue-info-bundled

Conversation

@remicollet

@remicollet remicollet commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

As version 1.14.0 now has an option to use the system or bundled library, it could be useful to report it.

$ php -n -d extension=modules/maxminddb.so --ri maxminddb

maxminddb

MaxMind DB Reader => enabled
maxminddb extension version => 1.14.0
libmaxminddb bundled library version => 1.14.0

Summary by CodeRabbit

  • New Features
    • PHP information output now identifies whether the libmaxminddb library is bundled with the extension or provided by the system.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3132b968-2e44-4205-ad78-9442a039c48f

📥 Commits

Reviewing files that changed from the base of the PR and between 34b7464 and 30ddfe8.

📒 Files selected for processing (2)
  • ext/config.m4
  • ext/maxminddb.c

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Bundled builds now define HAVE_LIBMAXMINDDB_BUNDLED. PHP info output uses this macro to label libmaxminddb as bundled or system-provided.

Changes

libmaxminddb labeling

Layer / File(s) Summary
Bundled library detection and reporting
ext/config.m4, ext/maxminddb.c
Bundled builds define and substitute HAVE_LIBMAXMINDDB_BUNDLED. PHP info output uses the macro to select the bundled or system-provided libmaxminddb label.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Suggested reviewers: oschwald

Merge Risk: ⚪ Minimal · up to 30ddf

The change only labels the library source in PHP info output and presents no unresolved merge risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: reporting whether libmaxminddb is bundled or provided by the system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the build flag bright
Bundled libraries show their light
System labels stay clear and true
PHP info tells the source to you
Soft paws approve the change tonight

Comment @coderabbitai help to get the list of available commands.

@remicollet

Copy link
Copy Markdown
Contributor Author

Perhaps version is irrelevant when bundled, so an alternative report is

libmaxminddb library version => bundled

Or

libmaxminddb library version => 1.14.0

@horgh horgh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thank you! I have a few comments.

Comment thread ext/config.m4
maxminddb_sources="$maxminddb_sources libmaxminddb/src/maxminddb.c libmaxminddb/src/data-pool.c"

AC_DEFINE([HAVE_LIBMAXMINDDB_BUNDLED], [1], [Use bundled or system libmaxminddb])
PHP_SUBST([HAVE_LIBMAXMINDDB_BUNDLED])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line needed? I think it might not do anything useful.

Comment thread ext/config.m4
CFLAGS="$CFLAGS -fvisibility=hidden -UHAVE_CONFIG_H -DHAVE_CONFIG_H=0 -DMMDB_UINT128_USING_MODE=0 -DMMDB_UINT128_IS_BYTE_ARRAY=1"

maxminddb_sources="$maxminddb_sources libmaxminddb/src/maxminddb.c libmaxminddb/src/data-pool.c"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need this in ext/config.w32 too.

Comment thread ext/config.m4

maxminddb_sources="$maxminddb_sources libmaxminddb/src/maxminddb.c libmaxminddb/src/data-pool.c"

AC_DEFINE([HAVE_LIBMAXMINDDB_BUNDLED], [1], [Use bundled or system libmaxminddb])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "Defined when the bundled libmaxminddb is compiled into the extension"?

Comment thread ext/maxminddb.c
#ifdef HAVE_LIBMAXMINDDB_BUNDLED
2, "libmaxminddb bundled library version", MMDB_lib_version());
#else
2, "libmaxminddb system library version", MMDB_lib_version());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if adding a new row would be a good option, e.g. something like

#ifdef HAVE_LIBMAXMINDDB_BUNDLED
    const char *lib_source = "bundled";
#else
    const char *lib_source = "system";
#endif
    php_info_print_table_row(2, "libmaxminddb library", lib_source);

And we could keep the current version one as is, which is still useful.

Alternatively we could have the current line appear like libmaxminddb library version 1.xxx (bundled) and libmaxminddb library version 1.xxx.

If you think keeping your proposed way is superior, that seems okay too though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants