Disable fallback to default branch when restoring the cache

Is there a way to disable this fallback? I really don’t want to fetch from any other branches.

Why? If the cache is not found in the fallback (the default branch), nothing will be downloaded, and your job should proceed. The overhead for this check should be a couple of seconds, tops.

And if your non-default-Branch proceeds to create a cache, it will be uploaded as one that is used by that branch and nothing else.

Unwanted cache might be incompatible packages that I have to uninstall before installing the right version, which leads to even larger overhead.

Then you can put a different .travis.yml in the non-default branch that disables (or defines a different) cache.

The .travis.yml configurations are already different:

but 8.10 build still fetched cache from 8.9 (default branch).

How should I define a different cache?

I understand the general concern, but this is a problem only if you have a default-cache that actively prevents a non-default branch from building. Then I’d imagine that deleting the cache should resolve the issue.

As for your present problem with the 8.10 branch, I note that no cache is actually being used https://travis-ci.org/QuickChick/QuickChick/jobs/587972574#L191 Once you have a job complete, it should upload its own cache, which will be used in subsequent jobs.

Maybe my solution should be:

  1. Delete cache on default branch;
  2. Have successful build on non-default branches, to warm their caches up; and
  3. Expect non-default branches not to fetch cache from default branch any more.

Will take a try on that.

@lys, what @BanzaiMan means is normally, the build logic is designed in such a way that it automatically creates a correct environment and validates any existing stuff before reusing it (installs the right module versions, creates versioned build artifacts etc). So if correct stuff is already present, those operations become no-ops and if incorrect stuff is present, it will be ignored or automatically overwritten.

You’re right. I’ve used the wrong example. Will follow up after my problem pins down.