Fix macOS builds on travis

Having trouble installing or compiling FreeCAD? Get help here.
wmayer
Site Admin
Posts: 16465
Joined: Thu Feb 19, 2009 10:32 am

Fix macOS builds on travis

Postby wmayer » Sat May 26, 2018 2:22 pm

For several weeks the macOS builds don't work any more. The problems started here: https://travis-ci.org/FreeCAD/FreeCAD/b ... tification

The source code still compiled fine but it failed at the unit test but it was never really clear why.
stepping down with stepdown greater than total depth ... ok
======================================================================
FAIL: failed_to_load_TestFem (TestApp.LoadFailed)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/FreeCAD.app/Contents/Mod/Test/TestApp.py", line 52, in _runTest
self.fail("Couldn't load " + self.testName)
AssertionError: Couldn't load TestFem
----------------------------------------------------------------------
Ran 249 tests in 27.621s
FAILED (failures=1)
The command "${INSTALLED_APP_PATH} --console --run-test 0" exited with 1.
0.00s$ ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
The command "${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &" exited with 0.
10.00s$ sleep 10 && pkill FreeCAD
dlopen(/usr/local/FreeCAD.app/Contents/lib/WebGui.so, 2): Library not loaded: @rpath/QtWebKit.framework/Versions/5/QtWebKit
Referenced from: /usr/local/opt/qtwebkit/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
Reason: image not found
Traceback (most recent call last):
File "<string>", line 43, in Initialize
The command "sleep 10 && pkill FreeCAD" exited with 0.
Since yesterday a new problem occurred because the system no longer finds the Python dev files:
https://api.travis-ci.org/v3/job/383904724/log.txt
CMake Error at CMakeLists.txt:549 (message):

Failed to determine PYTHON_LIBRARY





-- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.10")

-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is exact version "2.7.10")

CMake Error at CMakeLists.txt:574 (MESSAGE):

=================================



Python not found, install Python!



=================================







-- Configuring incomplete, errors occurred!

See also "/Users/travis/build/FreeCAD/FreeCAD/build/CMakeFiles/CMakeOutput.log".

See also "/Users/travis/build/FreeCAD/FreeCAD/build/CMakeFiles/CMakeError.log".
Apparently Python 2.7 is not supported any more. Thus, in a test branch I switched to Python3 which now leads to the problem that travis builds all 3rd party libraries and then of course exceeds the time limit.
https://travis-ci.org/FreeCAD/FreeCAD/b ... tification

Any idea how to fix this crap?
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Fix macOS builds on travis

Postby peterl94 » Sun May 27, 2018 11:35 pm

I've started working on this. The original issue was that homebrew updated gcc, which broke our pre-compiled med-file package. This caused the app bundling to fail and it is why the tests were failing. I fixed that by updating the med-file package. However, now the cache archive is not being found:
2. Fetching lastest ports cache for FreeCAD from https://github.com//releases/download/v ... x86_64.tgz to /tmp/homebrew-10.11.6-x86_64.tgz
Failed to download ports cache
As you can see, it is missing the repo and version in the url. Maybe it has something to do with the message right above it. I don't know where it is coming from.
parse error: Invalid numeric literal at line 1, column 5
1. Determining ports archive download URL
parse error: Invalid numeric literal at line 1, column 5
Anyway, since it fails to downloads the cache, it proceeds with:

Code: Select all

brew install --verbose --only-dependencies freecad --with-packaging-utils
I'm not sure about the python issue yet. I'll test in a clean 10.11 VM and will let you know what I find.

I didn't look at the log, but I imagine it is building from source with python3 because we don't have pre-compiled packages for the formulas in FreeCAD/homebrew-freecad for python3.
chrisb
Posts: 28098
Joined: Tue Mar 17, 2015 9:14 am

Re: Fix macOS builds on travis

Postby chrisb » Mon May 28, 2018 12:39 am

Peter, thanks for working at this.
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Fix macOS builds on travis

Postby peterl94 » Mon May 28, 2018 3:24 am

Evidently it is something specific to the travis environment. I was unable to reproduce either issue in a local 10.11 vm.
wmayer
Site Admin
Posts: 16465
Joined: Thu Feb 19, 2009 10:32 am

Re: Fix macOS builds on travis

Postby wmayer » Mon May 28, 2018 10:33 am

Not sure what is the real reason but to me it seems the function prime_local_ports_cache in https://github.com/FreeCAD/FreeCAD-port ... helpers.sh fails to extract the relevant information.

This causes the function latest_GitHub_ports_cache_archive_url to create the wrong download url. From the template https://github.com/${repo}/releases/dow ... iptor}.tgz it creates https://github.com//releases/download/v ... x86_64.tgz because ${repo} and ${release} are both empty. Their values should be FreeCAD/FreeCAD-ports-cache and 0.18 to create this url: https://github.com/FreeCAD/FreeCAD-port ... x86_64.tgz
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Fix macOS builds on travis

Postby peterl94 » Mon May 28, 2018 7:07 pm

Well, whatever the issue was with downloading the homebrew archive has resolved itself. Now it is only failing because of not building the web module. If this commit should be kept, then BUILD_WEB will need to be turned on in .travis.yml.
wmayer
Site Admin
Posts: 16465
Joined: Thu Feb 19, 2009 10:32 am

Re: Fix macOS builds on travis

Postby wmayer » Tue May 29, 2018 7:34 am

If this commit should be kept, then BUILD_WEB will need to be turned on in .travis.yml.
The change can be reverted. I committed it to check if this would skip building the QtWebkit module which is very time consuming.

Thanks, for having a look at this issue.
chrisb
Posts: 28098
Joined: Tue Mar 17, 2015 9:14 am

Re: Fix macOS builds on travis

Postby chrisb » Tue May 29, 2018 10:55 am

Thanks alot to all for the most current MacOS FreeCAD.
chrisb
Posts: 28098
Joined: Tue Mar 17, 2015 9:14 am

Re: Fix macOS builds on travis

Postby chrisb » Wed May 30, 2018 8:47 pm

Tried it now for a couple of days and it works again. Thanks again.
wmayer
Site Admin
Posts: 16465
Joined: Thu Feb 19, 2009 10:32 am

Re: Fix macOS builds on travis

Postby wmayer » Thu May 31, 2018 7:02 pm

Problem is back. Now it fails with:
Still running (20 of 20): prime_local_ports_cache {"repo":"FreeCAD/FreeCAD-ports-cache","auth_token":"","release":"0.18"}
Timeout (20 minutes) reached. Terminating "prime_local_ports_cache {"repo":"FreeCAD/FreeCAD-ports-cache","auth_token":"","release":"0.18"}"
The command prime_local_ports_cache {"repo":"FreeCAD/FreeCAD-ports-cache","auth_token":"","release":"0.18"} exited with 137.
EDIT: Now it works again.