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

Fix install with new bazel 0.5.3 #6736

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# OSX it won't conflict with a build artifacts directory named "build".

load("//tools:check_licenses.bzl", "check_licenses")
load("//tools:install.bzl", "install", "install_files")
load("@drake//tools:install.bzl", "install", "install_files")
load("//tools:lint.bzl", "add_lint_tests")

package(
Expand Down
2 changes: 1 addition & 1 deletion drake/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package(default_visibility = ["//visibility:public"])

load("//tools:install.bzl", "install")
load("@drake//tools:install.bzl", "install")
load("//tools:lint.bzl", "add_lint_tests")
load("//tools:transitive_hdrs.bzl", "transitive_hdrs_library")

Expand Down
2 changes: 1 addition & 1 deletion drake/bindings/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file contains rules for Bazel; see drake/doc/bazel.rst.

load("//tools:gurobi.bzl", "gurobi_test_tags")
load("//tools:install.bzl", "install")
load("@drake//tools:install.bzl", "install")
load("//tools:lint.bzl", "add_lint_tests")
load("//tools:mosek.bzl", "mosek_test_tags")
load(":pybind.bzl", "drake_pybind_cc_binary")
Expand Down
2 changes: 1 addition & 1 deletion drake/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load(
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools:install.bzl", "install")
load("@drake//tools:install.bzl", "install")
load("//tools:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion drake/lcmtypes/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package(default_visibility = ["//visibility:public"])

load("//tools:install.bzl", "install")
load("@drake//tools:install.bzl", "install")
load("//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library", "lcm_java_library")
load("//tools:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion tools/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- python -*-

load(
"//tools:install.bzl",
"@drake//tools:install.bzl",
"cmake_config",
"exports_create_cps_scripts",
"install_cmake_config",
Expand Down
8 changes: 5 additions & 3 deletions tools/check_licenses.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- python -*-

load("@drake//tools:install.bzl", "InstallInfo")

# List of exact file names of license files
LICENSE_LITERALS = [
"BSD-LICENSE", # ccd
Expand Down Expand Up @@ -32,12 +34,12 @@ def _is_license_file(filename):
def _check_licenses_for_label(label):
# Don't check empty installs (can happen if an install is a dummy due to
# some platforms relying on a package already being installed).
if not label.install_actions:
if not label[InstallInfo].install_actions:
return []

# Look for file(s) that appear to be license(s) in the install actions.
has_license = False
for a in label.install_actions:
for a in label[InstallInfo].install_actions:
if _is_license_file(a.src.basename):
has_license = True

Expand All @@ -62,7 +64,7 @@ def _check_licenses_impl(ctx):

_check_licenses = rule(
attrs = {
"install_labels": attr.label_list(providers = ["install_actions"]),
"install_labels": attr.label_list(providers = [InstallInfo]),
},
implementation = _check_licenses_impl,
)
Expand Down
11 changes: 7 additions & 4 deletions tools/install.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _install_impl(ctx):

# Collect install actions from dependencies.
for d in ctx.attr.deps:
actions += d.install_actions
actions += d[InstallInfo].install_actions

# Generate actions for data, docs and includes.
actions += _install_actions(ctx, ctx.attr.docs, ctx.attr.doc_dest,
Expand Down Expand Up @@ -273,14 +273,17 @@ def _install_impl(ctx):

# Return actions.
files = ctx.runfiles(files = [a.src for a in actions])
return InstallInfo(install_actions = actions, runfiles = files)
return [
InstallInfo(install_actions = actions),
DefaultInfo(runfiles = files),
]

# TODO(mwoehlke-kitware) default guess_data to PACKAGE when we have better
# default destinations.
install = rule(
# Update buildifier-tables.json when this changes.
attrs = {
"deps": attr.label_list(providers = ["install_actions"]),
"deps": attr.label_list(providers = [InstallInfo]),
"docs": attr.label_list(allow_files = True),
"doc_dest": attr.string(default = "share/doc/@WORKSPACE@"),
"doc_strip_prefix": attr.string_list(),
Expand Down Expand Up @@ -412,7 +415,7 @@ def _install_files_impl(ctx):
rename = ctx.attr.rename)

# Return computed actions.
return InstallInfo(install_actions = actions)
return [InstallInfo(install_actions = actions)]

install_files = rule(
# Update buildifier-tables.json when this changes.
Expand Down
7 changes: 6 additions & 1 deletion tools/install/gflags/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# -*- python -*-

load("//tools:install.bzl", "cmake_config", "install", "install_cmake_config")
load(
"@drake//tools:install.bzl",
"cmake_config",
"install",
"install_cmake_config",
)
load("//tools:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
7 changes: 6 additions & 1 deletion tools/install/jchart2d/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# -*- python -*-

load("//tools:install.bzl", "cmake_config", "install", "install_cmake_config")
load(
"@drake//tools:install.bzl",
"cmake_config",
"install",
"install_cmake_config",
)
load("//tools:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
7 changes: 6 additions & 1 deletion tools/install/optitrack_driver/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# -*- python -*-

load("//tools:install.bzl", "cmake_config", "install", "install_cmake_config")
load(
"@drake//tools:install.bzl",
"cmake_config",
"install",
"install_cmake_config",
)
load("//tools:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
7 changes: 6 additions & 1 deletion tools/install/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# -*- python -*-

load("//tools:install.bzl", "cmake_config", "install", "install_cmake_config")
load(
"@drake//tools:install.bzl",
"cmake_config",
"install",
"install_cmake_config",
)
load("//tools:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion tools/lcm.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ java_library(
srcs = glob(["lcm-java/lcm/**/*.java"]),
javacopts = [
# Suppressed until lcm-proj/lcm#159 is fixed.
"-extra_checks:off",
"-XepDisableAllChecks",
],
runtime_deps = [
"@com_jidesoft_jide_oss//jar",
Expand Down