Opened 2 years ago

Closed 2 years ago

#66221 closed defect (fixed)

mongo-c-driver @1.23.1: error: implicit declaration of function 'getpagesize' is invalid in C99

Reported by: ConnectGrid Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: arm64 Cc:
Port: mongo-c-driver

Description

Been unable to build mongo-c-driver on M1 running Monterey 12.6.1 for the past two weeks. Seems a followup release continues to have the same issue.

Not quite sure which part of the build log to share. Here's the tail end.

info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mongo-c-driver/mongo-c-driver/work/build" && /usr/bin/make -j8 -w all VERBOSE=ON 
:info:build Exit code: 2
:error:build Failed to build mongo-c-driver: command execution failed
:debug:build Error code: CHILDSTATUS 29870 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"

Can't find any other reports of this online. Attempted to clean and rebuild several times, but always failing.

Attachments (1)

main.log (243.5 KB) - added by ConnectGrid 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: monterey added
Owner: set to ryandesign
Status: newassigned
Summary: Failing to build on macOS 12.6.1mongo-c-driver: Failing to build on macOS 12.6.1

Please attach the entire main.log; the relevant error is before the portion you posted.

Changed 2 years ago by ConnectGrid

Attachment: main.log added

comment:2 Changed 2 years ago by ConnectGrid

Anything helpful in the logs? I'm surprised that I can't find any similar reports online. Surely others have experienced the same issue? Is it limited to Monterey and Ventura doesn't have the same issue?

I have noticed that the MongoDB team is behind on their support of some newer systems, such as Ubuntu 22.04 LTS, which is still not officially supported six months later.

comment:3 Changed 2 years ago by ConnectGrid

The first error generated:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mongo-c-driver/mongo-c-driver/work/mongo-c-driver-1.23.1/src/libmongoc/src/mongoc/mongoc-counters.c:114:21: error: implicit declaration of function 'getpagesize' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build    return BSON_MAX (getpagesize (), size);
:info:build                     ^
:info:build 1 error generated.

seems to be related to getpagesize() being deprecated and the PAGE_SIZE macro should be used instead.

References:

Is this a bug with MongoDB itself, or can it be fixed in the Portfile?

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: arm64 added; monterey removed
Status: assignedaccepted
Summary: mongo-c-driver: Failing to build on macOS 12.6.1mongo-c-driver @1.23.1: error: implicit declaration of function 'getpagesize' is invalid in C99

We see the same error: implicit declaration of function 'getpagesize' is invalid in C99 problem on our Apple Silicon build machines running macOS Big Sur and Monterey. We don't see the problem on the Intel build machines running Catalina, Big Sur or Monterey.

It's a bug in mongo-c-driver. They will release the fix in version 1.23.2. I'll add that as a patch to the portfile shortly.

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 24d64ac57fa8b84fedbbe57b722f6c0f490c403a/macports-ports (master):

mongo-c-driver: Fix build on arm64

Closes: #66221

Note: See TracTickets for help on using tickets.