Appveyor Rust configuration?

I’m looking for a canonical Appveyor configuration with which to test a Rust crate. I have found the following configs, but I don’t know how to judge between them.

Seems too low-level:

Maybe this is good, but it’s somewhat old:

Thanks in advance!

This is the most recent Windows crate I’ve worked on, and I think the CI config is good and demonstrates a fairly basic example: https://github.com/BurntSushi/winapi-util/blob/master/appveyor.yml I based it on libc's appveyor config, which is always where I look to make sure my CI config is up to date with best practices. :slight_smile:

If you’re releasing a binary, then here’s the CI config for ripgrep, which produces Windows executables and puts them in Github releases: https://github.com/BurntSushi/ripgrep/blob/master/appveyor.yml — There are parts of that config that I don’t understand though.

4 Likes
# ???
build: false

This one? Disabling the build step is a hack to prevent the “directory does not contain a project or solution file” warning message.

1 Like

Yeah, sure, that’s one. I still don’t think I understand it though. What does the warning message mean and why does build: false disable it? I think I just copied that from someone else’s CI config.

There are various other things that I could guess at but don’t fully grok, e.g., clone_folder, fast_finish and whether the cache is actually helping or not.

1 Like

I’d also recommend checking out crate-ci.

  • If you find bugs, lack of clarity, etc, please open an issue or create a PR
  • If you recommend doing something in addition or differently, then proposals go here
2 Likes

By default AppVeyor works in “Msbuild” mode, it searches for .sln or .csproj files and tries to build it. If .sln or .csproj files cannot be found (in your case it was not downloaded by npm), error described above happens.

(from here)

It changes where the project is cloned - https://www.appveyor.com/docs/build-configuration/#clone-directory

https://www.appveyor.com/docs/build-configuration/#failing-strategy:

By default AppVeyor runs all build jobs. If at least one job has failed the entire build is marked as failed. Sometimes, you want the build fail immediately once one of the job fails. To enable fast fail strategy add fast_finish setting into appveyor.yml

whether the cache is actually helping or not

In my experience that depends on many factors (the size of the project including deps, number of the jobs, etc). For Zemeroth-sized project it seems to reduce the compile time, but I’d double check in the case of a bigger project.

2 Likes

Just a FYI if you were only interested in AppVeyor for the Windows support, Travis recently added Windows, and Rust is one of the supported languages.

1 Like