Skip to content

"Fabled Cache Bug" #25192

Open
Open

Description

@F0RG-3

Zig Version

0.15.1

Steps to Reproduce and Observed Behavior

When ever I run my zig build command I get this error : "error: unable to update file from '.zig-cache\o\3cb4e379cc2e9501e30ad1b11139c33d\HexBoard.pdb' to 'C:*path*\Zig\Raylib\HexBoard\zig-out\bin\HexBoard.pdb': FileNotFound"

I briefly managed to fix it by creating a new build.zig and running that, however the bug eventually returned. Furthermore clearing the local cache (which I tried many times) did not help. So I imagine the bug is either in the global cache, or with one of the ZLS that I use (Because they, I believe, sometimes call build.zig and fill in the cache to provide linting). I am on Windows with Visual Studio Code.

The zig-relevant add-ons are https://marketplace.visualstudio.com/items?itemName=prime31.zig and
https://marketplace.visualstudio.com/items?itemName=ziglang.vscode-zig

I have also been told that my source code/cache file would be good to have so I have created this repo here : https://github.com/F0RG-3/Zig-Fabled-Cache-Error/tree/main

I apologize that it is not the raw-code, but is zipped up. I tried uploading the raw code but it was too large, then I tried a zip file, and then a 7zip, and then finally the very janky solution of writing a program to split it up and a program to frankenstein-weld them back together.

Unfortunately I have not added my global zig-cache. I may add it soon, it depends how big it is and how big I think I can shrink it. I don't know how needed/desired it is. I also tried it on this dev version if it helps : 0.16.0-dev.38+37f4bee92

I hope this is helpful, thank you very much for zig.

Expected Behavior

Not Error

Activity

  1. added
    bug
    on Sep 9, 2025
  2. F0RG-3 commented on Sep 9, 2025

    @F0RG-3
    Author

    Also this is my env, if that helps:

        .zig_exe = "C:\\**path**\\zig-x86_64-windows-0.15.1\\zig.exe",
        .lib_dir = "C:\\**path**\\zig-x86_64-windows-0.15.1\\lib",
        .std_dir = "C:\\**path**\\zig-x86_64-windows-0.15.1\\lib\\std",
        .global_cache_dir = "C:\\**Other_path**\\AppData\\Local\\zig",
        .version = "0.15.1",
        .target = "x86_64-windows.win11_dt...win11_dt-gnu",
        .env = .{
            .ZIG_GLOBAL_CACHE_DIR = null,
            .ZIG_LOCAL_CACHE_DIR = null,
            .ZIG_LIB_DIR = null,
            .ZIG_LIBC = null,
            .ZIG_BUILD_RUNNER = null,
            .ZIG_VERBOSE_LINK = null,
            .ZIG_VERBOSE_CC = null,
            .ZIG_BTRFS_WORKAROUND = null,
            .ZIG_DEBUG_CMD = null,
            .CC = null,
            .NO_COLOR = null,
            .CLICOLOR_FORCE = null,
            .XDG_CACHE_HOME = null,
            .HOME = null,
        },
    }```
    
  3. F0RG-3 commented on Sep 9, 2025

    @F0RG-3
    Author

    Further Debug Testing on my end:

    I (after saving a copy if any of you would like it for some reason) deleted global cache, deleted local cache, then reran the program - same error.
    I then Disabled both of the extensions, deleted local cache and reran the program - still errs.
    I then deleted global cache again, deleted local cache and (with both extensions disabled) reran the program - still errs.

    I was wrong with my presumptions of what it could be, I hope I didn't waste anyone's time.

  4. pfgithub commented on Sep 10, 2025

    @pfgithub
    Contributor

    If after deleting the local and global cache it still errors then you can upload your source code rather than your whole cache folder to see if someone else can reproduce the issue

  5. F0RG-3 commented on Sep 10, 2025

    @F0RG-3
    Author

    @pfgithub It has been added to the repo. When I first switched to a new build file it would run a few times then it would break and then never run again. Maybe it broke after I changed main.zig, I don't know. I apologize for the inconvenience. If it would be helpful when downloading I can remove the .7zip (and the splitter/rejoiner) from the repo so that it is only the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions