mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 00:23:22 +00:00
stage2: add zig_backend to the cache hash
This makes stage2 and stage3 have different cache namespaces, so that building something with stage3 does not try to reuse the same cached artifacts as were produced by stage2. This makes sense since the code of stage3 is produced by the self-hosted compiler, whereas the code of stage2 is produced by the bootstrap compiler. Note also that stage4 and stage3 will share the same zig_backend, end hence cache namespace. Ideally stage4 and stage3 are identical binaries, so this checks out.
This commit is contained in:
parent
ebfddbaf00
commit
ffaa045429
@ -1224,6 +1224,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
|
||||
|
||||
// This is shared hasher state common to zig source and all C source files.
|
||||
cache.hash.addBytes(build_options.version);
|
||||
cache.hash.add(builtin.zig_backend);
|
||||
cache.hash.addBytes(options.zig_lib_directory.path orelse ".");
|
||||
cache.hash.add(options.optimize_mode);
|
||||
cache.hash.add(options.target.cpu.arch);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user