Skip to content

Commit

Permalink
Use prebuilt launcher_maker for Windows
Browse files Browse the repository at this point in the history
Using a prebuilt binary solves a few issues:
* Avoids having to build the launcher maker entirely. It is special purpose
  binary, isn't going to change much, and would otherwise incur needing a
  C++ toolchain.
* It doesn't work with `--host_copt=/DUNICODE`, as described in #19977
* Preserves behavior of Starlarkified rules that use the launcher maker.
  The non-Starlark implementation used a special Java-implemented action
  to replicate what launcher_maker does, thus avoiding the C++ toolchain
  dependency.

Fixes #19977

PiperOrigin-RevId: 580200034
Change-Id: Ic5a65a5021ea8b0b325b68c1817180e429b6d56b
  • Loading branch information
rickeylev authored and copybara-github committed Nov 7, 2023
1 parent 2052c63 commit f898da5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/create_embedded_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
('*tools/cpp/runfiles/generated_*',
lambda x: 'tools/cpp/runfiles/' + os.path.basename(x)[len('generated_'):]),
('*launcher.exe', lambda x: 'tools/launcher/launcher.exe'),
('*launcher_maker.exe', lambda x: 'tools/launcher/launcher_maker.exe'),
('*def_parser.exe', lambda x: 'tools/def_parser/def_parser.exe'),
('*zipper.exe', lambda x: 'tools/zip/zipper/zipper.exe'),
('*zipper', lambda x: 'tools/zip/zipper/zipper'),
Expand Down
15 changes: 14 additions & 1 deletion tools/launcher/BUILD.tools
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,18 @@ filegroup(

filegroup(
name = "launcher_maker",
srcs = ["//src/tools/launcher:launcher_maker"],
srcs = select({
"//src/conditions:host_windows": [":launcher_maker_windows"],
"//conditions:default": [
"//src/tools/launcher:launcher_maker",
],
}),
)

filegroup(
name = "launcher_maker_windows",
srcs = select({
"//src/conditions:remote": ["//src/tools/launcher:launcher_maker"],
"//conditions:default": ["launcher_maker.exe"],
}),
)

0 comments on commit f898da5

Please sign in to comment.