Opened 15 months ago

Closed 2 months ago

#72124 closed defect (fixed)

emacs @30.1: error: incomplete definition of type 'struct dynarray_header'

Reported by: jwhowse4 (James Howse) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 2.10.5
Keywords: sequoia arm64 Cc: kwolcott
Port: emacs emacs-app

Description

I have an M4 ARM based Mac running Sequoia 15.3.1. The build for the port emacs @30.1_1 fails. The first set of apparent errors in the build log are as follows.

:info:build /usr/bin/clang -c -I/opt/macports/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk   -MMD -MF deps/lstat.d -MP -Wno-pointer-sign -Wno-string-plus-int -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-initializer-overrides -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-deprecated-declarations   -pipe -Os -Wno-attributes -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I. -I../src -I. -I../src   -DGL_COMPILE_CRYPTO_STREAM -o lstat.o lstat.c
:info:build malloc/dynarray_emplace_enlarge.c:30:41: warning: declaration of 'struct dynarray_header' will not be visible outside of this function [-Wvisibility]
:info:build    30 | __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
:info:build       |                                         ^
:info:build malloc/dynarray_emplace_enlarge.c:34:11: error: incomplete definition of type 'struct dynarray_header'
:info:build    34 |   if (list->allocated == 0)
:info:build       |       ~~~~^
:info:build malloc/dynarray_emplace_enlarge.c:30:41: note: forward declaration of 'struct dynarray_header'
:info:build    30 | __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
:info:build       |                                         ^

I have attached the complete build log. Any idea what is going wrong here?

I get the same error when trying to build the port emacs-app.

Attachments (1)

emacs_main.log (161.1 KB) - added by jwhowse4 (James Howse) 15 months ago.
Full emacs build log

Download all attachments as: .zip

Change History (10)

Changed 15 months ago by jwhowse4 (James Howse)

Attachment: emacs_main.log added

Full emacs build log

comment:1 Changed 15 months ago by jwhowse4 (James Howse)

I forgot to add that I have Xcode 16.2 and the associated command line tools.

comment:2 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: dports@… removed
Keywords: sequoia arm64 added
Owner: set to drkp
Port: emacs-app removed
Status: newassigned
Summary: emacs fails to buildemacs @30.1: error: incomplete definition of type 'struct dynarray_header'

comment:3 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)

Port: emacs-app added

#68414 reported the same thing with emacs-app and emacs-mac-app but no log files were provided there so we can't easily analyze that failure.

Comparing your log with our successful build on the build server, I see your build found lcms2 opportunistically. We should certainly fix that. But I don't know whether it is contributing to your build failure, especially since emacs-app declares a dependency on lcms2 and also builds fine on our build server. Still, you could test whether lcms2 is the cause of your emacs build failure by running:

sudo port clean emacs
sudo port -f deactivate lcms2
sudo port install emacs
sudo port activate lcms2

comment:4 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)

The error is also mentioned in #62804. There, I suspect the problem is caused by having the hdf4 port installed, so try:

sudo port clean emacs
sudo port -f deactivate hdf4
sudo port install emacs
sudo port activate hdf4

comment:5 Changed 15 months ago by jwhowse4 (James Howse)

Thank you very much for your suggestions. Deactivating lcms2 resulted in the same error during the build. However deactivating hdf4, which was installed as part of netcdf, resulted in a successful build of both emacs and emacs-app. So at least on my system the problem was hdf4 and my non-standard netcdf configuration.

comment:6 Changed 14 months ago by massonseb

I had exactly the same error. Once deactivating hdf4, emacs compiled perfectly. Thanks a lot for the tip!

comment:7 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #73051.

comment:8 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: kwolcott added

Has duplicate #73609.

comment:9 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In b97be474c9897a1e3c9c1383fc3ebe06a4f600d6/macports-ports (master):

emacs*: Avoid build failure when hdf4 is installed

Or when other generically-named headers are installed in $prefix/include.

Closes: #62804
Closes: #67960
Closes: #68414
Closes: #72124

Note: See TracTickets for help on using tickets.