Hi
Thank you very much for bringing Windows support to Travis CI.
I hope Travis adds support for the popular cross-platform language Ruby, as soon as possible.
Indeed, Ruby 2.5.x is pre-installed via Chocolatey.
The issue here is that, with language: ruby, we compile a script to execute the job, but the script will require some additional tooling that is not yet available on the Windows image yet. We will work on that soon.
@BanzaiMan is it possible to add a Windows build using the preinstalled Ruby to an existing language: ruby Travis configuration? How would I need to adapt?
Even then, I cant install travis.rb easily , because it depends on pusher-client which depends on json, which needs -lgmp , and … ouch … I gave up and added gem "pusher-client", "~>0.4.0" to my Gemfile because that version doesnt need the json gem.
I guess that is not much different to what ruby2.devkit is doing. I was hoping to avoid msys. I wonder why you needed both the choco package mingw and the msys-pacman package mingw-w64-x86_64-toolchain. I would expect they had similar contents.
There is a problem: ruby from msys2 package was not configured properly, this config may be valid for cygwin, but not for mingw. Thats why users have to bring together ruby build for windows by rubyinstaller (unpacked by choco) and msys2.
PS we don’t need to use complete base-devel mingw-w64-x86_64-toolchain packages, mingw-w64-x86_64-binutils, mingw-w64-x86_64-crt-git, mingw-w64-x86_64-gcc, make will be enough.
Official travis documentation introduced some strange wunderwaffe export msys2 = ..., it can be replaced by ridk.cmd exec, because we have to deal with rubyinstaller anyway.
There is another variant: use mingw-w64-x86_64-ruby instead of ruby from rubyinstaller and i think it will be much better, it will have less issues with library bindings. In this case we may use wunderwaffe from travis.
language: ruby
jobs:
include:
# other jobs
- os: windows
arch: amd64
language: bash # using git bash
before_install:
- |-
choco uninstall -y mingw ruby
choco upgrade -y msys2
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
export msys2+=" -msys2 -c "\"\$@"\" --"
$msys2 pacman --sync --noconfirm --needed \
mingw-w64-x86_64-binutils \
mingw-w64-x86_64-crt-git \
mingw-w64-x86_64-gcc \
make \
mingw-w64-x86_64-ruby
before_cache:
- |-
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
# https://unix.stackexchange.com/a/137322/107554
$msys2 exec pacman --sync --clean --noconfirm
fi
cache:
directories:
- ${HOME}/AppData/Local/Temp/chocolatey
- /C/tools
before_install:
- |-
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
$mingw64 gem install bundler
else
gem install bundler
fi
script:
- |-
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
$mingw64 scripts/ci_test.sh
else
scripts/ci_test.sh
fi
This solution works perfect for me. I will try to implement windows support for some gems using such config.
ridk.cmd seems to be distributed with the Ruby installer. The official Travis guidance on use of MSYS2 needs to be as general as possible, so it can’t depend on that (unless ridk.cmd is spun off as an separate project).
I’ve added windows support for more projects, but I can’t use travis ci anymore, 10000 credits is not enough. I can’t understand travis business model: windows support for ruby projects is not ready yet and marked as experimental, but it is not possible to use it without credits.
Ruby win32 folder has large amount of issues: I’ve found that TCPServer is not thread safe on windows. Now I am moving to appveyor as main ci, I will provide more information on appveyor forums.