Merge lp:~widelands-dev/widelands/travis-osx into lp:widelands

Proposed by Hans Joachim Desserud
Status: Merged
Merged at revision: 8417
Proposed branch: lp:~widelands-dev/widelands/travis-osx
Merge into: lp:widelands
Diff against target: 136 lines (+65/-26)
2 files modified
.travis.sh (+24/-9)
.travis.yml (+41/-17)
To merge this branch: bzr merge lp:~widelands-dev/widelands/travis-osx
Reviewer Review Type Date Requested Status
GunChleoc Approve
SirVer Needs Fixing
Review via email: mp+327490@code.launchpad.net

Commit message

Let travis build each commit on macos in addition to our linux builds.

Note that the regression test suite is only run for linux (couldn't get it to work on macos), though everything else builds and works as expected.

Description of the change

Ready for feedback, probably not ready for merge.

As mentioned I came across the travis documentation for running on osx [1][2][3] on travis.

So far, I've set added two simple build to run a debug and release build on osx [4]. This is mostly working, except for the regression test suite [5], which is where I need some help.

I stronly suspect it needs an equivalent of xvfb which we use to present the graphic on Linux, though I don't know what that would be in the osx world. It could be xvfb installed through brew or it could be something completely different. Would appreciate input here. :) If it turns out to be really tricky, we could keep the regression tests for linux only and figure out how to deal with them later. Presumably, verifying that things are buildable would be better than no checks at all.

The second thing is compilers, where I don't know what the situation is like in osx-land. We have a wide array of compilers tested for linux where we ensure that WL is buildable by both latest and newest and oldest supported versions of GCC and Clang. For osx, I've gone the default compiler. It seemed like brew could install alternative ones, but I don't know how many would be needed/useful. (Also want to avoid too many builds in total). I added one debug and release build initially, which seemed like a good place to start.

Somewhat related, when starting out, I tried to follow the osx-section fot he build page[6]. This turned out to be outdated and after "converting" things to brew as I went along, I finally discovered the separate osx build page [7]. I am not sure why this is completely separate from the rest of the build instructions, nor why there are two set of instructions.
Since the former seems rather outdated, I wonder if the best would be to
move the standalone page in as part of the overall build page and keep it up to date there.

This is bound to have conflicts with the other travis MP I have going. I knew that from the get-go, but they do different things, so I didn't want to mix them too much. I can sort out the conflicts when one of them is landed. :) I suspect the other one might be first.

Just a quick headsup: I might not be able to respond to comments here the next couple of days.

[1] https://docs.travis-ci.com/user/osx-ci-environment/
[2] https://docs.travis-ci.com/user/multi-os/
[3] And yes, I know it's called macOS these days :p
[4] https://travis-ci.org/widelands/widelands/builds/254399849
[5] https://travis-ci.org/widelands/widelands/jobs/254399850
[6] https://wl.widelands.org/wiki/BuildingWidelands/#building-under-mac-os-x
[7] https://wl.widelands.org/wiki/BuildingWidelandsMac/

-- Original description
Strictly WIP at the moment, but I believe I need a merge proposal for bunnybot to pick it up and run the builds? (Also is there a way to re-trigger builds manually? Might come in handy for this)

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2457. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/254255034.
Appveyor build 2282. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_travis_osx-2282.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Ready for feedback (probably not merge yet)

Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks for starting this!

regarding the Wikipages, the separate page is for homebrew only. I have no idea how current the information for the other 2 methods is. I think that we should update the description to homebrew, or add the information to the main page and delete the separate page.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

> I have no idea how current the information for the other 2 methods is.

The mac-ports one talks about installing sdl 1 dependencies, so that's somewhat outdated. That is possibly fairly easy to update with newer package names.

The other one which talks about getting all dependencies from a bzr branch seems to have been added in 2010 (https://code.launchpad.net/~wsk/widelands/OSX-libs) and not updated since. It seems to mostly concern building via Xcode, and I am not sure if one can convince Xcode to simply use the dependencies installed by brew or ports instead...

It doesn't seem like either has been used for quite some time though :/

Revision history for this message
GunChleoc (gunchleoc) wrote :

Where did you find that link?

I have updated https://wl.widelands.org/wiki/Building%20Widelands/#building-under-mac-os-x as well as I can.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

> Where did you find that link?

"Translated" the command bzr `branch lp:~wsk/widelands/OSX-libs` to the corresponding branch.

As a side note, it doesn't seem to be shown on https://code.launchpad.net/widelands, which I thought all non-merged branches would be regardless of age. It has develompent status too, so it shouldn't be that filtering it out.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>travis-retry sudo apt-get install -qq g++-$GCC_VERSION;

>etc, so that we can at least ensure that we can get the compilers?

That's a good idea :) I've added travis_retry for the compiler installation and package installation on macos. That should give us better control over the parts we install directly ourselves at least.

I found a way which (hopefully) starts xvfb on macos inspired by https://github.com/travis-ci/travis-ci/issues/7313. One of the last comments mentions that while the reporter got things running, it still didn't seem to have opengl support. Let's see if it is a step in the right direction.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Sgrìobh Hans Joachim Desserud na leanas 23/07/2017 aig 11:55:
>> Where did you find that link?
>
> "Translated" the command bzr `branch lp:~wsk/widelands/OSX-libs` to the corresponding branch.
>
> As a side note, it doesn't seem to be shown on https://code.launchpad.net/widelands, which I thought all non-merged branches would be regardless of age. It has develompent status too, so it shouldn't be that filtering it out.

I overlooked that.

This branch doesn't appear on the widelands page, because it is not a
branch of the Widelands code, and also not owned by widelands-dev.

I have added a note to the wiki that the libs are outdated.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2474. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/257196795.
Appveyor build 2299. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_travis_osx-2299.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2480. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/257496284.
Appveyor build 2305. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_travis_osx-2305.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Still can't get the regression tests to run on macos :(

Most of them fail with:
Your OpenGL installation must be __very__ broken. Missing GL version

libc++abi.dylib: terminating with uncaught exception of type WException: [/Users/travis/build/widelands/widelands/src/graphic/gl/initialize.cc:90] glewInit returns 1: Broken OpenGL installation.

or similar error messages. See https://travis-ci.org/widelands/widelands/jobs/258520338 for full log.

I've tried to follow instructions on https://github.com/travis-ci/travis-ci/issues/7313 to enable xvfb, which seems to be working (though I'm not 100% sure how to properly verify). It looks like this has some problems with (or possibly not) opengl support.

I'm kind of in the dark now, since I don't have real hardware to test on and I'm not familiar enough with the system to know exactly what to expect.

I'll add a comment on the bug report as well on the current situation. I'm pondering cleaning up this MP (remove some of the debugging) and only run the regression tests on linux for the time being. While I would like to include the regression tests as well, I'm not quite sure how to proceed, and being able to see that each commit is buildable on macos should bring us a step in the right direction.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Agreed - let's get this in and fix the regression test later.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2491. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/259451618.
Appveyor build 2315. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_travis_osx-2315.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Cleaned up and ready to go (even re-fixed indentation which had been bothering me)

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2497. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/259848338.
Appveyor build 2321. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_travis_osx-2321.

Revision history for this message
SirVer (sirver) wrote :

I think building on Mac OS is sufficient, the logic should be unchanged. And I also do not think that we require a ton of compilers there - one build should be sufficient. We test all the compilers on Linux and they should be compatible across OSes.

The test suite would be nice, but is run by me on OS X for each daily I build, so it is not super critical either. I think this can go as is.

Thanks for your work, as usual :).

However, the .travis.yml file seems to be broken right now (see last bunnybot comment), so this needs to get fixed first.

review: Needs Fixing
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>I think this can go as is.

:)

>However, the .travis.yml file seems to be broken right now (see last bunnybot comment), so this needs to get fixed first.

Oh, I missed that. Found the misaligned indentation, so the next build should be happier.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Travis is green now, so this can go in.

@bunnybot merge

review: Approve
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2521. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/263553747.
Appveyor build 2345. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_travis_osx-2345.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.travis.sh'
2--- .travis.sh 2017-07-17 11:05:42 +0000
3+++ .travis.sh 2017-08-11 15:21:11 +0000
4@@ -1,12 +1,25 @@
5 set -ex
6
7-if [ "$CXX" = "g++" ]; then
8- sudo apt-get install -qq g++-$GCC_VERSION;
9- export CXX="g++-$GCC_VERSION" CC="gcc-$GCC_VERSION";
10+if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
11+ #Install requested compiler version for linux
12+
13+ if [ "$CXX" = "g++" ]; then
14+ sudo apt-get install -qq g++-$GCC_VERSION;
15+ export CXX="g++-$GCC_VERSION" CC="gcc-$GCC_VERSION";
16+ fi
17+ if [ "$CXX" = "clang++" ]; then
18+ sudo apt-get install -qq clang-$CLANG_VERSION;
19+ export CXX="clang++-$CLANG_VERSION" CC="clang-$CLANG_VERSION";
20+ fi
21 fi
22-if [ "$CXX" = "clang++" ]; then
23- sudo apt-get install -qq clang-$CLANG_VERSION;
24- export CXX="clang++-$CLANG_VERSION" CC="clang-$CLANG_VERSION";
25+
26+if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
27+ # Install osx dependencies
28+ # boost and cmake are preinstalled :)
29+ brew install gettext glew icu4c sdl2 sdl2_image sdl2_mixer sdl2_ttf zlib
30+ # brew doesn't add a link by default
31+ brew link --force gettext
32+ brew link --force icu4c
33 fi
34
35 # Configure the build
36@@ -41,6 +54,8 @@
37 # Do the actual build.
38 make -k -j3
39
40-# Run the regression suite.
41-cd ..
42-./regression_test.py -b build/src/widelands
43+if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
44+ # Run the regression suite. Haven't gotten it working on osx, due to problems with xvfb and/or opengl support.
45+ cd ..
46+ ./regression_test.py -b build/src/widelands
47+fi
48
49=== modified file '.travis.yml'
50--- .travis.yml 2017-07-16 21:14:17 +0000
51+++ .travis.yml 2017-08-11 15:21:11 +0000
52@@ -5,7 +5,8 @@
53
54 before_script:
55 - export DISPLAY=:99.0
56- - sh -e /etc/init.d/xvfb start
57+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start ; fi
58+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ( sudo Xvfb :99 -ac -screen 0 1024x768x8; echo ok )& fi
59 - sleep 3 # give xvfb some time to start
60
61 # ignore this branch because it is only a mirror of master
62@@ -44,35 +45,58 @@
63
64 matrix:
65 include:
66- - compiler: clang
67+ ### MAC OSX BUILDS
68+ - os: osx
69+ env: BUILD_TYPE="Debug"
70+ - os: osx
71+ env: BUILD_TYPE="Release"
72+ ### LINUX + CLANG BUILDS
73+ - os: linux
74+ compiler: clang
75 env: CLANG_VERSION="3.4" BUILD_TYPE="Debug"
76- - compiler: clang
77+ - os: linux
78+ compiler: clang
79 env: CLANG_VERSION="3.5" BUILD_TYPE="Debug"
80- - compiler: clang
81+ - os: linux
82+ compiler: clang
83 env: CLANG_VERSION="3.9" BUILD_TYPE="Debug"
84- - compiler: clang
85+ - os: linux
86+ compiler: clang
87 env: CLANG_VERSION="4.0" BUILD_TYPE="Debug"
88- - compiler: clang
89+ - os: linux
90+ compiler: clang
91 env: CLANG_VERSION="3.4" BUILD_TYPE="Release"
92- - compiler: clang
93+ - os: linux
94+ compiler: clang
95 env: CLANG_VERSION="3.5" BUILD_TYPE="Release"
96- - compiler: clang
97+ - os: linux
98+ compiler: clang
99 env: CLANG_VERSION="3.9" BUILD_TYPE="Release"
100- - compiler: clang
101+ - os: linux
102+ compiler: clang
103 env: CLANG_VERSION="4.0" BUILD_TYPE="Release"
104- - compiler: gcc
105+ ### LINUX + GCC BUILDS
106+ - os: linux
107+ compiler: gcc
108 env: GCC_VERSION="4.8" BUILD_TYPE="Debug"
109- - compiler: gcc
110+ - os: linux
111+ compiler: gcc
112 env: GCC_VERSION="4.9" BUILD_TYPE="Debug"
113- - compiler: gcc
114+ - os: linux
115+ compiler: gcc
116 env: GCC_VERSION="6" BUILD_TYPE="Debug"
117- - compiler: gcc
118+ - os: linux
119+ compiler: gcc
120 env: GCC_VERSION="7" BUILD_TYPE="Debug"
121- - compiler: gcc
122+ - os: linux
123+ compiler: gcc
124 env: GCC_VERSION="4.8" BUILD_TYPE="Release"
125- - compiler: gcc
126+ - os: linux
127+ compiler: gcc
128 env: GCC_VERSION="4.9" BUILD_TYPE="Release"
129- - compiler: gcc
130+ - os: linux
131+ compiler: gcc
132 env: GCC_VERSION="6" BUILD_TYPE="Release"
133- - compiler: gcc
134+ - os: linux
135+ compiler: gcc
136 env: GCC_VERSION="7" BUILD_TYPE="Release"

Subscribers

People subscribed via source and target branches

to status/vote changes: