Repository: bazelbuild/bazel
Issue: bash-completion should not be a hard dependency in the .deb package
Labels: untriaged
team-OSS

### Description of the problem / feature request:

The bazel .deb package includes a hard dependency on the bash-completion package, which makes it annoying for users who don't want bash-completion features.

I think bash-completion should be moved to a weaker dependency type, preferably Suggests ("This is used to declare that one package may be more useful with one or more others. Using this field tells the packaging system and the user that the listed packages are related to this one and can perhaps enhance its usefulness, but that installing this one without them is perfectly reasonable.")

Reference:
https://www.debian.org/doc/debian-policy/ch-relationships.html

### Feature requests: what underlying problem are you trying to solve with this feature?

Users should be able to install bazel .deb packages without bash-completion.

### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

$ sudo dpkg --purge bash-completion
dpkg: dependency problems prevent removal of bash-completion:
 bazel depends on bash-completion.

dpkg: error processing package bash-completion (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 bash-completion
$ bazel build //scripts/packages/debian:bazel-debian
$ dpkg --info bazel-bin/scripts/packages/debian/bazel__amd64.deb | grep Depends:
 Depends: g++, zlib1g-dev, bash-completion, unzip, python

### What operating system are you running Bazel on?

Ubuntu 16.04.

### What's the output of `bazel info release`?

development version

### If `bazel info release` returns "development version" or "(@non-git)", tell us how you built Bazel.

bazel build //scripts/packages/debian:bazel-debian

### What's the output of `git remote get-url origin ; git rev-parse master ; git rev-parse HEAD` ?

https://github.com/bazelbuild/bazel.git
6fef731669a83cc22f7cc435befe3561e99fd0e5
6fef731669a83cc22f7cc435befe3561e99fd0e5

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/scripts/packages/debian/BUILD b/scripts/packages/debian/BUILD
index cffa82cb27b6e6..44e7375e23ec41 100644
--- a/scripts/packages/debian/BUILD
+++ b/scripts/packages/debian/BUILD
@@ -79,7 +79,6 @@ pkg_deb(
         # Keep in sync with Depends section in ./control
         "g++",
         "zlib1g-dev",
-        "bash-completion",
         "unzip",
         "python",
     ],
@@ -90,6 +89,7 @@ pkg_deb(
     suggests = [
         # Keep in sync with Suggests section in ./control
         "google-jdk | java8-sdk-headless | java8-jdk | java8-sdk | oracle-java8-installer",
+        "bash-completion",
     ],
     version_file = ":version.txt",
     visibility = ["//scripts/packages:__pkg__"],
diff --git a/scripts/packages/debian/control b/scripts/packages/debian/control
index 19e2b03efaa67f..ad2455b132121b 100644
--- a/scripts/packages/debian/control
+++ b/scripts/packages/debian/control
@@ -10,8 +10,8 @@ Section: contrib/devel
 Priority: optional
 Architecture: amd64
 # Keep in sync with :bazel-debian in ./BUILD
-Depends: g++, zlib1g-dev, bash-completion, unzip, python
-Suggests: google-jdk | java8-sdk-headless | java8-jdk | java8-sdk | oracle-java8-installer
+Depends: g++, zlib1g-dev, unzip, python
+Suggests: google-jdk | java8-sdk-headless | java8-jdk | java8-sdk | oracle-java8-installer, bash-completion
 Description: Bazel is a tool that automates software builds and tests.
  Supported build tasks include running compilers and linkers to produce
  executable programs and libraries, and assembling deployable packages


Test patch: