Skip to content

Commit

Permalink
Update zig-master branch to work on Zig's master branch (#356)
Browse files Browse the repository at this point in the history
* Prepare CI for future 0.14.0 release

* Regz build and tests passing

* UF2 builds and passes tests

* hardcode CI to master for now

* use sqlite fork

* fix stm32 generation

* update to master

* update boxzer

* up comptime quotas

* update zine for website

* Don't build ch32v examples in CI for now
  • Loading branch information
mattnite committed Jan 24, 2025
1 parent f1dfca4 commit 1d20198
Show file tree
Hide file tree
Showing 65 changed files with 486 additions and 493 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
ZIG_VERSION: ${{ github.ref == 'refs/heads/zig-master' && 'master' || '0.13.0' }}
ZIG_VERSION: master

jobs:
unit-test-regz:
Expand Down Expand Up @@ -123,7 +123,8 @@ jobs:
nxp/lpc,
stmicro/stm32,
raspberrypi/rp2xxx,
wch/ch32v,
# TODO: investigate why these take up too much flash
#wch/ch32v,
]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
version: 0.14.0

- name: Extract version
run: echo "MICROZIG_VERSION=$(zig build package -- get-version)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
version: 0.14.0

- name: Download and install GitHub CLI
run: |
Expand Down
2 changes: 1 addition & 1 deletion build-internals/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const LazyPath = Build.LazyPath;
const Module = Build.Module;

const regz = @import("regz");
const Patch = regz.patch.Patch;
pub const Patch = regz.patch.Patch;
const uf2 = @import("uf2");
const FamilyId = uf2.FamilyId;

Expand Down
18 changes: 9 additions & 9 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn build(b: *Build) void {
const generate_linker_script_exe = b.addExecutable(.{
.name = "generate_linker_script",
.root_source_file = b.path("tools/generate_linker_script.zig"),
.target = b.host,
.target = b.graph.host,
.optimize = optimize,
});

Expand Down Expand Up @@ -116,13 +116,13 @@ pub const PortSelect = blk: {
fields = fields ++ [_]std.builtin.Type.StructField{.{
.name = port.name,
.type = bool,
.default_value = @as(*const anyopaque, @ptrCast(&false)),
.default_value_ptr = @as(*const anyopaque, @ptrCast(&false)),
.is_comptime = false,
.alignment = @alignOf(bool),
}};
}
break :blk @Type(.{
.Struct = .{
.@"struct" = .{
.layout = .auto,
.fields = fields,
.decls = &.{},
Expand All @@ -140,13 +140,13 @@ pub const PortCache = blk: {
fields = fields ++ [_]std.builtin.Type.StructField{.{
.name = port.name,
.type = typ,
.default_value = @as(*const anyopaque, @ptrCast(&@as(typ, null))),
.default_value_ptr = @as(*const anyopaque, @ptrCast(&@as(typ, null))),
.is_comptime = false,
.alignment = @alignOf(typ),
}};
}
break :blk @Type(.{
.Struct = .{
.@"struct" = .{
.layout = .auto,
.fields = fields,
.decls = &.{},
Expand Down Expand Up @@ -194,15 +194,15 @@ pub fn MicroBuild(port_select: PortSelect) type {
fields = fields ++ [_]std.builtin.Type.StructField{.{
.name = port.name,
.type = typ,
.default_value = null,
.default_value_ptr = null,
.is_comptime = false,
.alignment = @alignOf(typ),
}};
}
}

break :blk @Type(.{
.Struct = .{
.@"struct" = .{
.layout = .auto,
.fields = fields,
.decls = &.{},
Expand Down Expand Up @@ -711,7 +711,7 @@ pub inline fn custom_lazy_import(
const deps = build_runner.dependencies;
const pkg_hash = custom_find_import_pkg_hash_or_fatal(dep_name);

inline for (@typeInfo(deps.packages).Struct.decls) |decl| {
inline for (@typeInfo(deps.packages).@"struct".decls) |decl| {
if (comptime std.mem.eql(u8, decl.name, pkg_hash)) {
const pkg = @field(deps.packages, decl.name);
const available = !@hasDecl(pkg, "available") or pkg.available;
Expand All @@ -733,7 +733,7 @@ inline fn custom_find_import_pkg_hash_or_fatal(comptime dep_name: []const u8) []
const build_runner = @import("root");
const deps = build_runner.dependencies;

const pkg_deps = comptime for (@typeInfo(deps.packages).Struct.decls) |decl| {
const pkg_deps = comptime for (@typeInfo(deps.packages).@"struct".decls) |decl| {
const pkg_hash = decl.name;
const pkg = @field(deps.packages, pkg_hash);
if (@hasDecl(pkg, "build_zig") and pkg.build_zig == @This()) break pkg.deps;
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

// used for creating package tarballs
.boxzer = .{
.url = "git+https://github.com/mattnite/boxzer#a6a9150c2638ebd079f83ee90c6f9fc6adb16dbf",
.hash = "12204586b437ba1057f5ad16eb0c7392bc9534602bf435bf6c9a41cc5a8747630e65",
.url = "git+https://github.com/mattnite/boxzer.git#99ae59d04cff8321e3bfcdf392a177cb75a1181c",
.hash = "12205fc4565cb5f6e1b93ae7076b1e2d49644392d525d8bd2dd6af860e7d3e3a825d",
},
},
.paths = .{
Expand Down
Loading

0 comments on commit 1d20198

Please sign in to comment.