Page MenuHomeWildfire Games

Suppress implicit function declaration error in zip-lib for MacOS
Needs ReviewPublic

Authored by jpshack on Aug 7 2023, 12:24 AM.

Details

Reviewers
Itms
s0600204
wraitii
Trac Tickets
#6847
Summary

Attempting to build from master on OS X, having addressed the issue described in track #6797 / D5092, when running ./update-workspace as described in ​https://trac.wildfiregames.com/wiki/BuildInstructions#Buildthegame the build of zlib fails complaining of undeclared function 'getpid' in ../../contrib/libzip/mkstemp.c.

Test Plan

On MacOS:

cd build/workspaces
./clean-workspaces.sh
./update-workspaces.sh

See zlib build fail with message that ISO C99 and later do not support implicit function declarations.
Apply this patch.

./clean-workspaces.sh
./update-workspaces.sh

See that the build completes cleanly.
This change in make file specific to MacOS and should not impact builds on other OSes.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
trac-6847
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22205
Build 54254: arc lint + arc unit

Event Timeline

jpshack created this revision.Aug 7 2023, 12:24 AM
Owners added a subscriber: Restricted Owners Package.Aug 7 2023, 12:24 AM
jpshack requested review of this revision.Aug 7 2023, 12:24 AM
jpshack edited the summary of this revision. (Show Details)Aug 7 2023, 12:29 AM
jpshack edited the test plan for this revision. (Show Details)
jpshack updated the Trac tickets for this revision.
jpshack edited the summary of this revision. (Show Details)Aug 7 2023, 12:45 AM

Nice! Yeah this works for me, and I am now building the game.

0ad built as expected. Thanks so much!

Seems like Premake is shipping with libzip 0.11.2, which is absolutely ancient at this point, which probably explains this issue.

There is an issue opened on Premake's repo https://github.com/premake/premake-core/issues/2092

IMO the approach here is valid enough for now

sera added a subscriber: sera.Jan 20 2024, 5:13 PM

we could adopt the upstream fix instead found at https://github.com/premake/premake-core/pull/2117, but this one looks ok as well.