epics-base / ci-scripts

Continuous Integration Scripts for EPICS Modules
Other
8 stars 18 forks source link

Add support for Windows builds on Travis-CI #10

Closed ralphlange closed 4 years ago

ralphlange commented 4 years ago

Something that @dirk-zimoch was expecting to work. Independently, @mdavidsaver tried to use that Travis-CI setup to compile EPICS Base and got pretty far.

dirk-zimoch commented 4 years ago

"was expecting to work." Well, lets say: "hoping to work" as it would allow me to easily check if code changes breaks compatibility with one the OS I normally don't use.

mdavidsaver commented 4 years ago

@mdavidsaver tried to use that Travis-CI setup to compile EPICS Base and got pretty far.

The problem which has no obvious answer is windows <-> unix path translation. Specifically, the travis-prepare.sh writes files under configure/ which contain directories. The mechanics of the automatic conversion of msys bash works on command line arguments by prefix matching on eg. "C:\" or "/". Obviously this doesn't work if the prefix is "-I".

mdavidsaver commented 4 years ago

The basic trick I started with was to jump from msys bash through a batch script to pick up the VS environment config, then jump back to msys bash. A script with-env.sh contains:

    cat <<EOF > msboot.bat
:: pull in MSVC
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86
echo After PATH=%PATH%

where cl
where perl
where sh
where make

sh "$@"
EOF

    ./msboot.bat

Then in the .travis.yml prefix lines like ./.ci-local/withenv.sh ./.ci/travis-prepare.sh.

ralphlange commented 4 years ago

See #30. Plan is to extend the Python approach to cover all services and OS - so the trampoline script approach (that works fine on AppVeyor) will also be used on Travis-Windows.