Travis build failure

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
wmayer
Founder
Posts: 20240
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Travis build failure

Post by wmayer »

Hi,

since the Link3 branch is merged into master we get a nasty build failure on Travis for clang. It's caused because boost::shared_ptr doesn't accept a std::unique_ptr as argument.

I am not sure what exactly the reason is. It could be that the boost version (1.55) is too old or the clang version (5.0) doesn't support certain features of C++11. Since the gcc builds for the same boost version don't fail I guess the culprit rather must be the clang compiler.

In either case the used Ubuntu system is 14.04 which is not supported any more. I wonder if we can upgrade the minimum Ubuntu version to 16.04.

Helpful would be also to upgrade the used OCCT version to 7.2 because this has fixed many warnings the clang compiler otherwise will complain about.

In the long-term I want to extend the list of warnings the compiler should complain about and therefore it would be good that the compiler won't report about issues of 3rd party libraries but only about FreeCAD code.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Travis build failure

Post by sgrogan »

wmayer wrote: Mon Aug 19, 2019 11:22 am In either case the used Ubuntu system is 14.04 which is not supported any more. I wonder if we can upgrade the minimum Ubuntu version to 16.04.

Helpful would be also to upgrade the used OCCT version to 7.2 because this has fixed many warnings the clang compiler otherwise will complain about.
How do you feel about jumping to 18.04? The mainadvantage would be the ability to get QT5 builds because we have the necessary packages on the PPA. I think we will need to add a PPA pivy package for 16.04 to get PY3 working. I think @looo previously provide d this package on his personal PPA, so this might not be a big deal.

I see @triplus is working on this. I think you need the 1.58 in the boost packages https://packages.ubuntu.com/xenial/libboost-dev and netgen needs to be disabled.
"fight the good fight"
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Travis build failure

Post by triplus »

I started working on this today:

https://github.com/FreeCAD/FreeCAD/pull/2439

But this was more of an "i am feeling lucky" attempt. And obviously this things will never work in the first such attempt. ;) Therefore i will do more tests locally tomorrow and update the PR. Basically today's PR likely would have worked if i would have guessed build dependencies better. If desired we could try out Bionic too (locally i am still on Xenial) but i guess for testing purposes i could set up Bionic.

P.S. After App::Link got merged my local Py2/Qt4 build succeeds and Py3/Qt5 build fails. Disabling Path workbench makes the Py3/Qt5 build to succeed. I mentioned it here but this could be toolchain related issue, similar to the one this thread was started for.
wmayer
Founder
Posts: 20240
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Travis build failure

Post by wmayer »

Today I started an Ubuntu 14.04 system locally and there I got of course the same build failure.

I prepared some test code to work around the clang (or boost) limitation:

Code: Select all

#include <memory>
#include <iostream>
#include <boost/smart_ptr/shared_ptr.hpp>

int main()
{
    std::unique_ptr<int> u_ptr(new int(42));
    std::cout << " u_ptr.get() = " <<  u_ptr.get() << std::endl;
    std::cout << "*u_ptr       = " << *u_ptr       << std::endl;

    std::shared_ptr<int> s_ptr{std::move(u_ptr)};
    //boost::shared_ptr<int> s_ptr(u_ptr); // fails with clang 3.4
    //boost::shared_ptr<int> s_ptr(u_ptr.release()); // works with clang
    std::cout << "After move" << std::endl;
    std::cout << " u_ptr.get() = " <<  u_ptr.get() << std::endl;
    std::cout << " s_ptr.get() = " <<  s_ptr.get() << std::endl;
    std::cout << "*s_ptr       = " << *s_ptr       << std::endl;

    return 0;
}
The trick is to explicitly call release() so that responsibility to manage the pointer moves from unique_ptr to shared_ptr.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Travis build failure

Post by triplus »

I took a look (locally) and dependencies aren't the problem on why (Xenial) Travis fails at this stage. It's highly likely related to cache being used and that doesn't play along well with the updated toolchain. I don't have an appropriate Travis permissions, therefore somebody that has them should click on Details link from the PR that will open a Travis page with the failed build:

https://github.com/FreeCAD/FreeCAD/pull/2439

Under more options there should be a possibility to clear caches:

https://docs.travis-ci.com/user/caching ... ing-caches

After clearing caches PR build should be restarted. If the build will fail again in the early CMake stages, highly likely caches for master branch will need to get cleared too.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Travis build failure

Post by sgrogan »

triplus wrote: Tue Aug 20, 2019 11:10 am After clearing caches PR build should be restarted.
After clearing the pull request cache and restarting the build, it still fails to find the boost stuff.
I also see this in the log https://travis-ci.org/FreeCAD/FreeCAD/j ... 16859#L159
"fight the good fight"
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Travis build failure

Post by triplus »

sgrogan wrote: Tue Aug 20, 2019 9:06 pm After clearing the pull request cache and restarting the build, it still fails to find the boost stuff.
Thanks for trying it. Based on some research i imagined this might happen. As both PR cache and master branch cache would likely need to get cleared. Otherwise PR still ends up using the old cache, the issue likely being related to CMakeCache.txt. Could both be cleared and for PR build to be restarted after? If not i guess i need to explore other options to proceed.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Travis build failure

Post by sgrogan »

triplus wrote: Tue Aug 20, 2019 9:46 pm Could both be cleared and for PR build to be restarted after?
Cleared the master cache, I didn't need to create the PR cache because it wasn't created at the last build attempt.
Basically the same errors https://travis-ci.org/FreeCAD/FreeCAD/b ... tification
"fight the good fight"
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Travis build failure

Post by triplus »

sgrogan wrote: Wed Aug 21, 2019 9:55 pm Cleared the master cache, I didn't need to create the PR cache because it wasn't created at the last build attempt.
Basically the same errors https://travis-ci.org/FreeCAD/FreeCAD/b ... tification
Thanks. I made a few changes (force updates) and hopefully the next scheduled build will move us forward.
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Travis build failure

Post by ezzieyguywuf »

triplus wrote: Thu Aug 22, 2019 1:15 am hopefully the next scheduled build will move us forward.
If not can you post the error? I browsed around the travis-ci a bit but couldn't find a failing build.
Post Reply