Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Move emscripten to ubuntu docker builds #105

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions package/ci/travis-emscripten.sh
@@ -1,12 +1,19 @@
#!/bin/bash
set -ev

# Get ninja-build
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
unzip ninja-linux.zip
mv ninja /usr/local/bin/
ninja --version
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh. I suppose apt install ninja just doesn't work on docker, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, actually sure, that would work, if there's a package (I assume it's called ninja-build, though?)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the yml it's listed among the packages, but I think it's ninja-build, yes.


git submodule update --init

# Build native corrade-rc
mkdir build && cd build || exit /b
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MAKE_PROGRAM=ninja \
-DCMAKE_INSTALL_PREFIX=$HOME/deps-native \
-DWITH_INTERCONNECT=OFF \
-DWITH_PLUGINMANAGER=OFF \
Expand All @@ -19,16 +26,16 @@ cd ..
# Crosscompile
mkdir build-emscripten && cd build-emscripten
cmake .. \
-DCMAKE_MAKE_PROGRAM=ninja \
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten-wasm.cmake" \
-DEMSCRIPTEN_PREFIX=$(echo /usr/local/Cellar/emscripten/*/libexec) \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -O1" \
-DCMAKE_INSTALL_PREFIX=$HOME/deps \
-DCMAKE_EXE_LINKER_FLAGS_RELEASE="-O1" \
-DBUILD_TESTS=ON \
-G Ninja
ninja -j4
ninja -j2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ninja, it should figure out the cores on its own.

I faintly remember I had to do this because otherwise at some point it was running 8 jobs at once, running out of memory. Probably not an issue nowadays anymore.


# Test
CORRADE_TEST_COLOR=ON ctest -V
Expand Down
12 changes: 9 additions & 3 deletions package/ci/travis.yml
Expand Up @@ -98,13 +98,19 @@ matrix:
env:
- JOBID=ios
- TARGET=ios-simulator
- language: cpp
os: osx
- language: generic
os: ubuntu
services:
- docker
# Using whatever is the default, since that could be hopefully most
# up-to-date
env:
- JOBID=emscripten
- TARGET=emscripten
- EMSCRIPTEN_VERSION=2.0.7
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to test on the oldest version available, ideally exactly what was there on Mac (1.38.42)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker image supports everything above 1.39.0, 1.38.42 is pretty ancient

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then 1.39.0 :)

before_install:
- docker pull emscripten/emsdk:${EMSCRIPTEN_VERSION}
- docker ps -a
- language: android
os: linux
# Setting xenial here will cause it to use 12.04, with GCC 4.6 and other
Expand Down Expand Up @@ -179,7 +185,7 @@ script:
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ]; then ./package/ci/travis-android-arm.sh; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "desktop" ]; then ./package/ci/travis-desktop.sh; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "ios-simulator" ]; then ./package/ci/travis-ios-simulator.sh; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "emscripten" ]; then ./package/ci/travis-emscripten.sh; fi
- if [ "$TARGET" == "emscripten" ]; then docker run -v $TRAVIS_BUILD_DIR:/github -w /github -t emscripten/emsdk:${EMSCRIPTEN_VERSION} /bin/bash -c ./package/ci/travis-emscripten.sh; fi
# Travis somehow is not able to gather all output, try to force it using this
- sync

Expand Down