Skip to content

mmdb2: fix size_t error#2182

Merged
YoshitakaMo merged 2 commits into
developfrom
mmdb2
Apr 29, 2026
Merged

mmdb2: fix size_t error#2182
YoshitakaMo merged 2 commits into
developfrom
mmdb2

Conversation

@YoshitakaMo
Copy link
Copy Markdown
Contributor

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_DEVELOPER=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source --verbose --keep-tmp ./Formula/<FORMULA>.rb, where FORMULA is the name of the formula you're submitting?
  • Does your formula have no offenses with brew style /path/to/formula.rb?
  • Does your formula pass brew audit --formula brewsci/bio/<FORMULA> --online --git --skip-style?
  • Does your formula pass brew linkage --cached --test --strict brewsci/bio/<FORMULA> after manual installation?

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 29, 2026 09:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the mmdb2 Homebrew formula to apply an in-tree header edit during installation to resolve a macOS build failure related to size_t.

Changes:

  • Adds a macOS-only inreplace to inject a missing standard header include into mmdb_machine_.h.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Formula/mmdb2.rb Outdated
# Fix error: unknown type name 'size_t';
# https://github.com/brewsci/homebrew-bio/issues/2181
inreplace "mmdb2/mmdb_machine_.h", "#include \"mmdb_mattype.h\"",
"#include <cstddef>\n#include \"mmdb_mattype.h\""
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The injected header uses #include <cstddef>, which is a C++ header and may not compile if mmdb_machine_.h is included from a C translation unit (common for .h headers). Also, <cstddef> primarily guarantees std::size_t, while this codebase likely uses unqualified size_t.

Consider switching the inserted include to <stddef.h> (works for both C and C++ and defines size_t in the global namespace), or guard the C++ include with #ifdef __cplusplus and provide a C fallback.

Suggested change
"#include <cstddef>\n#include \"mmdb_mattype.h\""
"#include <stddef.h>\n#include \"mmdb_mattype.h\""

Copilot uses AI. Check for mistakes.
Comment thread Formula/mmdb2.rb
Comment on lines 19 to +25
def install
if OS.mac?
# Fix error: unknown type name 'size_t';
# https://github.com/brewsci/homebrew-bio/issues/2181
inreplace "mmdb2/mmdb_machine_.h", "#include \"mmdb_mattype.h\"",
"#include <cstddef>\n#include \"mmdb_mattype.h\""
end
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

This change alters the installed headers (and therefore the build output) without changing the upstream version. In this tap, similar formula-only fixes typically bump the formula revision so users can receive the updated build via brew upgrade.

Consider adding a revision bump to the formula alongside this patch, rather than leaving the package version unchanged.

Copilot uses AI. Check for mistakes.
@YoshitakaMo YoshitakaMo merged commit d48f94e into develop Apr 29, 2026
5 checks passed
@YoshitakaMo YoshitakaMo deleted the mmdb2 branch April 29, 2026 09:49
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