Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
peterebden committed Sep 29, 2023
1 parent 6975b70 commit ef658af
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions build_defs/go.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ def go_library(name:str, srcs:list, resources:list=[], asm_srcs:list=None, hdrs:
private = out.startswith('_')
package_path = _get_import_path(package, import_path)

# Dummy modinfo so we don't have to provide everything for binary modinfo actions.
modinfo = filegroup(
name = name,
tag = "modinfo",
deps = deps,
)

# We could just depend on go_src for all our deps but that would mean bringing in srcs for targets outside this
# package like third party sources which is especially slow on systems with slow syscall performance (macOS)
if _all_srcs:
Expand Down Expand Up @@ -369,7 +376,7 @@ def go_library(name:str, srcs:list, resources:list=[], asm_srcs:list=None, hdrs:
test_only = test_only,
labels=labels,
)
provides = {'go': ':' + name, 'go_src': lib_rule}
provides = {'go': ':' + name, 'go_src': lib_rule, 'modinfo': modinfo}
if cover and not CONFIG.GO.COVERAGEREDESIGN:
provides['cover_vars'] = cover_vars
return build_rule(
Expand Down Expand Up @@ -413,11 +420,6 @@ def go_library(name:str, srcs:list, resources:list=[], asm_srcs:list=None, hdrs:
complete = complete,
test_only = test_only,
)]
# Dummy modinfo so we don't have to provide everything for binary modinfo actions.
modinfo = filegroup(
name = name,
tag = "modinfo",
)

tools = { 'go': [CONFIG.GO.GO_TOOL] }
if filter_srcs or cover:
Expand Down

0 comments on commit ef658af

Please sign in to comment.