Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#68300 closed defect (fixed)

premake5 @5.0.0-beta2: error: call to undeclared function 'getpid'; ISO C99 and later do not support implicit function declarations

Reported by: Iritscen Owned by: amake (Aaron Madlon-Kay)
Priority: Normal Milestone:
Component: ports Version:
Keywords: sonoma Cc:
Port: premake5

Description

I am in the midst of rebuilding all my ports after updating to macOS 14, and MacPorts is currently failing on premake5. MacPorts attempts to download the file premake5-5.0.0-beta2_0.darwin_23.x86_64.tbz2, however only darwin_22 and earlier are present in the three directories it tries. For some reason it still attempts to build the port and fails. I would be happy to post the log for the failed build but it seems like a moot point when the portfile is not found on the server.

--->  Fetching archive for premake5
--->  Attempting to fetch premake5-5.0.0-beta2_0.darwin_23.x86_64.tbz2 from https://packages.macports.org/premake5
--->  Attempting to fetch premake5-5.0.0-beta2_0.darwin_23.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/premake5
--->  Attempting to fetch premake5-5.0.0-beta2_0.darwin_23.x86_64.tbz2 from http://mirror.fcix.net/macports/packages/premake5
--->  Computing dependencies for premake5
--->  Building premake5
Error: Failed to build premake5: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_premake5/premake5/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.

Attachments (1)

main.log.zip (13.6 KB) - added by Iritscen 14 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: sonoma added
Owner: set to amake
Status: newassigned

There are no pre-built archives for any port for Darwin 23 yet. When pre-built archives are not available, MacPorts will build from source, and that appears to be failing. Please attach the main.log so that we can see why.

comment:2 Changed 14 months ago by Iritscen

I see, thanks for explaining. I'm not that familiar with MacPorts and thought I must be missing something. I'm attaching the log.

Changed 14 months ago by Iritscen

Attachment: main.log.zip added

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

Summary: premake5 archive for Darwin 23 is not present on mirrorspremake5 @5.0.0-beta2: error: call to undeclared function 'getpid'; ISO C99 and later do not support implicit function declarations

Thanks, the log shows the error is:

../../contrib/libzip/mkstemp.c:76:8: error: call to undeclared function 'getpid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        pid = getpid();
              ^
1 error generated.
make[1]: *** [obj/Release/zip-lib/mkstemp.o] Error 1
make: *** [zip-lib] Error 2
make: *** Waiting for unfinished jobs....

This appears to be WimplicitFunctionDeclaration although it's interesting because usually we see this problem on any system with Xcode 12 and later (Catalina and later) yet for premake5 we have successful builds on our build system on every system up to Ventura. Maybe on older Xcodes some other system header automatically included unistd.h (where getpid is declared) and maybe that's no longer the case in Xcode 15.

Also, I see that the error is in a file in a directory called libzip. If this is the same libzip that we have available as a separate port in MacPorts, maybe premake5 could be changed to use that libzip instead of making its own.

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

premake upstream fixed this last month:

https://github.com/premake/premake-core/commit/01c7a142caa03ca9170fa7ee045719f4148b5156

We should add this patch to MacPorts.

comment:5 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Might as well include this in the patch as well which fixes the same problem on non-Mac systems, in case anybody is trying to use MacPorts to install this port on Linux:

https://github.com/premake/premake-core/commit/da607b872376db17d2e2928dde76f771e48b020e

comment:6 Changed 13 months ago by Iritscen

Is there a way for regular users to add in a patch so they can complete the build? I have 123 packages waiting to be updated/reinstalled for macOS 14 because the update process gets hung up on premake5, so it would be nice to get this one to go through.

comment:7 Changed 13 months ago by Aaron Madlon-Kay <amake@…>

Resolution: fixed
Status: assignedclosed

In fe12ab24b97231476f2b86f0b64a9e9ce4d9ef18/macports-ports (master):

premake5: fix build on macOS 14

Fixes #68300

comment:8 Changed 13 months ago by amake (Aaron Madlon-Kay)

The upstream patches only work if you're building from the repository, while we are building from a source package.

I manually added the needed import statements.

Note: See TracTickets for help on using tickets.