Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ "**" ]
branches: ["**"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ci
cancel-in-progress: true

env:
ZIG_VERSION: 0.14.1
ZIG_VERSION: 0.16.0

Comment thread
GrapeBaBa marked this conversation as resolved.
Comment on lines 13 to 15
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions Zig 0.16.0-dev (master), but CI pins ZIG_VERSION to "0.16.0". Please align CI with the intended toolchain (e.g., master/nightly vs a released 0.16.0) so CI reliably matches the minimum/toolchain expected by the package.

Copilot uses AI. Check for mistakes.
jobs:
build-test:
Expand All @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.zig-cache
zig-out
.zig-cache/
zig-out/
zig-pkg/
25 changes: 17 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ pub fn build(b: *std.Build) !void {

const upstream = b.dependency("blst", .{});

var c_flags = std.ArrayList([]const u8).init(b.allocator);
defer c_flags.deinit();
var c_flags = std.ArrayList([]const u8).empty;
defer c_flags.deinit(b.allocator);

try c_flags.append("-fno-builtin");
try c_flags.append("-Wno-unused-function");
try c_flags.append("-Wno-unused-command-line-argument");
try c_flags.append(b.allocator, "-fno-builtin");
try c_flags.append(b.allocator, "-Wno-unused-function");
try c_flags.append(b.allocator, "-Wno-unused-command-line-argument");
Comment thread
GrapeBaBa marked this conversation as resolved.

if (target.result.cpu.arch == .x86_64) {
try c_flags.append("-mno-avx"); // avoid costly transitions
try c_flags.append(b.allocator, "-mno-avx"); // avoid costly transitions
}

const lib = b.addLibrary(.{
Expand All @@ -33,7 +33,15 @@ pub fn build(b: *std.Build) !void {
if (portable) {
lib.root_module.addCMacro("__BLST_PORTABLE__", "");
} else {
if (std.Target.x86.featureSetHas(target.result.cpu.features, .adx)) {
// Guard __ADX__ check to x86_64 only.
// std.Target.x86.featureSetHas on non-x86 cpu features is meaningless —
// the feature indices differ per-arch and may accidentally return true
// for unrelated ARM features, incorrectly defining __ADX__ and breaking
// symbol resolution (server.c then references ctx_* symbols that don't
// exist in the mach-o/elf ARM64 assembly).
if (target.result.cpu.arch == .x86_64 and
std.Target.x86.featureSetHas(target.result.cpu.features, .adx))
{
lib.root_module.addCMacro("__ADX__", "");
}
}
Expand All @@ -45,10 +53,11 @@ pub fn build(b: *std.Build) !void {
{
lib.root_module.addCMacro("__BLST_NO_ASM__", "");
}

lib.installHeader(upstream.path("bindings/blst.h"), "blst.h");
lib.installHeader(upstream.path("bindings/blst_aux.h"), "blst_aux.h");

lib.addCSourceFiles(.{
lib.root_module.addCSourceFiles(.{
.root = upstream.path(""),
.files = &.{
"src/server.c",
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.fingerprint = 0x97ffb139ce317072, // Changing this has security and trust implications.

.minimum_zig_version = "0.14.1",
.minimum_zig_version = "0.16.0",
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says upgrade to Zig 0.16.0-dev (master), but the package minimum Zig version is set to the stable-looking "0.16.0". If this repo is intended to track master/nightly, align this to a dev identifier (or update the PR description if the intent is the 0.16.0 release) to avoid consumers/CI trying to use a different toolchain than expected.

Copilot uses AI. Check for mistakes.

.dependencies = .{
.blst = .{
Expand Down
Loading