Restrict stage 1 workaround to only between 0.10.0 and the master branch where the bug was fixed
This commit is contained in:
parent
26b7d4ee8e
commit
d6ac12d6de
1 changed files with 10 additions and 11 deletions
21
build.zig
21
build.zig
|
@ -12,7 +12,8 @@ fn linkObject(b: *Builder, obj: *LibExeObjStep) void {
|
||||||
// Add linking for packages or third party libraries here
|
// Add linking for packages or third party libraries here
|
||||||
}
|
}
|
||||||
|
|
||||||
const required_zig_version = std.SemanticVersion.parse("0.9.0-dev.1920+de81c504b") catch unreachable;
|
const required_zig_version = std.SemanticVersion.parse("0.10.0") catch unreachable;
|
||||||
|
const padded_int_fix = std.SemanticVersion.parse("0.11.0-dev.331+304e82808") catch unreachable;
|
||||||
|
|
||||||
pub fn build(b: *Builder) void {
|
pub fn build(b: *Builder) void {
|
||||||
if (comptime @import("builtin").zig_version.order(required_zig_version) == .lt) {
|
if (comptime @import("builtin").zig_version.order(required_zig_version) == .lt) {
|
||||||
|
@ -59,16 +60,14 @@ pub fn build(b: *Builder) void {
|
||||||
exe.setBuildMode(mode);
|
exe.setBuildMode(mode);
|
||||||
linkObject(b, exe);
|
linkObject(b, exe);
|
||||||
|
|
||||||
// NOTE: This line can be commented out once #13480 is fixed.
|
// Padded integers are buggy in 0.10.0, fixed in 0.11.0-dev.331+304e82808
|
||||||
// https://github.com/ziglang/zig/issues/13480
|
// This is especially bad for AoC because std.StaticBitSet is commonly used.
|
||||||
// The fix is slated to be merged in PR #13637.
|
// If your version is older than that, we use stage1 to avoid this bug.
|
||||||
// https://github.com/ziglang/zig/pull/13637
|
// Issue: https://github.com/ziglang/zig/issues/13480
|
||||||
// Until then, stage 1 is probably the better default for advent of code,
|
// Fix: https://github.com/ziglang/zig/pull/13637
|
||||||
// due to the common use of std.StaticBitSet.
|
if (comptime @import("builtin").zig_version.order(padded_int_fix) == .lt) {
|
||||||
// If you are using a master branch build of zig, this line may cause
|
exe.use_stage1 = true;
|
||||||
// a compile error. You can safely remove it as long as you have a build
|
}
|
||||||
// from after when PR #13637 was merged.
|
|
||||||
exe.use_stage1 = true; // compile error? see comment above.
|
|
||||||
|
|
||||||
exe.install();
|
exe.install();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue