Skip to content

Commit

Permalink
Adapt @graknlabs_bazel_distribution to @rules_pkg (#181)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?

Reduce potential tech debt and allow further upgrade to Bazel 0.29.1 and Python 3 by no longer using built-in obsolete `pkg_deb`/`pkg_rpm`/`pkg_tar` rules

## What are the changes implemented in this PR?

-  `common/java_deps.bzl` :`depset` is no longer iterable in `bazel 0.29.1` [`--incompatible_depset_is_not_iterable=true` by default], therefore we have to first convert it into a list
- add reference to `bazelbuild_rules_pkg` which now provide now-deprecated `pkg_deb`/`pkg_rpm`/`pkg_tar`
- remove `apt/pkg_deb_modified_from_bazel` package since it's no longer needed
- rename `github_dependencies_for_deployment` to `tcnksm_ghr` for macros to have consistent naming
- add default `release` to RPM targets (it's now a required attribute)
- chore: regenerate docs
  • Loading branch information
Max Vorobev authored Sep 18, 2019
1 parent 1ec7e2d commit d4a7864
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 1,472 deletions.
1 change: 0 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ stardoc(
input = "doc_hub.bzl",
out = "README.md",
deps = [
"//apt/pkg_deb_modified_from_bazel:lib",
"//apt:lib",
"//aws:lib",
"//brew:lib",
Expand Down
217 changes: 0 additions & 217 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,223 +973,6 @@ Packs Java library alongside with its dependencies into archive
</table>


<a name="#pkg_deb"></a>

## pkg_deb

<pre>
pkg_deb(<a href="#pkg_deb-name">name</a>, <a href="#pkg_deb-architecture">architecture</a>, <a href="#pkg_deb-built_using">built_using</a>, <a href="#pkg_deb-built_using_file">built_using_file</a>, <a href="#pkg_deb-conffiles">conffiles</a>, <a href="#pkg_deb-conffiles_file">conffiles_file</a>, <a href="#pkg_deb-config">config</a>, <a href="#pkg_deb-conflicts">conflicts</a>, <a href="#pkg_deb-data">data</a>, <a href="#pkg_deb-depends">depends</a>, <a href="#pkg_deb-depends_file">depends_file</a>, <a href="#pkg_deb-description">description</a>, <a href="#pkg_deb-description_file">description_file</a>, <a href="#pkg_deb-distribution">distribution</a>, <a href="#pkg_deb-enhances">enhances</a>, <a href="#pkg_deb-homepage">homepage</a>, <a href="#pkg_deb-maintainer">maintainer</a>, <a href="#pkg_deb-make_deb">make_deb</a>, <a href="#pkg_deb-package">package</a>, <a href="#pkg_deb-postinst">postinst</a>, <a href="#pkg_deb-postrm">postrm</a>, <a href="#pkg_deb-predepends">predepends</a>, <a href="#pkg_deb-preinst">preinst</a>, <a href="#pkg_deb-prerm">prerm</a>, <a href="#pkg_deb-priority">priority</a>, <a href="#pkg_deb-recommends">recommends</a>, <a href="#pkg_deb-section">section</a>, <a href="#pkg_deb-suggests">suggests</a>, <a href="#pkg_deb-templates">templates</a>, <a href="#pkg_deb-urgency">urgency</a>, <a href="#pkg_deb-version">version</a>, <a href="#pkg_deb-version_file">version_file</a>)
</pre>



### Attributes

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="pkg_deb-name">
<td><code>name</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#name">Name</a>; required
<p>
A unique name for this target.
</p>
</td>
</tr>
<tr id="pkg_deb-architecture">
<td><code>architecture</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-built_using">
<td><code>built_using</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-built_using_file">
<td><code>built_using_file</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-conffiles">
<td><code>conffiles</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-conffiles_file">
<td><code>conffiles_file</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-config">
<td><code>config</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-conflicts">
<td><code>conflicts</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-data">
<td><code>data</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; required
</td>
</tr>
<tr id="pkg_deb-depends">
<td><code>depends</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-depends_file">
<td><code>depends_file</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-description">
<td><code>description</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-description_file">
<td><code>description_file</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-distribution">
<td><code>distribution</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-enhances">
<td><code>enhances</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-homepage">
<td><code>homepage</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-maintainer">
<td><code>maintainer</code></td>
<td>
String; required
</td>
</tr>
<tr id="pkg_deb-make_deb">
<td><code>make_deb</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-package">
<td><code>package</code></td>
<td>
String; required
</td>
</tr>
<tr id="pkg_deb-postinst">
<td><code>postinst</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-postrm">
<td><code>postrm</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-predepends">
<td><code>predepends</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-preinst">
<td><code>preinst</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-prerm">
<td><code>prerm</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-priority">
<td><code>priority</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-recommends">
<td><code>recommends</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-section">
<td><code>section</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-suggests">
<td><code>suggests</code></td>
<td>
List of strings; optional
</td>
</tr>
<tr id="pkg_deb-templates">
<td><code>templates</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
<tr id="pkg_deb-urgency">
<td><code>urgency</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-version">
<td><code>version</code></td>
<td>
String; optional
</td>
</tr>
<tr id="pkg_deb-version_file">
<td><code>version_file</code></td>
<td>
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
</td>
</tr>
</tbody>
</table>


<a name="#tgz2zip"></a>

## tgz2zip
Expand Down
12 changes: 9 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

workspace(name="graknlabs_bazel_distribution")

load("//github:dependencies.bzl", "github_dependencies_for_deployment")
github_dependencies_for_deployment()

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

load("//github:dependencies.bzl", "tcnksm_ghr")
tcnksm_ghr()

git_repository(
name = "io_bazel_skydoc",
remote = "https://github.com/graknlabs/skydoc.git",
Expand Down Expand Up @@ -57,3 +57,9 @@ pip_import(
)
load("@graknlabs_bazel_distribution_pip//:requirements.bzl", graknlabs_bazel_distribution_pip_install = "pip_install")
graknlabs_bazel_distribution_pip_install()

load("//common:dependencies.bzl", "bazelbuild_rules_pkg")
bazelbuild_rules_pkg()

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
3 changes: 0 additions & 3 deletions apt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ bzl_library(
srcs = [
"rules.bzl"
],
deps = [
"//apt/pkg_deb_modified_from_bazel:lib"
],
visibility = ["//visibility:public"]
)

Expand Down
47 changes: 0 additions & 47 deletions apt/pkg_deb_modified_from_bazel/BUILD

This file was deleted.

Loading

0 comments on commit d4a7864

Please sign in to comment.