Skip to content

Commit c0b5f25

Browse files
authored
Fixup build.zig.zon for 0.14.0 / zig-master branch (#400)
1 parent 4e4dbf3 commit c0b5f25

File tree

33 files changed

+82
-57
lines changed

33 files changed

+82
-57
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
## What version of Zig to use
1010

11-
Zig 0.13.0
11+
Zig 0.14.0
1212

1313
## Getting Started With MicroZig
1414

build-internals/build.zig.zon

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.{
2-
.name = "build-internals",
2+
.name = .build_internals,
33
.version = "0.0.0",
44
.dependencies = .{
55
.regz = .{ .path = "../tools/regz" },

build.zig.zon

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.{
2-
.name = "microzig",
2+
.name = .microzig,
3+
// Note: This should be changed if you fork microzig!
4+
.fingerprint = 0x605a83a849186d0f,
35
.version = "0.13.2",
46
.minimum_zig_version = "0.13.0",
57
.dependencies = .{
@@ -27,8 +29,8 @@
2729

2830
// used for creating package tarballs
2931
.boxzer = .{
30-
.url = "git+https://github.com/mattnite/boxzer.git#59da7d6bcbecb8cb7e76236ea9d18a7a6bcb4d00",
31-
.hash = "1220457e3991f346f2eb4c7adfc1fcd60d71b10a127468949dd91e924e1ec44956f1",
32+
.url = "git+https://github.com/mattnite/boxzer.git#ba48dc0beed520d3fd91738e3717776ac02df175",
33+
.hash = "boxzer-0.1.0-UECMFB7WAAAOQio_OOb84Tmeft26gQ6Ec6jL5MUU_h1r",
3234
},
3335
},
3436
.paths = .{

core/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "core",
2+
.name = .core,
3+
.fingerprint = 0x6b8d854f5061dc46,
34
.version = "0.0.1",
45
.paths = .{
56
"LICENSE",

drivers/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "microzig_driver_framework",
2+
.name = .driverframework,
3+
.fingerprint = 0xfec1b5453a206a46,
34
.version = "0.0.1",
45
.paths = .{
56
"LICENSE",

drivers/stepper/stepper.zig

+13-14
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ pub fn Stepper(comptime Driver: type) type {
7676
steps_remaining: u32 = 0,
7777
// Steps remaining in decel
7878
steps_to_brake: u32 = 0,
79-
// TODO: Just `.from_us(0)` with zig 0.14!
80-
step_pulse: mdf.time.Duration = mdf.time.Duration.from_us(0),
81-
cruise_step_pulse: mdf.time.Duration = mdf.time.Duration.from_us(0),
82-
remainder: mdf.time.Duration = mdf.time.Duration.from_us(0),
83-
last_action_end: mdf.time.Absolute = mdf.time.Absolute.from_us(0),
84-
next_action_interval: mdf.time.Duration = mdf.time.Duration.from_us(0),
79+
step_pulse: mdf.time.Duration = .from_us(0),
80+
cruise_step_pulse: mdf.time.Duration = .from_us(0),
81+
remainder: mdf.time.Duration = .from_us(0),
82+
last_action_end: mdf.time.Absolute = .from_us(0),
83+
next_action_interval: mdf.time.Duration = .from_us(0),
8584
step_count: u32 = 0,
8685
dir_state: mdf.base.Digital_IO.State = .low,
8786
motor_steps: u16,
@@ -191,16 +190,16 @@ pub fn Stepper(comptime Driver: type) type {
191190
}
192191

193192
pub fn start_move(self: *Self, steps: i32) void {
194-
self.start_move_time(steps, mdf.time.Duration.from_us(0));
193+
self.start_move_time(steps, .from_us(0));
195194
}
196195

197196
pub fn start_move_time(self: *Self, steps: i32, time: mdf.time.Duration) void {
198197
// set up new move
199198
self.dir_state = if (steps >= 0) .high else .low;
200-
self.last_action_end = mdf.time.Absolute.from_us(0);
199+
self.last_action_end = .from_us(0);
201200
self.steps_remaining = @abs(steps);
202201
self.step_count = 0;
203-
self.remainder = mdf.time.Duration.from_us(0);
202+
self.remainder = .from_us(0);
204203
switch (self.profile) {
205204
.linear_speed => |p| {
206205
const microstep_f: f64 = @floatFromInt(self.microsteps);
@@ -237,7 +236,7 @@ pub fn Stepper(comptime Driver: type) type {
237236
self.cruise_step_pulse = get_step_pulse(self.motor_steps, self.microsteps, self.rpm);
238237
self.step_pulse = self.cruise_step_pulse;
239238
if (@intFromEnum(time) > self.steps_remaining * @intFromEnum(self.step_pulse)) {
240-
self.step_pulse = mdf.time.Duration.from_us(@intFromFloat(@as(f64, @floatFromInt(time.to_us())) /
239+
self.step_pulse = .from_us(@intFromFloat(@as(f64, @floatFromInt(time.to_us())) /
241240
@as(f64, @floatFromInt(self.steps_remaining))));
242241
}
243242
},
@@ -272,7 +271,7 @@ pub fn Stepper(comptime Driver: type) type {
272271
} else {
273272
// The series approximates target, set the final value to what it should be instead
274273
self.step_pulse = self.cruise_step_pulse;
275-
self.remainder = mdf.time.Duration.from_us(0);
274+
self.remainder = .from_us(0);
276275
}
277276
},
278277
.decelerating => {
@@ -297,7 +296,7 @@ pub fn Stepper(comptime Driver: type) type {
297296
self.clock.sleep_us(@intFromEnum(delay_us));
298297
return;
299298
}
300-
const deadline = mdf.time.Deadline.init_relative(start_us, delay_us);
299+
const deadline: mdf.time.Deadline = .init_relative(start_us, delay_us);
301300
while (!deadline.is_reached_by(self.clock.get_time_since_boot())) {}
302301
}
303302

@@ -320,8 +319,8 @@ pub fn Stepper(comptime Driver: type) type {
320319
self.next_action_interval = if (elapsed.less_than(pulse)) pulse.minus(elapsed) else @enumFromInt(1);
321320
} else {
322321
// end of move
323-
self.last_action_end = mdf.time.Absolute.from_us(0);
324-
self.next_action_interval = mdf.time.Duration.from_us(0);
322+
self.last_action_end = .from_us(0);
323+
self.next_action_interval = .from_us(0);
325324
}
326325
return self.next_action_interval;
327326
}

examples/build.zig.zon

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.{
2-
.name = "examples",
2+
.name = .examples,
3+
.fingerprint = 0x7bd0ad455b19df59,
34
.version = "0.0.0",
45
.dependencies = .{
56
// examples
6-
.@"espressif/esp" = .{ .path = "espressif/esp" },
7+
.@"espressif/esp" = .{ .path = "espressif/esp" },
78
.@"gigadevice/gd32" = .{ .path = "gigadevice/gd32" },
89
.@"microchip/atsam" = .{ .path = "microchip/atsam" },
910
.@"microchip/avr" = .{ .path = "microchip/avr" },

examples/espressif/esp/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/espressif/esp",
2+
.name = .examples_espressif_esp,
3+
.fingerprint = 0xa568458fa3375cb1,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/gigadevice/gd32/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/gigadevice/gd32",
2+
.name = .examples_gigadevice_gd32,
3+
.fingerprint = 0x108c715b1d663409,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/microchip/atsam/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/microchip/atsam",
2+
.name = .examples_microchip_atsam,
3+
.fingerprint = 0x43dbad7fe1a6b6e2,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/microchip/avr/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/microchip/avr",
2+
.name = .examples_microchip_avr,
3+
.fingerprint = 0xd9cc1da3b729e043,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/no_hal/stm32_l031/build.zig.zon

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.{
2-
.name = "examples/stmicro/stm32",
2+
.name = .examples_stmicro_stm32,
33
.version = "0.0.0",
44
.dependencies = .{
55
.microzig = .{ .path = "../../.." },

examples/nordic/nrf5x/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/nordic/nrf5x",
2+
.name = .examples_nordic_nrf5x,
3+
.fingerprint = 0x485c8762b6f2f539,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/nxp/lpc/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/nxp/lpc",
2+
.name = .examples_nxp_lpc,
3+
.fingerprint = 0xde14b1aa923e4b02,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/raspberrypi/rp2xxx/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/raspberrypi/rp2xxx",
2+
.name = .examples_raspberrypi_rp2xxx,
3+
.fingerprint = 0xffa4bfa151162a57,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/stmicro/stm32/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/stmicro/stm32",
2+
.name = .examples_stmicro_stm32,
3+
.fingerprint = 0xb5843068857d2eb,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/wch/ch32v/build.zig.zon

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.{
2-
.name = "examples/wch/ch32v",
2+
.name = .examples_wch_ch32v,
33
.version = "0.0.0",
44
.dependencies = .{
55
.microzig = .{ .path = "../../.." },

modules/foundation-libc/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "foundation-libc",
2+
.name = .foundationlibc,
3+
.fingerprint = 0xfd6aab283c2e012c,
34
.version = "0.0.0",
45
.paths = .{
56
"LICENSE",

modules/foundation-libc/test/build.zig

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn build(b: *Build) void {
3030
// Check if the syntax of all of our header files is valid:
3131
const syntax_validator = b.addStaticLibrary(.{
3232
.name = "syntax-validator",
33-
.target = b.host,
33+
.target = b.graph.host,
3434
.optimize = .Debug,
3535
});
3636
syntax_validator.addCSourceFile(.{
@@ -84,7 +84,7 @@ pub fn build(b: *Build) void {
8484
// Check if the syntax of all of our header files is valid:
8585
const assert_validator = b.addStaticLibrary(.{
8686
.name = "assert-validator",
87-
.target = b.host,
87+
.target = b.graph.host,
8888
.optimize = .Debug,
8989
});
9090
assert_validator.addCSourceFile(.{
@@ -94,7 +94,7 @@ pub fn build(b: *Build) void {
9494
assert_validator.linkLibrary(foundation);
9595
_ = assert_validator.getEmittedBin();
9696

97-
assert_validator.defineCMacro("FOUNDATION_LIBC_ASSERT", assert_mode);
97+
assert_validator.root_module.addCMacro("FOUNDATION_LIBC_ASSERT", assert_mode);
9898

9999
// Just compile, do not install:
100100
validation_step.dependOn(&assert_validator.step);
@@ -128,7 +128,7 @@ fn target_can_multithread(target: Build.ResolvedTarget) bool {
128128
};
129129
}
130130

131-
const validation_target_list = [_]std.zig.CrossTarget{
131+
const validation_target_list = [_]std.Target.Query{
132132
.{}, // regular host platform
133133
.{ .os_tag = .freestanding }, // host platform, but no OS
134134

@@ -160,7 +160,6 @@ const validation_target_list = [_]std.zig.CrossTarget{
160160
// sparc:
161161
.{ .cpu_arch = .sparc, .os_tag = .freestanding },
162162
.{ .cpu_arch = .sparc64, .os_tag = .freestanding },
163-
.{ .cpu_arch = .sparcel, .os_tag = .freestanding },
164163

165164
// power:
166165
.{ .cpu_arch = .powerpc, .os_tag = .freestanding },

modules/foundation-libc/test/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "foundation-libc/test",
2+
.name = .foundationlibc_test,
3+
.fingerprint = 0xad325d06b2097ab,
34
.version = "0.0.0",
45
.dependencies = .{
56
.foundation_libc = .{ .path = ".." },

port/espressif/esp/build.zig.zon

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.{
2-
.name = "port/espressif/esp",
2+
.name = .port_espressif_esp,
33
.version = "0.0.0",
44
.dependencies = .{
55
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/gigadevice/gd32/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/gigadevice/gd32",
2+
.name = .port_gigadevice_gd32,
3+
.fingerprint = 0x581d90a3331f3c5a,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/microchip/atsam/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/microchip/atsam",
2+
.name = .port_microchip_atsam,
3+
.fingerprint = 0xb4a4c8787ed6ccf,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/microchip/avr/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/microchip/avr",
2+
.name = .port_microchip_avr,
3+
.fingerprint = 0xd71805541d74311d,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/nordic/nrf5x/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/nordic/nrf5x",
2+
.name = .port_nordic_nrf5x,
3+
.fingerprint = 0x47cc426a5789bfab,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/nxp/lpc/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/nxp/lpc",
2+
.name = .port_nxp_lpc,
3+
.fingerprint = 0xa34b3f0c0a15a836,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/raspberrypi/rp2xxx/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/raspberrypi/rp2xxx",
2+
.name = .port_raspberrypi_rp2xxx,
3+
.fingerprint = 0x841efcfeb290b1e6,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/stmicro/stm32/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "port/stmicro/stm32",
2+
.name = .port_stmicro_stm32,
3+
.fingerprint = 0x58c5bf1b628dcc9,
34
.version = "0.0.0",
45
.dependencies = .{
56
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

port/wch/ch32v/build.zig.zon

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.{
2-
.name = "port/wch/ch32v",
2+
.name = .port_wch_ch32v,
33
.version = "0.0.0",
44
.dependencies = .{
55
.@"microzig/build-internals" = .{ .path = "../../../build-internals" },

tools/package-test/build.zig.zon

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.{
2-
.name = "package-test",
2+
.name = .package_test,
3+
.fingerprint = 0x63321bc42367f374,
34
.version = "0.0.0",
5+
.dependencies = .{},
46
.paths = .{
57
"build.zig",
68
"build.zig.zon",

tools/regz/build.zig.zon

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "tools/regz",
2+
.name = .tools_regz,
3+
.fingerprint = 0xf89cb48cac38901f,
34
.version = "0.0.0",
45
.paths = .{
56
"LICENSE",
@@ -12,11 +13,11 @@
1213
.dependencies = .{
1314
.libxml2 = .{
1415
.url = "git+https://github.com/mattnite/zig-build-libxml2.git#ab99b56cc3709d2008ebc005b096d85d2a03b462",
15-
.hash = "122053ef8368ce881da81fb6bcb95db162dc358243d935bdc52c85996fd53ad46b5f",
16+
.hash = "N-V-__8AAF9angBT74NozogdqB-2vLldsWLcNYJD2TW9xSyF",
1617
},
1718
.sqlite = .{
1819
.url = "git+https://github.com/mattnite/zig-sqlite.git#4e554ab43095859e153a5652667fd8a4d697b223",
19-
.hash = "1220bbf36166a56f03ca55c2f455f70cdb3dd5f8dca1f7c78e57d9402add9635b2b9",
20+
.hash = "sqlite-3.47.2-AAAAACdIpQC782FmpW8DylXC9FX3DNs91fjcoffHjlfZ",
2021
},
2122
},
2223
}

tools/uf2/build.zig.zon

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "tools/uf2",
2+
.name = .tools_uf2,
3+
.fingerprint = 0xc41375bcba522365,
34
.version = "0.0.0",
45
.paths = .{
56
"LICENSE",

0 commit comments

Comments
 (0)