dvidelabs / flatcc

FlatBuffers Compiler and Library in C for C
Apache License 2.0
632 stars 180 forks source link

Migrate CI from Travis / Appveyor to Github Actions #170

Open mikkelfj opened 3 years ago

mikkelfj commented 3 years ago

It should not be too difficult to get a build on GH Actions working on MacOs, Linux, and Windows. The problem is to get the build working with a long line of old compilers.

FlatCC has a default CI build on the master brach and a separate CI build on the ci-more branch that run tests on many more compiler versions. Prior to a new release, the master branch is merged into ci-more to check that everything builds. GH Actions would need to have a script that installs these old compilers because only a few compilers are installed by default on each supported platform.

Travis is moving their CI to a new url and FlatCC is currently broken on Travis MacOS because something changed in the Homebrew / git shallow clone support.

Appveyor does not work with all MSVC compilers in the same build image so either old or new, which is not ideal.

Having multiple build systems is also not ideal.

A GH Actions script should use a branch test to enable more builds on a separate branch but it should suffice with using the same build scripts on all branches, contrary to how it is made today where the ci-more branch has different scripts.

If anyone wants to help out with this, it would be great. Otherwise this might take a while.

madebr commented 3 years ago

See https://github.com/actions/virtual-environments for the available environments on github actions. The windows images currently only support VS2017 (windows-2016) and VS2019 (windows-2019), with the possibility that windows-2016 goes away.

mikkelfj commented 3 years ago

There are more, they are just not installed. MSVC can be pulled from somewhere and someone probably already made an action for that.

mikkelfj commented 3 years ago

https://www.microsoft.com/en-us/download/details.aspx?id=5555 MSVC 2010 redist package < 5MB. https://github.com/microsoft/setup-msbuild https://github.com/ilammy/msvc-dev-cmd

Problem is, installing a compiler might conflict with an existing one. But Appveyor has many compilers on one image while Microsoft does not want to install old compilers on any image.

madebr commented 3 years ago

While useful, I don't think these links provide a Microsoft compiler:

I found these older headless compiler packages:


VIsual Studio 2013 was the first Visual Studio version that was avaiable as a community edition. Unless Microsoft steps up, or looses restrictions on the re-distribution of its older compilers, I don't have much faith that these older Visual Studio versions become available as a github

mikkelfj commented 3 years ago

There is Visual Studio Express for older versions, but Microsoft is not making them available. My link was only a redestribution of runtime components.

cnet has a version https://download.cnet.com/s/visual-studio-2010-express/ but dubious to build CI on that. note the MSVC 2010 SP1 is also needed.

mikkelfj commented 3 years ago

Anyway, let's aim for 2013 upwards.

Appveyor can run 2010 for now and until it doesn't matter.

mikkelfj commented 3 years ago

I didn't try it, but I don't think it's meant for CI.

Not sure, but choco probably works fine.

I have some pretty solid shell scripts to build with any MSVC compiler from bat scripts if that can help, but some of the GH actions listed above should do the job. The key is vswhere.exe that knows how to find things.

Is c++ categorized as managed?

Well, if it is it doesn't matter. We are not going to use managed compilers. However, MSVC almost exlusively support C++ and C is an afterthought in their world, so chances are 99.997% that C++ is working if there is a C installer.

mikkelfj commented 3 years ago

https://www.microsoft.com/en-us/download/details.aspx?id=40760

This is probably not good. It seems to be build tools, which just msbuild.exe, a fancy make tool.

https://visualstudio.microsoft.com/vs/older-downloads/ https://www.wireshark.org/docs/wsdg_html_chunked/ChToolsMSChain.html

Maybe using GH Actions is not such a great idea?

mikkelfj commented 3 years ago

Only somewhat recent compilers, but ...

https://github.com/wireshark/wireshark/blob/master/.github/workflows/windows.yml

mikkelfj commented 3 years ago

https://stackoverflow.com/questions/22290501/can-i-download-the-visual-c-command-line-compiler-without-visual-studio

madebr commented 3 years ago

For now, I think the sanest thing to do is to keep the appveyor script in the ci-more branch. That way, you will remain testing older MSVC compilers.

Using github actions on the main branch for ci, and do regular merges with ci-more. (These regular merges can also be automated with e.g. a github actions cron event)

Depending on how much you care about compatibility, Visual Studio 5 and 6 are available as abandonware. :smile: Microsoft C/C++ is also available :rofl: Quick C Visual C++

mikkelfj commented 3 years ago

For now, I think the sanest thing to do is to keep the appveyor script in the ci-more branch. That way, you will remain testing older MSVC compilers.

Using github actions on the main branch for ci, and do regular merges with ci-more. (These regular merges can also be automated with e.g. a github actions cron event)

makes sense, older GCC clang still needed for nix