diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-07-03 11:47:58 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-07-03 11:47:58 -0700 |
| commit | 254a35fd8897ea705cd454d0e7f89036e78d0c60 (patch) | |
| tree | 12f76451fe621b746beda13ae611b2b99a70b937 /src/Module.zig | |
| parent | 5c34c01179a4a54c0fb11d107664f8c35e9f09dc (diff) | |
| download | zig-254a35fd8897ea705cd454d0e7f89036e78d0c60.tar.gz zig-254a35fd8897ea705cd454d0e7f89036e78d0c60.zip | |
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 (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index b3480532b0..1d715448da 100644 --- 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, @@ -2235,6 +2236,7 @@ pub fn astGenFile(mod: *Module, file: *Scope.File) !void { 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); } |
