summaryrefslogtreecommitdiffhomepage
path: root/tools/defs.bzl
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-02-11 11:40:51 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-11 11:41:55 -0800
commit9be46e55c2aadcf40c9abd4b515c3fe899d9fa08 (patch)
treea29564c8d7585f78e96499f98328bc79978297a3 /tools/defs.bzl
parent115898e368e4afe5418a7290d9545fafc7f6f25e (diff)
Stateify: register types with full package names
This is to avoid conflicts with types that share the same [short] package and type names, e.g. proc.smapsData exist in pkg/sentry/fs/proc and pkg/sentry/fsimpl/proc. Updates #1663 PiperOrigin-RevId: 294485146
Diffstat (limited to 'tools/defs.bzl')
-rw-r--r--tools/defs.bzl4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/defs.bzl b/tools/defs.bzl
index d4690cc1a..46249f9c4 100644
--- a/tools/defs.bzl
+++ b/tools/defs.bzl
@@ -110,6 +110,8 @@ def go_library(name, srcs, deps = [], imports = [], stateify = True, marshal = F
"""
all_srcs = srcs
all_deps = deps
+ dirname, _, _ = native.package_name().rpartition("/")
+ full_pkg = dirname + "/" + name
if stateify:
# Only do stateification for non-state packages without manual autogen.
# First, we need to segregate the input files via the special suffixes,
@@ -120,7 +122,7 @@ def go_library(name, srcs, deps = [], imports = [], stateify = True, marshal = F
name = name + suffix + "_state_autogen_with_imports",
srcs = srcs,
imports = imports,
- package = name,
+ package = full_pkg,
out = name + suffix + "_state_autogen_with_imports.go",
)
go_imports(