Skip to content

Commit ec7fd57

Browse files
authored
Merge pull request #181 from kubkon/writergate
writergate: update the codebase for latest breaking changes to std.Io.Writer interface
2 parents 83ad70a + b3bc400 commit ec7fd57

28 files changed

+320
-757
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: mlugg/setup-zig@v1
16+
- uses: mlugg/setup-zig@v2
1717
with:
18-
version: 0.14.0
18+
version: master
1919
- run: zig version
2020
- run: zig fmt --check src
2121
- run: zig build test -Dhas-zig -Dhas-objc-msgsend-stubs --summary all

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tl;dr `bold` is currently directly competing with LLVM lld but behind the Apple
4444

4545
### Building
4646

47-
You will need Zig 0.14.0 in your path. You can download it from [here](https://ziglang.org/download/).
47+
You will need nightly Zig in your path. You can download it from [here](https://ziglang.org/download/).
4848

4949
```
5050
$ zig build -Doptimize=ReleaseFast

build.zig

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@ pub fn build(b: *std.Build) void {
2929
.target = target,
3030
.optimize = mode,
3131
});
32-
33-
const exe = b.addExecutable(.{
34-
.name = "bold",
32+
const main = b.addModule("bold", .{
3533
.root_source_file = b.path("src/main.zig"),
3634
.target = target,
3735
.optimize = mode,
38-
.use_llvm = use_llvm,
3936
.sanitize_thread = sanitize_thread,
4037
.single_threaded = single_threaded,
4138
});
39+
40+
const exe = b.addExecutable(.{
41+
.name = "bold",
42+
.root_module = main,
43+
.use_llvm = use_llvm,
44+
});
4245
exe.root_module.addImport("yaml", yaml.module("yaml"));
4346
exe.root_module.addImport("dis_x86_64", dis_x86_64.module("dis_x86_64"));
4447
exe.root_module.strip = strip;
@@ -78,12 +81,8 @@ pub fn build(b: *std.Build) void {
7881
const is_nix = b.option(bool, "nix", "Whether the host is Nix-based") orelse false;
7982

8083
const unit_tests = b.addTest(.{
81-
.root_source_file = b.path("src/MachO.zig"),
82-
.target = target,
83-
.optimize = mode,
84+
.root_module = main,
8485
.use_llvm = use_llvm,
85-
.sanitize_thread = sanitize_thread,
86-
.single_threaded = single_threaded,
8786
});
8887
const unit_tests_opts = b.addOptions();
8988
unit_tests.root_module.addOptions("build_options", unit_tests_opts);

build.zig.zon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
.dependencies = .{
66
.@"zig-yaml" = .{
7-
.url = "https://github.com/kubkon/zig-yaml/archive/refs/tags/0.1.1.tar.gz",
8-
.hash = "zig_yaml-0.1.0-C1161miEAgBCwL3YAEQZwV_4GyaaT2Xqj9nKB6hNe_TL",
7+
.url = "https://github.com/kubkon/zig-yaml/archive/497fca7c3bfc84807547a48f97a15faf3b302024.tar.gz",
8+
.hash = "zig_yaml-0.1.0-C1161nurAgA_fBRSFEaMD7RmHuefuwtP8n99inEXTi_F",
99
},
1010
.@"zig-dis-x86_64" = .{
11-
.url = "https://github.com/kubkon/zig-dis-x86_64/archive/48c399d7f9d879f46a69d4a06af3fa0699286ba5.tar.gz",
12-
.hash = "zig_dis_x86_64-0.0.1-bnhOUXf6AwDf1MpMgHZImLwqhFbUp2Fl_MoxhtPEeo4N",
11+
.url = "https://github.com/kubkon/zig-dis-x86_64/archive/5c57c8b922d15d57c0addb42ca8f0eadb5776fe0.tar.gz",
12+
.hash = "zig_dis_x86_64-0.0.1-bnhOUan2AwCq_1M_JlJCpTB5ve3z1xLVNNyyxLHfWg8D",
1313
},
1414
},
1515

flake.lock

Lines changed: 44 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Archive.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ pub fn parse(self: *Archive, macho_file: *MachO, path: []const u8, file_handle:
8484
pos += @sizeOf(ar_hdr);
8585

8686
if (!mem.eql(u8, &hdr.ar_fmag, ARFMAG)) {
87-
macho_file.fatal("{s}: invalid header delimiter: expected '{s}', found '{s}'", .{
88-
path, std.fmt.fmtSliceEscapeLower(ARFMAG), std.fmt.fmtSliceEscapeLower(&hdr.ar_fmag),
87+
macho_file.fatal("{s}: invalid header delimiter: expected '{f}', found '{f}'", .{
88+
path, std.ascii.hexEscape(ARFMAG, .lower), std.ascii.hexEscape(&hdr.ar_fmag, .lower),
8989
});
9090
return error.ParseFailed;
9191
}

0 commit comments

Comments
 (0)