Setup CI for VC10 with all dependency in place
Hi,
I need to set up a CI build for a project hosted in github. The build must be in Windows, Microsoft Visual Studio 2010. And the build command can be cmake.
The challenge here is to set up correct build steps for the project as it depends on several other external tools/library (e.g., protobuf, zlib). Now in POSIX system, I can set up to run some command line like this:
- sudo apt-get -qq install libprotobuf-dev
- sudo apt-get -qq install protobuf-compiler
- blah blah
Now I understand that I have to set up an appveyor.yml do do all of this. How can I do this in a Windows system. Note I am a potential customer, and if I can set up this CI easily, I would be stick with appveyor for quite a while.
Thanks for your help.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 28 Jan, 2015 12:48 AM
Hi,
How would you pull those dependencies on Windows (I mean, normally, without AppVeyor)? Is it a msys involved?
Found this: https://wiki.alliedmods.net/Compiling_libprotobuf#Windows - seems like you can grab zip and then build lib from sources.
2 Posted by doducthanhbk on 28 Jan, 2015 01:44 AM
Normally, I would have to download zips manually (i.e, right click, save as target, yes windows does not have wget :( ). And some dependencies does not allow you to build from command line (i.e, you have
Alternatively, I would think somehow in the source folder I would have a folder where I put all headers and precompile library there. Then I would modify my cmakelists.txt to find library files and headers there. Then I would build using cmake. This would work, right?
Assuming all the above will work, I will have to create a appveyor.yml find to do all those steps. How would I do that? This is the first time I am working with CI and AppVeyor), hence this newbie question.
Thanks.
Support Staff 3 Posted by Feodor Fitsner on 28 Jan, 2015 02:51 AM
There is a number of ways to download files on build server:
http://www.appveyor.com/docs/how-to/download-file
http://www.powershellatoms.com/basic/download-file-website-powershell/
Yes, you could have build dependencies either in the repo (say
lib
andinclude
folders) or a zip file that is downloaded during the build.You can start from configuring everything on UI and then export settings into YAML if you want to keep them in the repo.
4 Posted by doducthanhbk on 28 Jan, 2015 03:40 AM
Thanks! I'll go with creating a folder first then.
A follow up question. since I'll build using Cmake, is it readily available? (i.e., i don't have to specify an installation on the yml file.)
Support Staff 5 Posted by Feodor Fitsner on 28 Jan, 2015 03:43 AM
Yeah, there is CMake 2.8 available on build workers: http://www.appveyor.com/docs/installed-software
-Feodor
6 Posted by doducthanhbk on 28 Jan, 2015 09:01 PM
I also need Visual Studio 2010 but the UI option does not have that. How can I specify this on the UI. Moreover, where can I add the CMake step.
For instance I want to the script to do something like this.
mkdir _build
cd _build
cmake .. -G "Visual Studio 10 2010"
cmake --build .
Thank you.
7 Posted by doducthanhbk on 28 Jan, 2015 09:25 PM
cmake .. -Wno-dev -G "Visual Studio 10 2010"
CMake Error: Could not create named generator Visual Studio 10 2010
Command exited with code 1
I am having this error message. It seems like VC10 is not supported?
Support Staff 8 Posted by Feodor Fitsner on 28 Jan, 2015 10:32 PM
There is no full VS 2010 on build workers - only Express editions: http://www.appveyor.com/docs/installed-software
Maybe you should use a different name for generator?
-Feodor
9 Posted by doducthanhbk on 28 Jan, 2015 11:08 PM
Now I hit this error
cmake .. -G "Visual Studio 10"
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:15 (project)
-- The C compiler identification is unknown
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:15 (project)
-- The CXX compiler identification is unknown
-- Could NOT find PROTOBUF (missing: PROTOBUF_LIBRARY)
-- Found PythonInterp: C:/Python27/python.exe (found version "2.7.8")
-- Looking for include file pthread.h
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PROTOBUF_LITE_LIBRARY (ADVANCED)
linked by target "orc" in directory C:/projects/orc/src
-- Configuring incomplete, errors occurred!
See also "C:/projects/orc/_vc10/CMakeFiles/CMakeOutput.log".
See also "C:/projects/orc/_vc10/CMakeFiles/CMakeError.log".
Command exited with code 1
It seems that Cmake cannot find c compiler. How would I fix that With full VC10, I can do something like:
& "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
But not sure how I would do that with VC express.
Thanks
10 Posted by doducthanhbk on 29 Jan, 2015 01:49 AM
Well I was able to work around with this option:
cmake -DCMAKE_MAKE_PROGRAM=C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe -G "Visual Studio 10" ..
Now I hit another error:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h(26): fatal error C1083: Cannot open include file: 'ammintrin.h':
Some header is missing. This seems like an error with the build agent environment itself. Can you take a look?
This link:
http://wishmesh.com/2011/04/fatal-error-c1083-cannot-open-include-file-ammintrin-h-no-such-file-or-directory/
mentioned install SP1 solve the problem
11 Posted by doducthanhbk on 29 Jan, 2015 01:50 AM
Related link:
https://connect.microsoft.com/VisualStudio/feedback/details/660584/windows-update-kb2455033-breaks-build-with-missing-ammintrin-h
Can you guys take a look and fix this?
Thanks
Support Staff 12 Posted by Feodor Fitsner on 29 Jan, 2015 02:08 AM
I see. Dealt with issue before. Will fix that today/tomorrow while deploying a new image.
13 Posted by doducthanhbk on 29 Jan, 2015 02:10 AM
Awesome! Just keep me posted. Thanks
14 Posted by doducthanhbk on 29 Jan, 2015 06:30 PM
Hi Feodor. Any update on this? Thank you.
Support Staff 15 Posted by Feodor Fitsner on 29 Jan, 2015 06:58 PM
Working on it. Will be available today.
-Feodor
16 Posted by doducthanhbk on 29 Jan, 2015 10:38 PM
Hi Feodor, can you please give me an estimated time s that you guy can get it fix. I need this information to tell my boss when I could integrate the whole CI pipeline. Thank you.
Support Staff 17 Posted by Feodor Fitsner on 29 Jan, 2015 11:02 PM
Sure, by 11pm PST it should be ready.
-Feodor
18 Posted by doducthanhbk on 29 Jan, 2015 11:54 PM
Thanks! Looking towards to the fix. :)
Support Staff 19 Posted by Feodor Fitsner on 30 Jan, 2015 06:51 AM
OK, it's been fixed. Give it another try and let me know how it goes.
20 Posted by doducthanhbk on 30 Jan, 2015 02:22 PM
It works great now. Thank you!
21 Posted by doducthanhbk on 30 Jan, 2015 02:29 PM
A follow up question. How do I automatically trigger the build for every commit on github?
Support Staff 22 Posted by Feodor Fitsner on 30 Jan, 2015 02:31 PM
You should already have a webhook setup for that GitHub repository, no?
23 Posted by doducthanhbk on 30 Jan, 2015 02:46 PM
No, I am a newbie in github. :( still searching for that. If you have a good pointer, please let me know. Thank you.
Support Staff 24 Posted by Feodor Fitsner on 30 Jan, 2015 02:53 PM
On General tab of project settings you can see webhook URL. Open repository settings on GitHub, then Webhooks and make sure this webhook is added there. If not then add it with "push" and "pull_request" events.
25 Posted by doducthanhbk on 30 Jan, 2015 02:56 PM
Thank you. I found that page. It asks for a "payload URL". Which URL I should put it. In my appveyor settings page, there is a badge tab which as a bunch of URL (SVG, raster, etc). Which one I should put?
Support Staff 26 Posted by Feodor Fitsner on 30 Jan, 2015 02:58 PM
The URL is on General tab.
...but that strange it wasn't added automatically.
27 Posted by doducthanhbk on 30 Jan, 2015 03:12 PM
Ok, got it. And it works! Thank you so much!
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:53 AM.