How to create separate build cache for each platform

jacobq's Avatar

jacobq

24 May, 2018 06:27 PM

I have a NodeJS (electron) project that gets built on multiple platforms (e.g. Linux & Windows) with the same appveyor.yml (and would like to keep it this way). However, some of the node_modules are platform-specific (i.e. compiled addons), such as node-serialport. Ideally, I'd like to cache node_modules between builds since installing dependencies seems to consume a significant amount of the build time, but I think the jobs are each overwriting each others' cache. Is there a way to specify that a separate cache be used for each image/platform?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 24 May, 2018 06:40 PM

    Ilya Finkelshteyn's Avatar

    Cache is job-specific.Issue you maybe hit is that we have few network segments and each with it's own cache server. It can take several builds for cache to populate everywhere.

  2. 2 Posted by jacobq on 24 May, 2018 08:32 PM

    jacobq's Avatar

    Ah, OK, so the VS2017 image will only get cached data from previous VS2017 builds and likewise for Ubuntu. That's what I want. There's one more part of this though, and that is that I would like to be able to select different directories to cache on different platforms/images/jobs. For example, instead of this:

    cache:
      - "%LOCALAPPDATA%\\Yarn" # only works / has meaning on Windows
    

    can I do something like this?

    cache:
      Visual Studio 2017:
        - "%LOCALAPPDATA%\Yarn" # only applies to Visual Studio 2017 image/job
    
  3. Support Staff 3 Posted by Ilya Finkelshte... on 24 May, 2018 08:46 PM

    Ilya Finkelshteyn's Avatar

    Please try https://www.appveyor.com/docs/build-configuration/#specializing-mat.... Let us know how it goes. We implemented this feature exactly for cases like this. It is pretty new and we are very interested to hear how it is being used.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

18 Aug, 2018 11:54 AM
18 Aug, 2018 12:13 AM
17 Aug, 2018 06:02 PM
17 Aug, 2018 04:26 PM
17 Aug, 2018 04:04 PM
17 Aug, 2018 06:31 AM