Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TF XLA AOT] Make sure required sources are included in pip package. #37464

Merged
merged 1 commit into from
Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions tensorflow/tensorflow.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2710,17 +2710,26 @@ def tf_external_workspace_visible(visibility):
# External workspaces can see this target.
return ["//visibility:public"]

def _filegroup_as_file(ctx):
def _filegroup_as_file_impl(ctx):
out = ctx.actions.declare_file(ctx.label.name)
ctx.actions.write(
output = out,
content = "\n".join([f.short_path for f in ctx.files.dep]),
)
return DefaultInfo(files = depset([out]))

filegroup_as_file = rule(
implementation = _filegroup_as_file,
_filegroup_as_file = rule(
implementation = _filegroup_as_file_impl,
attrs = {
"dep": attr.label(),
},
)

def filegroup_as_file(name, dep, visibility = []):
"""Creates a filegroup ${name}_file which contains the file ${name}."""
_filegroup_as_file(name = name, dep = dep)
native.filegroup(
name = name + "_file",
srcs = [name],
visibility = visibility,
)
2 changes: 1 addition & 1 deletion tensorflow/tools/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ COMMON_PIP_DEPS = [
"README",
"setup.py",
":included_headers",
":xla_compiled_cpu_runtime_srcs.txt",
":xla_compiled_cpu_runtime_srcs.txt_file",
"//tensorflow:tensorflow_py",
"//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_hdrs",
"//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_srcs",
Expand Down
1 change: 1 addition & 0 deletions tensorflow/tools/pip_package/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ recursive-include tensorflow/include/google *.inc
recursive-include tensorflow/include/include *.h
recursive-include tensorflow/include/third_party *
recursive-include tensorflow/include/unsupported *
recursive-include tensorflow/xla_aot_runtime_src *