Skip to content

Unexpected Uploads Causing Long Build Times #154

@JojOatXGME

Description

@JojOatXGME

I just tried out DeterminateSystems/magic-nix-cache-action@v13, but the action uploads a lot of data which it isn't supposed to upload. Specifically, it uploads the results of various deviations which were already downloaded from a cache.

Besides wasting storage capacity, this takes a lot of time. While the builds inside my workflow took between 3 and 8 minutes, awaiting the unnecessary uploads further delayed the workflow by up to 20 minutes.

Workflow

Here is a full copy of my current workflow. I made a few changes along the way, which means some of my builds have used a different configuration. However, none of my changes seem to have changed the behavior in a noticeable and relevant way.

name: Check

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  check:

    name: Check
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Install Nix
        uses: DeterminateSystems/determinate-nix-action@v3
      - name: Setup Cache
        uses: DeterminateSystems/magic-nix-cache-action@v13
        with:
          use-flakehub: false
      - name: Run `nix flake check`
        run: nix -L flake check

Example

To show some example from the logs, the following line gets logged by “Run `nix flake check`”:

copying path '/nix/store/xjdfkfaa925fj504f53b2ilggaddr51x-linux-headers-6.12.7' from 'http://127.0.0.1:37515'...

Later, as part of “Post Setup Cache”, I get:

  2025-07-24T22:33:15.436098Z  INFO magic_nix_cache::gha: Uploaded '/nix/store/xjdfkfaa925fj504f53b2ilggaddr51x-linux-headers-6.12.7' to the GitHub Action Cache
    at magic-nix-cache/src/gha.rs:216

There is no point in uploading /nix/store/xjdfkfaa925fj504f53b2ilggaddr51x-linux-headers-6.12.7, which has just been downloaded from the cache.

Also note that /nix/store/xjdfkfaa925fj504f53b2ilggaddr51x-linux-headers-6.12.7 is originally coming from upstream (https://cache.nixos.org/) and was never build by me. This is another reason why it should have never been uploaded according to upstream-cache.

Store paths in this store aren't cached in GitHub Actions' cache.

The same happens to hundreds of packages during each build. The exact amount seems to be a bit random. The last build did upload 698 store paths to the cache according to the log of “Post Setup Cache”. The build before that did upload exactly 800 store paths. Two builds earlier, the action was uploading 544 store paths.

Potentially related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions