Julia is now available on Travis Windows builds

Exciting news for people who love cross-platform CI! As you may know, Travis added Windows builds last year. I’m pleased to announce that after some testing and working out the kinks, Julia is now available out of the box on Travis Windows builds!

To illustrate how it’s used, I’ve set up my package called Jackknife to use Travis builds for Linux, macOS, and Windows simultaneously. You can see the configuration file here. It’s as easy as adding windows to the os list!

A common practice with Julia Windows builds on AppVeyor is to include testing on 32-bit Windows. That is also possible for Travis! See this build for an example, and click “view config” to see how it’s set up. (Note that it’s not as simple as making arch a list like os or julia that gets expanded in the build matrix, and note that for language: julia, the arch specification is only recognized for Windows builds for now.)

A special thanks to @simonbyrne for getting 95% of the way there, @Gnimuc for valuable insight that worked out a blocking issue, and Hiro Asari (BanzaiMan) from Travis for working with us to push it over the finish line.

Enjoy your build!

48 Likes

Is it recommended to deprecate appveyor builds?

Nah. Use whichever build service you like. :slightly_smiling_face:

1 Like

That is so awesome, thank you!

Could one add another os like windows-32bit that would still allow us to just use the nice os list but still test on 32 bit?

I think testing on 32 bit is really, really valuable, I tend to catch a lot of bugs that way.

1 Like

AFAIK no. If I’m not mistaken, the values in os must match to those provided by Travis itself. Also note that saying os: windows-32bit would be a misnomer, as the build itself is still 64-bit Windows, it just downloads and uses the 32-bit Julia binary, same as running 32-bit on AppVeyor.

Yeah for sure. And it is possible, it’s just not super convenient at the moment. Ideally I’d like arch to accept a list so that the build matrix would be os * arch * julia, but it doesn’t do that at the moment.

This is great! Already caught a bug thanks to 32 bit testing. :smiley:

One question: Right now you can’t tell apart the architectures in the build overview. Is there a nice way to change the display name of the operating system? Setting an unused environment variable works, but it feels a bit hacky.

Unfortunately not as far as I can tell.

If you use the matrix you can set the name of each job, it’s the name field: https://docs.travis-ci.com/user/customizing-the-build/#naming-jobs-within-matrices

2 Likes

Could you share the config for including 32 bit testing?

I assume @SaschaMann is referring to the standard setup for testing 32-bit Windows on AppVeyor, e.g. with Appveyor.jl. You can also see how it’s set up with Travis in the link my the top post.

2 Likes

Does appveyor use 32 bit binaries on 64 bit also? Or does it launch an actual 32 bit distro?

I was referring to the Travis setup in the OP.

@Nosferican This is the full build matrix I’m using now, incl. 32bit Julia. Note that you may want to remove arch: x86 from allow_failures, I have it in there because I’ll have to fix bugs I found through the 32bit testing first.

Travis Script
os:
  - osx
  - linux

julia:
  - 1.0
  - 1.1
  - nightly

matrix:
  # fast_finish marks the build as passing even if allow_failures builds are still running
  fast_finish: true
  include:
    - os: windows
      arch: x64
      julia: 1.0
    - os: windows
      arch: x86
      julia: 1.0
      name: "Julia 1 (32bit)"
    - os: windows
      arch: x64
      julia: 1.1
    - os: windows
      arch: x86
      julia: 1.1
      name: "Julia 1.1 (32bit)"
  allow_failures:
    - julia: nightly
    - arch: x86
2 Likes

I think testing on 32 bit is really, really valuable, I tend to catch a lot of bugs that way.

Couldn’t agree more!

1 Like

I had some issues with the script. I need to run the following matrix for the testing stage. However, for some reason the collection of jobs get interpreted as a single linux job. See config and log example here.

Not sure what’s going on there, never used stages, sorry :man_shrugging:

I tried without stages too and it gave me the same thing, https://travis-ci.org/Nosferican/Econometrics.jl/jobs/568478242/config

@ararslan Here is an example trying to include the Windows jobs, but only spawning the Linux one.

Apparently, matrix and jobs are simply aliases of each other. So to make the matrix / include thing work with additional build stages, you need to do something like:

language: julia

os:
  - osx
  - linux

julia:
  - 1.0
  - 1.1
  - nightly

jobs:
  include:
    # additional Windows 32/64-bit jobs
    - os: windows
      arch: x64
      julia: 1.0
    - os: windows
      arch: x86
      julia: 1.0
      name: "Julia 1 (32bit)"
    - os: windows
      arch: x64
      julia: 1.1
    - os: windows
      arch: x86
      julia: 1.1
      name: "Julia 1.1 (32bit)"
    # documentation build stage
    - stage: "Documentation"
      os: linux
      julia: 1.3
      script:
        - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()));
                                               Pkg.instantiate()'
        - julia --project=docs/ docs/make.jl
      after_success: skip

You can see a successful expansion here.

2 Likes

Anyone having similar issues with visual regression tests on Windows? https://github.com/JuliaIO/ImageMagick.jl/issues/163

Visual regression tests depend on ImageMagick.jl and the package doesn’t seem to build successfully on Windows. Appreciate any help.

Ah, nice! Another way to do this that seems a bit shorter it so use the standard os selection to add the 64 bit Windows build, and then just add additional jobs for 32 bit, like I’ve done here.

4 Likes