diff --git a/build.zig b/build.zig index 596adde0cc..8d6faa5158 100644 --- a/build.zig +++ b/build.zig @@ -140,7 +140,7 @@ pub fn build(b: *std.Build) void { .name = "builtin_compiler", .root_source_file = b.path("src/build/builtin_compiler/main.zig"), .target = b.graph.host, // this runs at build time on the *host* machine! - .optimize = .ReleaseFast, // Must match playground optimization to ensure struct compatibility + .optimize = .Debug, // No need to optimize - only compiles builtin modules // Note: libc linking is handled by add_tracy below (required when tracy is enabled) }); @@ -234,7 +234,7 @@ pub fn build(b: *std.Build) void { .name = "builtin_compiler", .root_source_file = b.path("src/build/builtin_compiler/main.zig"), .target = b.graph.host, - .optimize = .ReleaseFast, // Must match playground optimization to ensure struct compatibility + .optimize = .Debug, }); builtin_compiler_exe_force.root_module.addImport("base", roc_modules.base); diff --git a/src/base/SmallStringInterner.zig b/src/base/SmallStringInterner.zig index bfa7f44752..13eecc576f 100644 --- a/src/base/SmallStringInterner.zig +++ b/src/base/SmallStringInterner.zig @@ -223,7 +223,6 @@ pub const Serialized = struct { bytes: collections.SafeList(u8).Serialized, hash_table: collections.SafeList(Idx).Serialized, entry_count: u32, - frozen: if (std.debug.runtime_safety) bool else void, /// Serialize a SmallStringInterner into this Serialized struct, appending data to the writer pub fn serialize( @@ -238,7 +237,7 @@ pub const Serialized = struct { try self.hash_table.serialize(&interner.hash_table, allocator, writer); // Copy simple values directly self.entry_count = interner.entry_count; - self.frozen = interner.frozen; + // Note: frozen is not serialized - it will always be true after deserialization } /// Deserialize this Serialized struct into a SmallStringInterner @@ -253,7 +252,7 @@ pub const Serialized = struct { .bytes = self.bytes.deserialize(offset).*, .hash_table = self.hash_table.deserialize(offset).*, .entry_count = self.entry_count, - .frozen = self.frozen, + .frozen = if (std.debug.runtime_safety) true else {}, // Always frozen after deserialization }; return interner; diff --git a/src/base/StringLiteral.zig b/src/base/StringLiteral.zig index 079c583166..1ecc82c6e9 100644 --- a/src/base/StringLiteral.zig +++ b/src/base/StringLiteral.zig @@ -115,7 +115,6 @@ pub const Store = struct { /// Serialized representation of a Store pub const Serialized = struct { buffer: collections.SafeList(u8).Serialized, - frozen: if (std.debug.runtime_safety) bool else void, /// Serialize a Store into this Serialized struct, appending data to the writer pub fn serialize( @@ -126,8 +125,7 @@ pub const Store = struct { ) std.mem.Allocator.Error!void { // Serialize the buffer SafeList try self.buffer.serialize(&store.buffer, allocator, writer); - // Copy the frozen field - self.frozen = store.frozen; + // Note: frozen is not serialized - it will always be true after deserialization } /// Deserialize this Serialized struct into a Store @@ -140,7 +138,7 @@ pub const Store = struct { store.* = Store{ .buffer = self.buffer.deserialize(offset).*, - .frozen = self.frozen, + .frozen = if (std.debug.runtime_safety) true else {}, // Always frozen after deserialization }; return store;