From 88c6d9089115c4ecdd1ad797f5ee5bffc4699db7 Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Thu, 13 Feb 2025 11:54:56 +0000 Subject: [PATCH] fix: optimise the Apple Silicon APE launcher --- MODULE.bazel | 1 + ape/compile/repository.bzl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index a9031fc5..87d30d38 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -71,6 +71,7 @@ compile = use_repo_rule("//ape/compile:repository.bzl", "compile") compile( name = "ape-arm64.macho", srcs = ["@ape-m1.c"], + args = ["-O"], links = { "entrypoint": "binary", }, diff --git a/ape/compile/repository.bzl b/ape/compile/repository.bzl index ea8ce19d..a0590e8d 100644 --- a/ape/compile/repository.bzl +++ b/ape/compile/repository.bzl @@ -33,6 +33,9 @@ ATTRS = { cfg = "exec", default = "@zig", ), + "args": attr.string_list( + doc = "Extra arguments to pass to the compile command.", + ), } def implementation(rctx): @@ -55,6 +58,7 @@ def implementation(rctx): "-o", rctx.attr.output, ] + cmd.extend(rctx.attr.args) cmd.extend(rctx.attr.srcs) rctx.watch(rctx.attr.zig) -- GitLab