Skip to content

fix(ip2country): default ENABLE_IP2COUNTRY=ON, hard-fail on missing dep - #119

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:cleanup/ip2country-unconditional-on
Jun 12, 2026
Merged

fix(ip2country): default ENABLE_IP2COUNTRY=ON, hard-fail on missing dep#119
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:cleanup/ip2country-unconditional-on

Conversation

@got3nks

@got3nks got3nks commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Follow-up to #113 review feedback from @Vollstrecker. Drops the probe-driven default in cmake/options.cmake that flipped ENABLE_IP2COUNTRY based on whether libmaxminddb was discoverable. The probe was a "silent activation" that conflicted with the project's feature-gating policy.

Fix

Switch to the same shape used by ENABLE_NLS, ENABLE_BFD, and ENABLE_UPNP: default the option ON unconditionally. cmake/ip2country.cmake already produces a FATAL_ERROR with an actionable hint ("install libmaxminddb-dev or pass -DENABLE_IP2COUNTRY=NO") when the dep is missing, so the missing-dep UX is preserved.

Net effect on the configure matrix:

User has libmaxminddb? User passes flag? Before this PR After this PR
yes unset auto-ON ON (default)
yes =YES ON ON
yes =NO OFF OFF
no unset auto-OFF (silent) FATAL_ERROR (actionable)
no =YES FATAL_ERROR FATAL_ERROR
no =NO OFF OFF

The behavioural change is in row 4: a user on a system without libmaxminddb who never set the flag previously got a silent no-feature build; they now get a configure-time error pointing them at the right apt/dnf/brew install or the -DENABLE_IP2COUNTRY=NO opt-out — matching how NLS/UPnP handle missing deps today.

Docs

  • docs/INSTALL.md — table cell flipped NOYES.
  • docs/IP2Country.md — "Build prerequisites" paragraph rewritten to describe the hard-fail behaviour and the opt-out flag.

Test plan

  • macOS arm64 with libmaxminddb installed, no flag: configures cleanly with ENABLE_IP2COUNTRY=ON, builds, binary links libmaxminddb.0.dylib.
  • macOS arm64 with libmaxminddb hidden via CMAKE_IGNORE_PATH: configure hard-fails at cmake/ip2country.cmake:21 with the install/opt-out hint.
  • CI build matrix (Ubuntu / macOS / mingw-w64 × Debug / Release).

Drop the find_path/find_library probe in cmake/options.cmake that
defaulted ENABLE_IP2COUNTRY based on whether libmaxminddb was
discoverable. The probe-driven default was a "silent activation"
that conflicted with the project's feature-gating policy (amule-project#113 review).

Switch to the same shape used by ENABLE_NLS, ENABLE_BFD, and
ENABLE_UPNP: default the option ON unconditionally. cmake/ip2country.cmake
already FATAL_ERRORs with an actionable hint ("install libmaxminddb-dev
or pass -DENABLE_IP2COUNTRY=NO") when the dep is missing, so the
missing-dep UX is preserved.

Docs updated to match:
  - INSTALL.md: ENABLE_IP2COUNTRY default flipped to YES.
  - IP2Country.md: build-prerequisites paragraph rewritten to describe
    the hard-fail behaviour and the opt-out flag.
@got3nks
got3nks merged commit cd0bdd1 into amule-org:master Jun 12, 2026
10 checks passed
@got3nks
got3nks deleted the cleanup/ip2country-unconditional-on branch June 12, 2026 08:23
got3nks added a commit to amule-org/amule-org.github.io that referenced this pull request Jun 12, 2026
…179)

Tracks amule-org/amule#119 (merged 2026-06-12): ENABLE_IP2COUNTRY now
defaults to YES with a configure-time hard-fail if libmaxminddb is
missing, matching how ENABLE_NLS and ENABLE_UPNP have always worked.

docs/developer/compilation/index.md:
  - Build-options table: ENABLE_IP2COUNTRY default flipped NO → YES.
  - BUILD_EVERYTHING note: ENABLE_IP2COUNTRY is no longer the odd-one-out
    that needed an explicit -DENABLE_IP2COUNTRY=YES; rewrite to list it
    alongside ENABLE_NLS and ENABLE_UPNP as a default-on toggle.

docs/developer/compilation/linux.md:
  - "libmaxminddb not found" troubleshooting paragraph: users hitting
    the FATAL_ERROR now usually didn't explicitly opt in; rewrite to
    name the default-YES behaviour as the trigger and point at the
    install-or-opt-out fix.

The per-OS Quick Start cmake invocations (linux/macos/windows/bsd) keep
their explicit -DENABLE_IP2COUNTRY=YES — the doc style elsewhere is
"list every ENABLE_* explicitly even when it matches the default", same
as the existing -DENABLE_NLS=YES / -DENABLE_UPNP=YES entries. Value still
matches the new default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant