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: add appveyor and travis config #330

Merged
merged 3 commits into from
Dec 12, 2018

Conversation

NeroBurner
Copy link
Contributor

My attempt to use the services Appveyor and Travis to enable Continuous Integration for Glog

Add toolchain directory with cmake toolchain files used to find
compilers and set C++ versions

The following configurations are build on Windows using appveyor
service:

  • enable MSVC 2015 SDK 8.1
  • enable MSVC 2015
  • enable MSVC 2017
  • enable MSVC 2017 c++17
  • enable mingw-cxx11
  • enable mingw-gnuxx11
  • enable mingw-cxx17

The following configurations are build on Linux using travis service:

  • enable Ubuntu 14.04 amd64/i386, C++11
  • enable Ubuntu 16.04 amd64/i386, C++11
  • enable Ubuntu 18.04 amd64 C++98, C++11, GNU++11, C++17
  • enable mingw-w64 on Ubuntu 18.04 amd64, C++11, GNU++11, C++17

The tests for cross compiled mingw windows binaries are run using wine64

@NeroBurner
Copy link
Contributor Author

NeroBurner commented Jun 19, 2018

rebased on current master (after merge of #324)

Appveyor: https://ci.appveyor.com/project/NeroBurner/glog/build/1.0.99
Travis: https://travis-ci.org/NeroBurner/glog/builds/394096830?utm_source=github_status&utm_medium=notification

Compilation with MSVC works, but the stacktrace unittest hangs (as described in #328) as well as an error with the golden file at logging_unittest (described in #134)

the latest rebase fixes the cross compilation with mingw-w64 on Ubuntu 18.04. The error with logging_unittest is now the same as with the MSVC version (described in #134)

Copy link
Collaborator

@sergiud sergiud left a comment

Choose a reason for hiding this comment

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

Could you also add the CI status icons to the README?

It would be nice, if every PR is checked upon submission as described at https://www.appveyor.com/docs/notifications/#github-pull-request. However, I'm not sure how difficult is it to add the bots. Hence, this is just an idea for future work.

# *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc.cmake"

# find compiler
find_program(CMAKE_C_COMPILER gcc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

To my knowledge, toolchain files are supposed to set only (cache) variables. CMake will ensure the path to the compiler to be valid. No need to do this manually.


# set compiler
set(CMAKE_C_COMPILER "${CMAKE_C_COMPILER}" CACHE PATH "C compiler" FORCE)
set(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "C++ compiler" FORCE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Redundant. CMake will in the sysroot anyway. Setting CMAKE_C_COMPILER to gcc should already work.

@NeroBurner NeroBurner force-pushed the ci_travis_appveyor_master branch 2 times, most recently from 8aa5fa2 to abe37c6 Compare June 21, 2018 11:25
@NeroBurner
Copy link
Contributor Author

NeroBurner commented Jun 21, 2018

I added the Badges to the readme, but I also renamed README to README.md for markdown support. For a preview visit https://github.com/NeroBurner/glog/blob/ci_travis_appveyor_master/README.md

I removed the extra find_program and set CACHE commands. Waiting for MVSC builds to finish (timeout after 1500 seconds each)

edit: I'll squash the toolchain file cleanup after the tests finish
edit2: update Appveyor link, old one failed due to squash/rebase

@NeroBurner
Copy link
Contributor Author

  • rebased on current master c72907c
  • squashed the toolchain changes
  • Add a commit to limit the timeout of the stracktrace unittest to 30 seconds
  • README.md change needs to be approved

CI of current master (after merge of tests: fix compilation with C++17):

@NeroBurner
Copy link
Contributor Author

rebased on current master 3267f3e (Merge pull request #331 from NeroBurner/fix_windows_logging_ut)

CI:

Small Summary of test results:

  • Everything compiles
  • MSVC stacktrace unittest hangs with the following output
 4/6 Test #4: stacktrace .......................***Timeout  30.01 sec
  Obtained 10 stack frames.
  Backtrace 0: expected: 00007FF7B25F4500..00007FF7B25F4600  actual: 00007FF7B25F459F ... OK
  Backtrace 1: expected: 00007FF7B25F4840..00007FF7B25F4940  actual: 00007FF7B25F48CB ... OK
  Backtrace 2: expected: 00007FF7B25F48E0..00007FF7B25F49E0  actual: 00007FF7B25F496F ... OK
  Backtrace 3: expected: 00007FF7B25F4990..00007FF7B25F4A90  actual: 00007FF7B25F4A1F ... OK
  Backtrace 4: expected: 00007FF7B25F4A40..00007FF7B25F4B40  actual: 00007FF7B25F4ACF ... OK
  Backtrace 5: expected: 00007FF7B25F1E38..00007FF7B25F1F38  actual: 00007FF7B25F44E9 ... F0702 02:10:53.577635  4140 stacktrace_unittest.cc:109] Check failed: ret_addr <= range.end (00007FF7B25F44E9 vs. 00007FF7B25F1F38) 
  *** Check failure stack trace: ***
      @   00007FF7B25F712B  google::LogMessage::Fail
      @   00007FF7B25F7031  google::LogMessage::SendToLog
      @   00007FF7B25F6817  google::LogMessage::Flush
      @   00007FF7B25F8421  google::LogMessageFatal::~LogMessageFatal
      @   00007FF7B25F4443  CheckRetAddrIsInFunction
      @   00007FF7B25F47EE  CheckStackTraceLeaf
      @   00007FF7B25F48CB  CheckStackTrace4
      @   00007FF7B25F496F  CheckStackTrace3
      @   00007FF7B25F4A1F  CheckStackTrace2
      @   00007FF7B25F4ACF  CheckStackTrace1
      @   00007FF7B25F44E9  CheckStackTrace
      @   00007FF7B25F4B36  main
      @   00007FF7B2614C24  invoke_main
      @   00007FF7B2614AC7  __scrt_common_main_seh
      @   00007FF7B261498E  __scrt_common_main
      @   00007FF7B2614C49  mainCRTStartup
      @   00007FFD56A38364  BaseThreadInitThunk
      @   00007FFD593A70B1  RtlUserThreadStart
  • C++17 generates warning because of deprecation of auto_ptr
[ 76%] Building CXX object CMakeFiles/utilities_unittest.dir/src/utilities_unittest.cc.obj
/usr/src/app/src/logging_unittest.cc: In function 'void TestDCHECK()':
/usr/src/app/src/logging_unittest.cc:575:3: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
   auto_ptr<int64> sptr(new int64);
   ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/include/c++/bits/locale_conv.h:41:0,
                 from /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/include/c++/locale:43,
                 from /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/include/c++/iomanip:43,
                 from /usr/src/app/src/logging_unittest.cc:44:
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/include/c++/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~

@sergiud could you comment on the README.md update with the badges

Add toolchain directory with cmake toolchain files used to find
compilers and set C++ versions

The following configurations are build on Windows using appveyor
service:
- enable MSVC 2015 SDK 8.1
- enable MSVC 2015
- enable MSVC 2017
- enable MSVC 2017 c++17
- enable mingw-cxx11
- enable mingw-gnuxx11
- enable mingw-cxx17

The following configurations are build on Linux using travis service:
- enable Ubuntu 14.04 amd64/i386, C++11
- enable Ubuntu 16.04 amd64/i386, C++11
- enable Ubuntu 18.04 amd64 C++98, C++11, GNU++11, C++17
- enable mingw-w64 on Ubuntu 18.04 amd64, C++11, GNU++11, C++17

The tests for cross compiled mingw windows binaries are run using wine64
The stacktrace unittest hangs when compiled with MSVC. The default
timeout is 1500 seconds. Change it to 30 seconds
@NeroBurner
Copy link
Contributor Author

rebased on current master 8d7a107 (Merge pull request #344 from dzung-hoang/master)

@sergiud please comment on README.md badge change and if it should be a separate pull request. And if the rest of the PR is ok

@NeroBurner
Copy link
Contributor Author

@sergiud ping

@sergiud sergiud merged commit 125d6b3 into google:master Dec 12, 2018
@sergiud
Copy link
Collaborator

sergiud commented Dec 12, 2018

@NeroBurner Thank you!

@sergiud
Copy link
Collaborator

sergiud commented Dec 12, 2018

@shinh @ukai Could someone of you guys setup Travis and AppVeyor for glog?

https://travis-ci.org/google/glog
https://ci.appveyor.com/project/google/glog

@NeroBurner NeroBurner deleted the ci_travis_appveyor_master branch December 13, 2018 07:20
durswd pushed a commit to durswd/glog that referenced this pull request Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants