Cygwin build environment setup

Hi all!

I’m trying to add a Cygwin build to the project I maintain (https://github.com/ipmitool/ipmitool).
So far I am failing to understand how to do it. I’m a Linux person and don’t usually deal much with Windows, so I may be missing some basic things, but I couldn’t find any documentation on how to set up the .travis.yml file for Cygwin-based build with all the packages I need.

I’ve added to the before-install script a call to setup-x86.exe with all the required packages, but they don’t seem to be installed although the call pretends to succeed. The later attempts to invoke any of the programs that must have been installed with the aforementioned packages all result in “command not found” and the ls -R /c/tools/cygwin doesn’t list them either.

What am I doing wrong?

You can see the latest failed job here:
https://travis-ci.com/github/ipmitool/ipmitool/builds/170720612

The issue inspiring and tracking the effort is here:

It looks like before_script and script somehow get executed before the before_install has actually finished.

That can clearly be seen in this log:
https://travis-ci.com/github/ipmitool/ipmitool/builds/171457714

I was guessing setup-x86.exe fork a windows setup process and return on the console application, so I added a delay 5 minutes to make sure the before_script executed after the installation. However it is still doesn’t work.
https://travis-ci.com/github/doublechiang/ipmitool/jobs/349417373#L332

Thanks for your help, @doublechiang. I’ve been experimenting with the config for a while, but also failed to figure out a working combination.

Well, in fact I would be happy with any approach to build ipmitool for Windows with TravisCI, not necessarily with Cygwin.

If using msys2 is acceptable, I have a working config which can pass the bootstrap and configure and start to make. However, the compilation is failed at some point. You can check https://travis-ci.com/github/doublechiang/ipmitool/jobs/348640332

Thank you so much! This is a huge progress! I’m not a Windows person and have never dealt with msys2 before, so I have no idea why it fails so far (looks like some header is missing), but that’s better to discuss in the ipmitool ticket, I guess.

Anyway, the problems with cygwin are very strange and if anyone has a solution for that, I’d appreciate it.

If your project needs the MSYS2 environment (i.e. a dependency on msys-2.0.dll for POSIX support) then you should use the $msys2 prefix for both ./configure and make.