gpu-dawn: explicitly target <arch>-macos.12

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-02-27 14:43:38 -07:00
parent 00ec15a4b0
commit 4ba7172626
3 changed files with 28 additions and 18 deletions

View file

@ -86,14 +86,14 @@ jobs:
- name: Clone mach-glfw
run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw
- name: install (debug)
run: zig build install -Dfrom-source=true -Dtarget=x86_64-macos
run: zig build install -Dfrom-source=true -Dtarget=x86_64-macos.12
env:
AGREE: true
- name: upload (debug)
run: |
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_debug.a
gzip -9 zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_debug.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_debug.a.gz
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12---12-gnu_debug.a
gzip -9 zig-out/lib/libdawn_x86_64-macos.12---12-gnu_debug.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12---12-gnu_debug.a.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
x86_64-macos_release-fast:
@ -111,13 +111,13 @@ jobs:
- name: Clone mach-glfw
run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw
- name: install (release-fast)
run: zig build install -Dfrom-source=true -Drelease-fast=true -Dtarget=x86_64-macos
run: zig build install -Dfrom-source=true -Drelease-fast=true -Dtarget=x86_64-macos.12
env:
AGREE: true
- name: upload (release-fast)
run: |
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_release-fast.a
gzip -9 zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_release-fast.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_release-fast.a.gz
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12---12-gnu_release-fast.a
gzip -9 zig-out/lib/libdawn_x86_64-macos.12---12-gnu_release-fast.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12---12-gnu_release-fast.a.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -24,24 +24,24 @@ jobs:
- name: Clone mach-glfw
run: rm libs/mach-glfw && git clone https://github.com/hexops/mach-glfw libs/mach-glfw
- name: install (debug)
run: zig build install -Dfrom-source=true -Dtarget=aarch64-macos
run: zig build install -Dfrom-source=true -Dtarget=aarch64-macos.12
env:
AGREE: true
- name: upload (debug)
run: |
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_debug.a
gzip -9 zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_debug.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_debug.a.gz
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12---12-gnu_debug.a
gzip -9 zig-out/lib/libdawn_aarch64-macos.12---12-gnu_debug.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12---12-gnu_debug.a.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: install (release-fast)
run: zig build install -Dfrom-source=true -Drelease-fast=true -Dtarget=aarch64-macos
run: zig build install -Dfrom-source=true -Drelease-fast=true -Dtarget=aarch64-macos.12
env:
AGREE: true
- name: upload (release-fast)
run: |
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_release-fast.a
gzip -9 zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_release-fast.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_release-fast.a.gz
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12---12-gnu_release-fast.a
gzip -9 zig-out/lib/libdawn_aarch64-macos.12---12-gnu_release-fast.a
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12---12-gnu_release-fast.a.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -190,7 +190,7 @@ fn ensureSubmodules(allocator: std.mem.Allocator) !void {
pub fn linkFromBinary(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void {
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
const zig_triple = target.zigTriple(b.allocator) catch unreachable;
var zig_triple = target.zigTriple(b.allocator) catch unreachable;
const binaries_available = switch (target.os.tag) {
.windows => false, // TODO(build-system): add Windows binaries
@ -201,8 +201,18 @@ pub fn linkFromBinary(b: *Builder, step: *std.build.LibExeObjStep, options: Opti
// If min. target macOS version is lesser than the min version we have available, then
// our binary is incompatible with the target.
const min_available = std.builtin.Version{ .major = 12, .minor = 1 };
const min_available = std.builtin.Version{ .major = 12, .minor = 0 };
if (target.os.version_range.semver.min.order(min_available) == .lt) break :blk false;
// update zig_triple to reflect the Zig triple of the binary release we're downloading.
var binary_target = target;
binary_target.os.version_range = .{
.semver = .{
.min = min_available,
.max = min_available,
},
};
zig_triple = target.zigTriple(b.allocator) catch unreachable;
break :blk true;
},
else => false,