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

add gcc 7 and 8 build to travis tests #2067

Closed
wants to merge 25 commits into from
Closed

add gcc 7 and 8 build to travis tests #2067

wants to merge 25 commits into from

Conversation

andy5995
Copy link
Contributor

This works but I'm not sure yet how much the code can be reduced by using a build matrix. Comments welcome.

@andy5995 andy5995 changed the title add gcc 7 and 8 build to travis tests [wip] add gcc 7 and 8 build to travis tests Apr 30, 2019
@andy5995 andy5995 changed the title [wip] add gcc 7 and 8 build to travis tests add gcc 7 and 8 build to travis tests Apr 30, 2019
@elextr
Copy link
Member

elextr commented Apr 30, 2019

To record conversation from IRC, I don't think there is any need to matrix all the envs with the compiler types.

Travis for Geany is essentially a compile check (there are no real Geany tests to run, just a few ctags ones from upstream). So all we need is each of the env options to get compiled, and to look out for any compile issues with variations of compilers (and newly defaulted stupid warnings :)

@andy5995
Copy link
Contributor Author

Understood. All the checks have passed and this is ready for reviewed.

cc @b4n

@elextr
Copy link
Member

elextr commented Apr 30, 2019

Clang could also be added, but it does have a "-pthread option not used" warning on the link (on clang 6 which is my default here) which googling seems to imply is harmless. Googling also implies that libtool automatically adds this, so it might not be easy to fix.

@andy5995
Copy link
Contributor Author

Clang could also be added

May be worth a short discussion that if an osx (xcode) test were added, it would use clang. So the question would be, should the osx test be added? should it be added on a separate PR? And if so, would that render a clang test on Ubuntu as not needed?

cc @techee

@andy5995
Copy link
Contributor Author

I'm pretty sure if it's decided that adding osx is ultimately desired, it should be done in a separate PR, because most of the stuff in the 2nd half of .travis.yml would have to be put in conditional statements (if linux (run this) if osx (run this), and some brew lines would be needed to install packages if the test was for osx.

@elextr
Copy link
Member

elextr commented Apr 30, 2019

Well, OSX stuff is in a separate repository geany/geany-osx, so not sure if the code here compiles on OSX by itself.

@andy5995
Copy link
Contributor Author

Well, OSX stuff is in a separate repository geany/geany-osx, so not sure if the code here compiles on OSX by itself.

Ok, so in travis.yml there'd need to be instructions to clone that repo or cache it.

@techee
Copy link
Member

techee commented Apr 30, 2019

Well, OSX stuff is in a separate repository geany/geany-osx, so not sure if the code here compiles on OSX by itself.

Not really, geany-osx contains just the bundling stuff but no code so it would make sense to have an osx test. I just think the osx builders tend to be overloaded on travis and take too much time to build. However, the command-line part of osx behaves like freebsd so if there's some BSD builder on travis, we could use that one.

@elextr
Copy link
Member

elextr commented Apr 30, 2019

No BSDs I'm afraid, maybe OSX should be left to another PR, lets see what @b4n says about this one for now.

Copy link
Member

@b4n b4n left a comment

Choose a reason for hiding this comment

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

This sounds good, but I'm not so sure how important it is to check with recent compilers -- old ones for compat, new ones… well, it certainly doesn't hurt :) However, we most probably don't need to run distcheck on all compilers, as it's mostly checking the build system itself rather than the compilation. Only all (obviously) and check are really useful to run everywhere for a sensible test, and that might give a comfortable speed up by not building everything twice. This can be changed at some later point tho, and can probably be fixed by e.g. setting TARGETS="all check distcheck" in the "normal" case and removing distcheck in the "compiler builds", and replacing the make -j2 && make -j2 check && make -j2 distcheck with just make -j2 $TARGETS.

Anyway, the change seems a little verbose, but there might not be a shorter syntax for this (I'm no YAML expert tho).

.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated
sources:
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
Copy link
Member

Choose a reason for hiding this comment

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

Ideally we'd test with clang 3.4 as it's supposed to be able to build Scintilla, which is our most bleeding edge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace 5.0 with 3.4, or add 3.4?

Copy link
Member

Choose a reason for hiding this comment

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

Sadly Geany C89 is the trailing edge, although I think a few C99s have crept in under the radar :)

But Clang 3.4 isn't officially C++11 either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see that the 3.4 toolchain is available anymore https://www.ubuntuupdates.org/package/xorg-edgers/trusty/main/base/llvm-toolchain-3.4

3.5 fails on trusty and xenial
5 passes on trusty
7 passes on xenial

before_install:
- eval "${MATRIX_EVAL}"
Copy link
Member

Choose a reason for hiding this comment

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

this should be in before_script below with the CFLAGS export, shouldn't it?

Copy link
Member

Choose a reason for hiding this comment

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

Also I'd rather see this done using export, and set e.g. MATRIX_EXPORT="CC=clang-5.0 CXX=clang++-5.0", which is effectively what we want done (and so it doesn't rely on CC and CXX being exported by something else).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As @elextr noted, what I've used is suggested by the travis docs. It doesn't appear from the logs that CC and CXX are getting exported by anything else later. But you're concern is that it's a possibility? But definitely let me know if you're sure you'd like me to change that anyway.

.travis.yml Show resolved Hide resolved
@elextr
Copy link
Member

elextr commented May 1, 2019

@b4n

Anyway, the change seems a little verbose, but there might not be a shorter syntax for this (I'm no YAML expert tho).

The syntax is copied from the Travis help page link I posted on #2139 so blame it on Travis. This applies to some of your comments above too, so unless you know better than Travis themselves maybe it should stay as is.

@andy5995
Copy link
Contributor Author

andy5995 commented May 2, 2019

However, we most probably don't need to run distcheck on all compilers, as it's mostly checking the build system itself rather than the compilation. Only all (obviously) and check are really useful to run everywhere for a sensible test, and that might give a comfortable speed up by not building everything twice. This can be changed at some later point tho, and can probably be fixed by e.g. setting TARGETS="all check distcheck" in the "normal" case and removing distcheck in the "compiler builds", and replacing the make -j2 && make -j2 check && make -j2 distcheck with just make -j2 $TARGETS.

I pushed a commit that addresses that. But I made the change before I reviewed your suggested approach. If you'd like it changed, please let me know.

Anyway, the change seems a little verbose, but there might not be a shorter syntax for this (I'm no YAML expert tho).

That's another copy/paste from the travis docs. afaik the only way to reduce the lines is to use a script that manually imports the toolchain repo and keys, and installs the appropriate gcc package.

However, using the the "addons/source" travis directive as it is now may be easier in the long-run, to maintain. What do you think?

@andy5995
Copy link
Contributor Author

andy5995 commented May 6, 2019

Oh.. a lot of errors when building the documentation on xenial

https://travis-ci.org/geany/geany/jobs/528635477#L1635

compared to trusty

https://travis-ci.org/geany/geany/jobs/527884388#L1667

Should a build fail when that happens?

@elextr
Copy link
Member

elextr commented May 6, 2019

We shouldn't be allowing anything to fail, the problem with clang needs to be fixed.

Not sure why, but it seems to have the wrong library version, you can see its using ".../c++/4.8/..." with clang 5. Thats likely the problem.

@elextr
Copy link
Member

elextr commented May 6, 2019

Note: clang 5 doesn't work on my system, not just Travis, (even with -std=c++11) but clang 6 does. But removing the "noexcept"s from LineMarker (scintilla/src/linemaker.h) makes it work.

@elextr
Copy link
Member

elextr commented May 6, 2019

@b4n does Mitchell actually check with the compilers he claims to support?

@andy5995
Copy link
Contributor Author

andy5995 commented May 6, 2019

Got some VERBOSE output from the latest Travis build https://travis-ci.org/geany/geany/jobs/528700712#L1734

@andy5995
Copy link
Contributor Author

andy5995 commented May 6, 2019

Got some VERBOSE output from the latest Travis build https://travis-ci.org/geany/geany/jobs/528700712#L1734

I see now C++11 support for clang < 6 was already being added by the -std=gnu++11 flag

@elextr
Copy link
Member

elextr commented May 6, 2019

@andy5995 don't ever [Edit: deliberately] use the gnu++ flags, they can contain things that actually conflict with the standard, so its not portable.

@andy5995
Copy link
Contributor Author

andy5995 commented May 6, 2019

@andy5995 don't ever use the gnu++ flags, they can contain things that actually conflict with the standard, so its not portable.

Ok, but I didn't put that there xD I don't know where it's coming from...

@b4n
Copy link
Member

b4n commented May 7, 2019

@b4n does Mitchell actually check with the compilers he claims to support?

I'm not sure. And if it's due to the linemarker thing and this PR got rebased on master, it makes sense it breaks, and it's a good thing we know it.

This said, for me clang 3.8 builds master.

Ok, but I didn't put that there xD I don't know where it's coming from...

It's coming from AX_CXX_COMPILE_STDCXX_11 which figured it's a way to get that compiler to support C++11 -- or at least a part of it that is checked for.

.travis.yml Outdated Show resolved Hide resolved
make -j2 check;
else
make -j2 distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS";
fi;
Copy link
Member

Choose a reason for hiding this comment

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

I don't like that, because what you do is build one more time, and only that one do the distcheck. And given how distcheck works (make the tarball and try to build it), it could possibly be affected by the configuration options selecting buildig or not some code (even though it should not if we didn't mess up, but CI is to catch case where we did, isn't it 😄 ). So it is a good thing it's checked for all variations of the environment.

Only the same environment with different compilers is not useful, because building with another compiler shouldn't affect what we're building.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't completely understand this but let me know if the change I made is what you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now its failed on another noexcept, @andy5995 please don't trigger another build, its not possible to see old build logs, wait for others to see it.

Sure, I'll wait. But I do believe you can see old build logs at https://travis-ci.org/geany/geany/pull_requests

Copy link
Member

Choose a reason for hiding this comment

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

I didn't completely understand this but let me know if the change I made is what you want.

now DISTCHECK_ONLY is never set, is it?
but stop worrying about this part and we'll see once the build stuff is dealt with

Copy link
Member

Choose a reason for hiding this comment

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

my bad I missed the one in the matrix

andy5995 added 13 commits May 8, 2019 01:14
This should add it as a separate job and make it more clear
according to Travis docs, the default is 3.5, which fails on xenial.
Clang now failing with 5.0 on trusty, though it worked before (as can be
seen from the log)
* keep clang 5 for now to see if removing the cache was the problem in
previous commit.

* Show versions being used a little more clearly (before_script)
The travis docs say 3.5 is the default on trusty but the previous test
showed 5.0 was being used.

The other job specified for 5.0 on trusty failed again even after the
ccache directive was removed. Switching that to xenial.
trying this after reading jeaye/color_coded#28
and based on what @elextr mentioned about the incorrect libs.
@andy5995
Copy link
Contributor Author

andy5995 commented May 8, 2019

@b4n does Mitchell actually check with the compilers he claims to support?

I'm not sure. And if it's due to the linemarker thing and this PR got rebased on master, it makes sense it breaks, and it's a good thing we know it.

This said, for me clang 3.8 builds master.

I tried with 3.8. fail.

@elextr
Copy link
Member

elextr commented May 8, 2019

This said, for me clang 3.8 builds master.

I tried with 3.8. fail.

Here clang 3.9 works, clang 5.0 fails. Note make clean needed to make it fail. Also I'm building GTK-3 all the time, but GTK-2 works with 3.9 as well.

@elextr
Copy link
Member

elextr commented May 8, 2019

Now its failed on another noexcept, @andy5995 please don't trigger another build, its not possible to see old build logs, wait for others to see it.

@elextr
Copy link
Member

elextr commented May 8, 2019

@b4n the comment above by @andy5995 about library versions was an observation I made that the LineMarker failure happened in an STL file in ".../c++/n.m/..." where the n.m version did not match the compiler version see https://travis-ci.org/geany/geany/builds/528683464 the 3.5 compiler used 4.8 STL and the 5.0 compiler used 5.4.0 STL?

@andy5995 installing different libraries isn't the solution, it needs to use whats on peoples systems, the point of travis is to find problems, not for us to force it to work by creating a non-standard configuration :)

@b4n
Copy link
Member

b4n commented May 8, 2019

Here clang 3.9 works, clang 5.0 fails. Note make clean needed to make it fail.

Do you build a clean clone each time? Needing make clean doesn't suggest so, and I personally wouldn't try rebuilding half the project with another compiler and expect things to go smoothly :)
Also, just to me sure: you need to re-run configure with the new values of CC and CXX, not merely run make CC=... CXX=... -- the later could work, but it also could fail.

https://travis-ci.org/geany/geany/jobs/528683476, build 1959.12:

$ export MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
$ export TRAVIS_COMPILER=gcc
$ export CXX=g++
$ export CXX_FOR_BUILD=g++
$ export CC=gcc
$ export CC_FOR_BUILD=gcc

That's already suspicious. And the job summary suggest Travis thinks it's gcc, but we set clang-3.5.

/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/unique_ptr.h:166:18:

That gets me worried: it looks like it's using GCC 4.8 include paths with Clang…

Similarly in build 1959.13 which is supposed to be Clang 5.0 :

$ export MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
$ export TRAVIS_COMPILER=clang
$ export CXX=clang++
$ export CXX_FOR_BUILD=clang++
$ export CC=clang
$ export CC_FOR_BUILD=clang
$ clang --version
clang version 7.0.0 (tags/RELEASE_700/final)
[…]
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:217:18:

Maybe it's nothing, but it'd get me looking.

@elextr
Copy link
Member

elextr commented May 8, 2019

Needing make clean doesn't suggest so, and I personally wouldn't try rebuilding half the project with another compiler and expect things to go smoothly :)

Yep, totally agree, thats why I did make clean in between (although with meson it wouldn't be needed </troll>) just that I forgot one time and noted it "worked", and despite the mixed compiles it ran too :)

Also, just to me sure: you need to re-run configure with the new values of CC and CXX, not merely run make CC=... CXX=... -- the later could work, but it also could fail.

Yes, I'm running configure each time.

That gets me worried: it looks like it's using GCC 4.8 include paths with Clang…

I think (but no expert on this level of details) that for the STL clang uses the same as gcc so the compiled products can be linked together, the clang package here is dependent on libstdc++ and libgcc not any clang specific version. On that basis I wonder if the version difference isn't an issue since one is a gcc version and the other is a clang version?

@kugel-
Copy link
Member

kugel- commented May 8, 2019

(although with meson it wouldn't be needed )

Also not needed with https://github.com/kugel-/kmake :-)

@b4n
Copy link
Member

b4n commented May 8, 2019

@andy5995 what about the latest state on #2149? it's still verbose but indeed I don't know how to improve it, and has a solution I like better for running only some targets. Also I dropper clang builds failing because we have code they don't like, see that PR for details on why.

@andy5995
Copy link
Contributor Author

andy5995 commented May 8, 2019

https://travis-ci.org/geany/geany/jobs/528683476, build 1959.12:

$ export MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
$ export TRAVIS_COMPILER=gcc
$ export CXX=g++
$ export CXX_FOR_BUILD=g++
$ export CC=gcc
$ export CC_FOR_BUILD=gcc

That's already suspicious. And the job summary suggest Travis thinks it's gcc, but we set clang-3.5.

Oh, looks like I forgot to set the "compiler" in that section. I'll push a new commit

@andy5995
Copy link
Contributor Author

andy5995 commented May 8, 2019

https://travis-ci.org/geany/geany/jobs/528683476, build 1959.12:

$ export MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
$ export TRAVIS_COMPILER=gcc
$ export CXX=g++
$ export CXX_FOR_BUILD=g++
$ export CC=gcc
$ export CC_FOR_BUILD=gcc

That's already suspicious. And the job summary suggest Travis thinks it's gcc, but we set clang-3.5.

Oh, looks like I forgot to set the "compiler" in that section. I'll push a new commit

I see now you're trying stuff in #2149 so I'll hold off on any more changes.

btw, anyone with "maintainer" access can just edit the files in this PR.

@andy5995
Copy link
Contributor Author

andy5995 commented May 8, 2019

Similarly in build 1959.13 which is supposed to be Clang 5.0 :

$ export MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
$ export TRAVIS_COMPILER=clang
$ export CXX=clang++
$ export CXX_FOR_BUILD=clang++
$ export CC=clang
$ export CC_FOR_BUILD=clang
$ clang --version
clang version 7.0.0 (tags/RELEASE_700/final)
[…]
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:217:18:

Maybe it's nothing, but it'd get me looking.

afaik, it's showing that near the start because 7.0 is the default. Later it installs the correct packages and sets the other vars appropriately.

But for the other quote (not included ) where it shows gcc vars being exported, I'll say again it's because I forgot to add the compiler line to that section.

@andy5995
Copy link
Contributor Author

andy5995 commented May 9, 2019

@andy5995 what about the latest state on #2149? it's still verbose but indeed I don't know how to improve it, and has a solution I like better for running only some targets. Also I dropper clang builds failing because we have code they don't like, see that PR for details on why.

@b4n LGTM feel free to do any fine-tuning and finish it up

@elextr
Copy link
Member

elextr commented May 9, 2019

Closed as replaced by #2149, @andy5995 thanks for starting the process.

@elextr elextr closed this May 9, 2019
@andy5995
Copy link
Contributor Author

andy5995 commented May 9, 2019

You're welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants