Skip to content

Commit 05888bb

Browse files
committed
update to Zig 0.15.1
1 parent 624f400 commit 05888bb

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
zig-version: [0.14.0]
17+
zig-version: [0.15.1]
1818
os: [ubuntu-latest, macos-latest]
1919
runs-on: ${{ matrix.os }}
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

2424
- name: Setup Zig
25-
uses: mlugg/setup-zig@v1
25+
uses: mlugg/setup-zig@v2
2626
with:
2727
version: ${{ matrix.zig-version }}
2828

build.zig

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ pub fn build(b: *std.Build) void {
3737
.PACKAGE = "libsframe",
3838
.PACKAGE_BUGREPORT = "",
3939
.PACKAGE_NAME = "libsframe",
40-
.PACKAGE_STRING = b.fmt("libsframe {}", .{version}),
40+
.PACKAGE_STRING = b.fmt("libsframe {f}", .{version}),
4141
.PACKAGE_TARNAME = "libsframe",
4242
.PACKAGE_URL = "",
43-
.PACKAGE_VERSION = b.fmt("{}", .{version}),
43+
.PACKAGE_VERSION = b.fmt("{f}", .{version}),
4444
.STDC_HEADERS = true,
45-
.VERSION = b.fmt("{}", .{version}),
45+
.VERSION = b.fmt("{f}", .{version}),
4646
});
4747

4848
const libsframe = b.addLibrary(.{
@@ -76,7 +76,7 @@ pub fn build(b: *std.Build) void {
7676
});
7777

7878
const libiberty_config_header = b.addConfigHeader(.{
79-
.style = .{ .autoconf = upstream.path("libiberty/config.in") },
79+
.style = .{ .autoconf_undef = upstream.path("libiberty/config.in") },
8080
}, .{
8181
.AC_APPLE_UNIVERSAL_BUILD = null,
8282
.CRAY_STACKSEG_END = null,
@@ -273,7 +273,7 @@ pub fn build(b: *std.Build) void {
273273
}
274274

275275
const libbfd_config_header = b.addConfigHeader(.{
276-
.style = .{ .autoconf = upstream.path("bfd/config.in") },
276+
.style = .{ .autoconf_undef = upstream.path("bfd/config.in") },
277277
}, .{
278278
.AC_APPLE_UNIVERSAL_BUILD = null,
279279
.CORE_HEADER = @as(?[]const u8, switch (target.result.os.tag) {
@@ -370,10 +370,10 @@ pub fn build(b: *std.Build) void {
370370
.PACKAGE = "bfd",
371371
.PACKAGE_BUGREPORT = "",
372372
.PACKAGE_NAME = "bfd",
373-
.PACKAGE_STRING = b.fmt("bfd {}", .{version}),
373+
.PACKAGE_STRING = b.fmt("bfd {f}", .{version}),
374374
.PACKAGE_TARNAME = "bfd",
375375
.PACKAGE_URL = "",
376-
.PACKAGE_VERSION = b.fmt("{}", .{version}),
376+
.PACKAGE_VERSION = b.fmt("{f}", .{version}),
377377
.SIZEOF_INT = target.result.cTypeByteSize(.int),
378378
.SIZEOF_LONG = target.result.cTypeByteSize(.long),
379379
.SIZEOF_LONG_LONG = target.result.cTypeByteSize(.longlong),
@@ -392,7 +392,7 @@ pub fn build(b: *std.Build) void {
392392
._POSIX_PTHREAD_SEMANTICS = true,
393393
._TANDEM_SOURCE = true,
394394
.__EXTENSIONS__ = true,
395-
.VERSION = b.fmt("{}", .{version}),
395+
.VERSION = b.fmt("{f}", .{version}),
396396
.WORDS_BIGENDIAN = if (target.result.cpu.arch.endian() == .big) @as(i64, 1) else null,
397397
._FILE_OFFSET_BITS = null,
398398
._LARGE_FILES = null,
@@ -745,8 +745,10 @@ pub fn build(b: *std.Build) void {
745745

746746
const find_replace_exe = b.addExecutable(.{
747747
.name = "find-replace",
748-
.root_source_file = b.path("find_replace.zig"),
749-
.target = b.graph.host,
748+
.root_module = b.createModule(.{
749+
.root_source_file = b.path("find_replace.zig"),
750+
.target = b.graph.host,
751+
}),
750752
});
751753

752754
const generated_header_files: []const std.Build.LazyPath = &.{
@@ -826,7 +828,7 @@ pub fn build(b: *std.Build) void {
826828
}
827829

828830
const opcodes_config_header = b.addConfigHeader(.{
829-
.style = .{ .autoconf = upstream.path("opcodes/config.in") },
831+
.style = .{ .autoconf_undef = upstream.path("opcodes/config.in") },
830832
}, .{
831833
.ENABLE_CHECKING = true,
832834
.ENABLE_NLS = if (target.result.os.tag == .linux or target.result.os.tag == .windows) true else null,
@@ -852,18 +854,18 @@ pub fn build(b: *std.Build) void {
852854
.PACKAGE = "opcodes",
853855
.PACKAGE_BUGREPORT = "",
854856
.PACKAGE_NAME = "opcodes",
855-
.PACKAGE_STRING = b.fmt("opcodes {}", .{version}),
857+
.PACKAGE_STRING = b.fmt("opcodes {f}", .{version}),
856858
.PACKAGE_TARNAME = "opcodes",
857859
.PACKAGE_URL = "",
858-
.PACKAGE_VERSION = b.fmt("{}", .{version}),
860+
.PACKAGE_VERSION = b.fmt("{f}", .{version}),
859861
.SIZEOF_VOID_P = target.result.ptrBitWidth() / 8,
860862
.STDC_HEADERS = true,
861863
._ALL_SOURCE = true,
862864
._GNU_SOURCE = true,
863865
._POSIX_PTHREAD_SEMANTICS = true,
864866
._TANDEM_SOURCE = true,
865867
.__EXTENSIONS__ = true,
866-
.VERSION = b.fmt("{}", .{version}),
868+
.VERSION = b.fmt("{f}", .{version}),
867869
._MINIX = null,
868870
._POSIX_1_SOURCE = null,
869871
._POSIX_SOURCE = null,

build.zig.zon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.name = .binutils,
33
.version = "2.44.0",
4-
.minimum_zig_version = "0.14.0",
4+
.minimum_zig_version = "0.15.1",
55
.dependencies = .{
66
// Zig cannot fetch this dependency from https://sourceware.org/git/binutils-gdb.git yet.
77
// See https://github.com/ziglang/zig/issues/22650
@@ -10,8 +10,8 @@
1010
.hash = "N-V-__8AADcckxfNVXuM-vFnqiIpmdEmlm7kneba_8S4akD1",
1111
},
1212
.zlib = .{
13-
.url = "git+https://github.com/allyourcodebase/zlib#6c72830882690c1eb2567a537525c3f432c1da50",
14-
.hash = "zlib-1.3.1-ZZQ7lVgMAACwO4nUUd8GLhsuQ5JQq_VAhlEiENJTUv6h",
13+
.url = "git+https://github.com/allyourcodebase/zlib#61e7df7e996ec5a5f13a653db3c419adb340d6ef",
14+
.hash = "zlib-1.3.1-ZZQ7lbYMAAB1hTSOKSXAKAgHsfDcyWNH_37ojw5WSpgR",
1515
.lazy = true,
1616
},
1717
.zstd = .{

find_replace.zig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
const std = @import("std");
44

55
pub fn main() !void {
6-
var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .{};
7-
defer _ = general_purpose_allocator.deinit();
8-
const gpa = general_purpose_allocator.allocator();
6+
var debug_allocator: std.heap.DebugAllocator(.{}) = .init;
7+
defer _ = debug_allocator.deinit();
8+
const gpa = debug_allocator.allocator();
99

1010
const args = try std.process.argsAlloc(gpa);
1111
defer std.process.argsFree(gpa, args);
1212

13-
const stderr = std.io.getStdErr().writer();
14-
1513
if (args.len != 5) {
16-
try stderr.print("usage: {s} <input_file> <output_file> <before> <after>\n", .{args[0]});
14+
std.debug.print("usage: {s} <input_file> <output_file> <before> <after>\n", .{args[0]});
1715
std.process.exit(1);
1816
}
1917

0 commit comments

Comments
 (0)