[MacPorts] #67960: emacs-mac-app @29.1: error: unknown type name 'ulonglong' (was: compile errors with emacs-mac-app 29.1)

MacPorts noreply at macports.org
Mon Aug 14 15:02:16 UTC 2023


#67960: emacs-mac-app @29.1: error: unknown type name 'ulonglong'
----------------------------+------------------------
  Reporter:  squarepegsys   |      Owner:  ryandesign
      Type:  defect         |     Status:  assigned
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.8.1
Resolution:                 |   Keywords:
      Port:  emacs-mac-app  |
----------------------------+------------------------
Changes (by ryandesign):

 * status:  new => assigned
 * owner:  (none) => ryandesign
 * version:   => 2.8.1
 * keywords:  x86_64 =>
 * port:  emac-mac-app => emacs-mac-app


Old description:

> I have tried to install the latest emacs-mac-app port via:
>
> >   sudo port install emacs-mac-app +imagemagick +treesitter +nativecomp
> +rsvg
>

> And I get the following compile errors:
>
> :info:build In file included from fns.c:5526:
> :info:build /opt/local/include/sha1.h:48:3: error: unknown type name
> 'ulonglong'
> :info:build   ulonglong  Length;            /* Message length in bits
> */
> :info:build   ^
> :info:build /opt/local/include/sha1.h:52:3: error: unknown type name
> 'int16'
> :info:build   int16 Message_Block_Index;    /* Index into message block
> array   */
> :info:build   ^
> :info:build /opt/local/include/sha1.h:60:1: error: unknown type name
> 'C_MODE_START'
> :info:build C_MODE_START
> :info:build ^
> :info:build /opt/local/include/sha1.h:66:1: error: unknown type name
> 'C_MODE_END'
> :info:build C_MODE_END
> :info:build ^
> :info:build fns.c:5775:21: error: use of undeclared identifier
> 'SHA1_DIGEST_SIZE'; did you mean 'SHA512_DIGEST_SIZE'?
> :info:build       digest_size = SHA1_DIGEST_SIZE;
> :info:build                     ^~~~~~~~~~~~~~~~
> :info:build                     SHA512_DIGEST_SIZE
> :info:build ../lib/sha512.h:36:8: note: 'SHA512_DIGEST_SIZE' declared
> here
> :info:build enum { SHA512_DIGEST_SIZE = 512 / 8 };
> :info:build        ^
> :info:build fns.c:5776:21: error: use of undeclared identifier
> 'sha1_buffer'; did you mean 'sha512_buffer'?
> :info:build       hash_func   = sha1_buffer;
> :info:build                     ^~~~~~~~~~~
> :info:build                     sha512_buffer
> :info:build ../lib/sha512.h:96:14: note: 'sha512_buffer' declared here
> :info:build extern void *sha512_buffer (const char *buffer, size_t len,
> :info:build              ^
> :info:build fns.c:5893:19: error: variable has incomplete type 'struct
> sha1_ctx'
> :info:build   struct sha1_ctx ctx;
> :info:build                   ^
> :info:build fns.c:5893:10: note: forward declaration of 'struct sha1_ctx'
> :info:build   struct sha1_ctx ctx;
> :info:build          ^
> :info:build fns.c:5903:3: error: call to undeclared function
> 'sha1_init_ctx'; ISO C99 and later do not support implicit function
> declarations [-Wimplicit-function-declaration]

New description:

 I have tried to install the latest emacs-mac-app port via:

 {{{
 sudo port install emacs-mac-app +imagemagick +treesitter +nativecomp +rsvg
 }}}

 And I get the following compile errors:

 {{{
 :info:build In file included from fns.c:5526:
 :info:build /opt/local/include/sha1.h:48:3: error: unknown type name
 'ulonglong'
 :info:build   ulonglong  Length;            /* Message length in bits
 */
 :info:build   ^
 :info:build /opt/local/include/sha1.h:52:3: error: unknown type name
 'int16'
 :info:build   int16 Message_Block_Index;    /* Index into message block
 array   */
 :info:build   ^
 :info:build /opt/local/include/sha1.h:60:1: error: unknown type name
 'C_MODE_START'
 :info:build C_MODE_START
 :info:build ^
 :info:build /opt/local/include/sha1.h:66:1: error: unknown type name
 'C_MODE_END'
 :info:build C_MODE_END
 :info:build ^
 :info:build fns.c:5775:21: error: use of undeclared identifier
 'SHA1_DIGEST_SIZE'; did you mean 'SHA512_DIGEST_SIZE'?
 :info:build       digest_size = SHA1_DIGEST_SIZE;
 :info:build                     ^~~~~~~~~~~~~~~~
 :info:build                     SHA512_DIGEST_SIZE
 :info:build ../lib/sha512.h:36:8: note: 'SHA512_DIGEST_SIZE' declared here
 :info:build enum { SHA512_DIGEST_SIZE = 512 / 8 };
 :info:build        ^
 :info:build fns.c:5776:21: error: use of undeclared identifier
 'sha1_buffer'; did you mean 'sha512_buffer'?
 :info:build       hash_func   = sha1_buffer;
 :info:build                     ^~~~~~~~~~~
 :info:build                     sha512_buffer
 :info:build ../lib/sha512.h:96:14: note: 'sha512_buffer' declared here
 :info:build extern void *sha512_buffer (const char *buffer, size_t len,
 :info:build              ^
 :info:build fns.c:5893:19: error: variable has incomplete type 'struct
 sha1_ctx'
 :info:build   struct sha1_ctx ctx;
 :info:build                   ^
 :info:build fns.c:5893:10: note: forward declaration of 'struct sha1_ctx'
 :info:build   struct sha1_ctx ctx;
 :info:build          ^
 :info:build fns.c:5903:3: error: call to undeclared function
 'sha1_init_ctx'; ISO C99 and later do not support implicit function
 declarations [-Wimplicit-function-declaration]
 }}}

--

Comment:

 This is happening because the build wishes to use the file sha1.h which is
 part of the emacs-mac-app source code, but erroneously the flag
 `-I/opt/local/include` is being used prior to the project's own `-I`
 flags, which means that the file /opt/local/include/sha1.h which must have
 come from some other port is being used instead. The order of the `-I`
 flags must be fixed.

 Where did this file come from? Find out with:

 {{{
 port provides /opt/local/include/sha1.h
 }}}

 I could not find a port providing that file by searching
 https://ports.macports.org.

 If you were using macOS 12 or earlier you could work around the problem
 using trace mode:

 {{{
 sudo port clean emacs-mac-app
 sudo port -t install emacs-mac-app
 }}}

 But since you are using macOS 13 and [ticket:66358 trace mode is broken in
 macOS 13 and later], the solution would be to `sudo port -f deactivate`
 whatever port provided /opt/local/include/sha1.h, then install emacs-mac-
 app, then, if desired, `sudo port activate` the port that provided sha1.h
 again.

-- 
Ticket URL: <https://trac.macports.org/ticket/67960#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list