Vega-strike-engine-source: Figure out MacOS compilation

Created on 22 Apr 2020  路  18Comments  路  Source: vegastrike/Vega-Strike-Engine-Source

Continuation of #42.

CCD

Most helpful comment

Sorry, I meant @stephengtuggy regarding the TVector errors, as he's feeling with that right now.
But the more eyes were have on this, the better

All 18 comments

0.6.0 release not dependent on this; would be nice but it can be 0.6.1 if needed.

Hope no-one objects, but after playing around with Travis I feel like I've made a little progress, so here's my findings thus far...

Firstly, Travis's XCode 9.4[^1] image seems to be a no-go... at least with regards to python 3:

The image appears to come with the homebrew packages python@2 (providing python 2.7.7[^2]) and python (providing python 3.7.5) preinstalled. During the early stages of our build process, the brew [email protected] gets downloaded and installed. Whilst the installation itself doesn't fail, Homebrew complains the "brew link step failed" due to a conflict with the python@2 package. Thus, later on, when CMake is looking for a 3.x version of python, it finds the 3.7 version, but not the 3.8. Which causes a problem because boost-python3 needs 3.8.

XCode 9.4 with python 2 works a little better, although there's a lot of repeated complaints about boost itself being newer than it expects.

I also tried XCode 11.3 and XCode 12[^3], and these worked even better. Just. I did encounter the same problem as mentioned here, which fortunately also provided a workaround.

The next hurdle to overcome appears to be error: typedef redefinition.


(OSX-only build file: .travis.yml)

[^1] - XCode 9.4 is the default osx_image Travis uses if you don't specify one.
[^2] - Oddly enough, OSX 10.13 supposedly comes with python 2.7.10.
[^3] - Whilst the XCode 9.4 image is based on OSX 10.13, the XCode 11.3 and 12 images are based on OSX 10.14 and 10.15 respectively.

Good progress @s0600204! Thanks for having a look at this

You're welcome.

I've chipped away a little more, however I think I've got to the point where I need someone more experienced to take over.

The branch with my work so far is here, and it leads to these build failures.

@BenjamenMeyer some of the errors there might interest you, as they seem related to TVector.
At the rest, I hope to get a look at sometime soon

I'll take a look when I get a chance

Sorry, I meant @stephengtuggy regarding the TVector errors, as he's feeling with that right now.
But the more eyes were have on this, the better

Given how fast we want to move I'm going to move this to 0.7.x; we don't want to lose track of it or drop it. Just priorities.

as we're getting ready to release 0.7.0 and we want a fast turn around on 0.8.x i'm deferring this to 0.9.x

I know we've made some progress here, but never finished it. Did the move to GH Actions cause a problem?
https://github.community/t/create-matrix-with-multiple-os-and-env-for-each-one/16895/7

MacOS is supported so we need to port what we had working and then test it until we get it fully working.

Speaking personally: I stopped working on this as I suck at c++, and thus was struggling to understand the compile errors and consequently how to resolve them.

That said, I have attempted to port it over to GitHub Actions: the workflow file (and fixes to some of the build errors) can be found on this branch, and the build log can be found here. (The first build error emitted is here.)

@s0600204 thanks for the workflow; please submit it as a PR but one that needs to be manually run. We can adjust it to run automatically once we have it working. I believe we're doing the same with our Windows CI build right now too.

There seems to be a few things we need to fix up:

  • [ ] deprecated Mac OS X API Calls
  • [ ] struct vs class mismatches - /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/weapon_xml.h:11:1: warning: 'weapon_info' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
  • [ ] Bad GCC warnings on CLang - /usr/local/include/boost/proto/expr.hpp:140:44: warning: unknown warning group '-Wdeprecated-copy', ignored [-Wunknown-warning-option]
  • [ ] OpenAL seems to be deprecated on Mac OSX 10.15, they prefer using AVAudioEngine.

Sure, I'll get to that in the next day or so. In the meantime, some more checkboxes:

  • [ ] glu (as it exists as part of Apple's OpenGL offering) claims to be deprecated as of MacOS 10.09
  • [ ] OpenGL itself is deprecated as of MacOS 10.14
  • [ ] GLUT (OpenGL Utility Toolkit) is deprecated as of MacOS 10.09

(Which, now I look at other Issues (notably #170) all three should be resolved by transitioning away from OpenGL. More incentive to do so, I guess, and something to be aware of when looking at the build logs.)

@s0600204 thanks for the workflow; please submit it as a PR but one that needs to be manually run. We can adjust it to run automatically once we have it working. I believe we're doing the same with our Windows CI build right now too.

@BenjamenMeyer The Windows CI build is actually running automatically now. Was that premature? Should I change it back to running manually only?

@stephengtuggy cool; no we got it all sorted pretty quickly once we got it in CI. Hopefully that'll help here too

I've had a look at the CI build, and tried to condense it down to just unique errors.
I have no idea what I'm doing, so sorry if this is not helpful...

####### Error 1 ########
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Ice/IceRandom.cpp:12:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Ice/Stdafx.h:1:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Stdafx.h:44:
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/opcodetypes.h:176:15: error: typedef redefinition with different types ('int64' (aka 'long long') vs 'long')
typedef int64 intmax_t;
              ^
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_types/_intmax_t.h:32:25: note: previous definition is here
typedef __INTMAX_TYPE__ intmax_t;
                        ^
####### Error 2 ########
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Ice/IceAABB.cpp:21:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Ice/Stdafx.h:1:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Stdafx.h:44:
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/opcodetypes.h:178:16: error: typedef redefinition with different types ('uint64' (aka 'unsigned long long') vs 'unsigned long')
typedef uint64 uintmax_t;
               ^
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_types/_uintmax_t.h:32:26: note: previous definition is here
typedef __UINTMAX_TYPE__ uintmax_t;
                         ^

####### Error 3 ########
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/OPC_HybridModel.cpp:85:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/Stdafx.h:45:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/cmd/collide2/opcodesysdef.h:50:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/gfx/quaternion.h:4:
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/gfx/vec.h:6:
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/endianness.h:102:14: warning: 'NXSwapHostLongToLittle' is deprecated [-Wdeprecated-declarations]
    l.i[0] = le32_to_cpu( l.i[1] );
             ^
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/endianness.h:27: error: typedef redefinition with different types ('int64' (aka 'long long') vs 'long')
:33: note: expanded from macro 'le32_to_cpu'
typedef int64 intmax_t;
              ^
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_types/_intmax_t.h:32:25: note: previous definition is here
    # define le32_to_cpu( x ) ( NXSwapHostLongToLittle( x ) )
                                ^
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/architecture/byte_order.h:345:34: note: 'NXSwapHostLongToLittle' has been explicitly marked deprecated here
static __inline__ __attribute__((deprecated))
                                 ^
typedef __INTMAX_TYPE__ intmax_t;
                        ^

####### Error 4 ########
In file included from /Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/gfx/mesh.cpp:48:
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/gfx/sphere.h:86:18: warning: 'SphereMesh::ProcessDrawQueue' hides overloaded virtual function [-Woverloaded-virtual]
    virtual void ProcessDrawQueue( int whichpass, int which, bool zsort, const QVector &sortctr );
                 ^
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/gfx/mesh.h:344:18: note: hidden overloaded virtual function 'Mesh::ProcessDrawQueue' declared here: type mismatch at 1st parameter ('size_t' (aka 'unsigned long') vs 'int')
    virtual void ProcessDrawQueue( size_t whichpass, int whichdrawqueue, bool zsort, const QVector &sortctr );
                 ^
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/vsfilesystem.cpp:757:19: error: no matching function for call to 'scandir'
        int ret = scandir( selectcurrentdir.c_str(), &dirlist, selectdirs, 0 );
                  ^~~~~~~
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/dirent.h:149:5: note: candidate function not viable: no known conversion from 'int (struct dirent *)' to 'int (*)(const struct dirent *)' for 3rd argument
int scandir(const char *, struct dirent ***,
    ^
/Users/runner/work/Vega-Strike-Engine-Source/Vega-Strike-Engine-Source/engine/src/vsfilesystem.cpp:771:15: error: no matching function for call to 'scandir'
    int ret = scandir( selectcurrentdir.c_str(), &dirlist, selectdirs, 0 );
              ^~~~~~~
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/dirent.h:149:5: note: candidate function not viable: no known conversion from 'int (struct dirent *)' to 'int (*)(const struct dirent *)' for 3rd argument
int scandir(const char *, struct dirent ***,
    ^

@daviewales Thanks for the effort - the build logs are really long!

The first two errors listed were fixed by #480.

Fixes for the other two are contained within this branch (the same branch I have mentioned previously, and one that I invite anyone to improve upon - I don't feel I can).

A build of that branch can be found here with a new set of errors to resolve.

(Also, five of the six build logs are incomplete, which I think is a bug with GHA's CI.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

viktorradnai picture viktorradnai  路  3Comments

BenjamenMeyer picture BenjamenMeyer  路  3Comments

stephengtuggy picture stephengtuggy  路  5Comments

BenjamenMeyer picture BenjamenMeyer  路  5Comments

stephengtuggy picture stephengtuggy  路  5Comments