Skip to content

Breaking change for the type of sanitize_c (again) #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/configure-pages@v5
- uses: mlugg/setup-zig@v1
with:
version: 0.15.0-dev.375+8f8f37fb0
version: 0.15.0-dev.441+c1649d586
- run: make docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
zig: ["0.14.0", "0.15.0-dev.375+8f8f37fb0"]
zig: ["0.14.0", "0.15.0-dev.441+c1649d586"]

runs-on: ${{matrix.os}}

Expand Down
22 changes: 19 additions & 3 deletions build/luajit.zig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
.optimize = .ReleaseSafe,
});
minilua.linkLibC();
minilua.root_module.sanitize_c = false;
// FIXME: remove branch when zig-0.15 is released and 0.14 can be dropped
const builtin = @import("builtin");
if (builtin.zig_version.major == 0 and builtin.zig_version.minor < 15) {
minilua.root_module.sanitize_c = false;
} else {
minilua.root_module.sanitize_c = .off;
}
minilua.addCSourceFile(.{ .file = upstream.path("src/host/minilua.c") });

// Generate the buildvm_arch.h file using minilua
Expand Down Expand Up @@ -79,7 +85,12 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
.optimize = .ReleaseSafe,
});
buildvm.linkLibC();
buildvm.root_module.sanitize_c = false;
// FIXME: remove branch when zig-0.15 is released and 0.14 can be dropped
if (builtin.zig_version.major == 0 and builtin.zig_version.minor < 15) {
buildvm.root_module.sanitize_c = false;
} else {
buildvm.root_module.sanitize_c = .off;
}

// Needs to run after the buildvm_arch.h and luajit.h files are generated
buildvm.step.dependOn(&dynasm_run.step);
Expand Down Expand Up @@ -183,7 +194,12 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
.files = &luajit_vm,
});

lib.root_module.sanitize_c = false;
// FIXME: remove branch when zig-0.15 is released and 0.14 can be dropped
if (builtin.zig_version.major == 0 and builtin.zig_version.minor < 15) {
lib.root_module.sanitize_c = false;
} else {
lib.root_module.sanitize_c = .off;
}

lib.installHeader(upstream.path("src/lua.h"), "lua.h");
lib.installHeader(upstream.path("src/lualib.h"), "lualib.h");
Expand Down
Loading