zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 3ef9bd587987710591724448ddfe28288d3abff8 (tree)
parent f385522ab0d40a21303d3b40f963a3a466ec42e5
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sat,  3 Jul 2021 11:47:58 -0700

stage2: add the zig version to AstGen cache hash

This solves the problem of different versions of Zig having different
binary representations of ZIR code.

closes #9290

Diffstat:
Msrc/Module.zig | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/Module.zig b/src/Module.zig @@ -27,6 +27,7 @@ const trace = @import("tracy.zig").trace; const AstGen = @import("AstGen.zig"); const Sema = @import("Sema.zig"); const target_util = @import("target.zig"); +const build_options = @import("build_options"); /// General-purpose allocator. Used for both temporary and long-term storage. gpa: *Allocator, @@ -2223,6 +2224,7 @@ pub fn astGenFile(mod: *Module, file: *Scope.File, prog_node: *std.Progress.Node const want_local_cache = file.pkg == mod.root_pkg; const digest = hash: { var path_hash: Cache.HashHelper = .{}; + path_hash.addBytes(build_options.version); if (!want_local_cache) { path_hash.addOptionalBytes(file.pkg.root_src_directory.path); }