Skip to content

Commit

Permalink
feat: remote build (buildfarm) (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
0-Sacha authored Nov 21, 2024
1 parent 7ae93f3 commit 5f8d6cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
11 changes: 2 additions & 9 deletions templates/BUILD.bazel.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,14 @@ cc_toolchain_config(
"%{compiler_package}:dbg": "dbg",
},

cxx_builtin_include_directories = [
"%{compiler_package_path}%{toolchain_type}/include",
"%{compiler_package_path}lib/gcc/%{toolchain_type}/%{compiler_version}/include",
"%{compiler_package_path}lib/gcc/%{toolchain_type}/%{compiler_version}/include-fixed",

toolchain_builtin_includedirs = [
"%{compiler_package_path}%{toolchain_type}/include/c++/%{compiler_version}",
"%{compiler_package_path}%{toolchain_type}/include/c++/%{compiler_version}/%{toolchain_type}",
],

copts = %{copts},
conlyopts = %{conlyopts},
cxxopts = %{cxxopts} + [
"-isystem%{compiler_package_path}%{toolchain_type}/include/c++/%{compiler_version}",
"-isystem%{compiler_package_path}%{toolchain_type}/include/c++/%{compiler_version}/%{toolchain_type}",
],
cxxopts = %{cxxopts},
linkopts = %{linkopts},
defines = %{defines},
includedirs = %{includedirs},
Expand Down
19 changes: 9 additions & 10 deletions templates/rules.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")

def _arm_all_files_impl(ctx):
ctx.actions.run(
ctx.actions.run_shell(
inputs = [ ctx.file.dep ],
outputs = [ ctx.outputs.elf ],
executable = "cp",
arguments = [
ctx.file.dep.path,
ctx.outputs.elf.path
],
command = "cp {dep} {elf}".format(
dep = ctx.file.dep.path,
elf = ctx.outputs.elf.path,
),
)
ctx.actions.run(
inputs = [ ctx.file.dep ],
outputs = [ ctx.outputs.bin ],
tools = [ ctx.file.objcopy ],
executable = ctx.file.objcopy.path,
executable = ctx.file.objcopy,
arguments = [
"-O",
"binary",
Expand All @@ -28,8 +26,7 @@ def _arm_all_files_impl(ctx):
ctx.actions.run(
inputs = [ ctx.file.dep ],
outputs = [ ctx.outputs.hex ],
tools = [ ctx.file.objcopy ],
executable = ctx.file.objcopy.path,
executable = ctx.file.objcopy,
arguments = [
"-O",
"ihex",
Expand All @@ -40,6 +37,7 @@ def _arm_all_files_impl(ctx):
ctx.actions.run_shell(
inputs = [ ctx.file.dep ],
outputs = [ ctx.outputs.dmp ],
tools = [ ctx.file.objdump ],
command = "{objdump} {flags} {deps} > {out}".format(
objdump = ctx.file.objdump.path,
flags = "-x --syms",
Expand All @@ -50,6 +48,7 @@ def _arm_all_files_impl(ctx):
ctx.actions.run_shell(
inputs = [ ctx.file.dep ],
outputs = [ ctx.outputs.asm ],
tools = [ ctx.file.objdump ],
command = "{objdump} {flags} {deps} > {out}".format(
objdump = ctx.file.objdump.path,
flags = "-d",
Expand Down

0 comments on commit 5f8d6cc

Please sign in to comment.