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
Conversation
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 :) |
Understood. All the checks have passed and this is ready for reviewed. cc @b4n |
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. |
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 |
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. |
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. |
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. |
No BSDs I'm afraid, maybe OSX should be left to another PR, lets see what @b4n says about this one for now. |
There was a problem hiding this 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
sources: | ||
- llvm-toolchain-trusty-5.0 | ||
packages: | ||
- clang-5.0 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
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. |
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.
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? |
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? |
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. |
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 ( |
@b4n does Mitchell actually check with the compilers he claims to support? |
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 |
@andy5995 don't ever [Edit: deliberately] 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... |
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.
It's coming from |
make -j2 check; | ||
else | ||
make -j2 distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; | ||
fi; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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.
I tried with 3.8. fail. |
Here clang 3.9 works, clang 5.0 fails. Note |
Now its failed on another |
@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 @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 :) |
Do you build a clean clone each time? Needing https://travis-ci.org/geany/geany/jobs/528683476, build 1959.12:
That's already suspicious. And the job summary suggest Travis thinks it's gcc, but we set clang-3.5.
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 :
Maybe it's nothing, but it'd get me looking. |
Yep, totally agree, thats why I did make clean in between (although with meson it wouldn't be needed
Yes, I'm running configure each time.
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? |
Also not needed with https://github.com/kugel-/kmake :-) |
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. |
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. |
@b4n LGTM feel free to do any fine-tuning and finish it up |
You're welcome |
This works but I'm not sure yet how much the code can be reduced by using a build matrix. Comments welcome.