Skip to content

Commit

Permalink
Post tree-reorganization cleanup (#465)
Browse files Browse the repository at this point in the history
#443 reorganized the source tree: moving the WORKSPACE to the root of the
repository as is convention.  To help maintain backward compatibility, numerous
stub files were added to the root of the repository.

I noticed the following in local testing:

- The `install.bzl` stub is empty.
- The `mappings.bzl` stub is missing `REMOVE_BASE_DIRECTORY`
- The renaming of the `deps` value in the `pkg_install` macro confuses bazel; force it to use a rules_pkg-relative label instead (with the `Label` constructor) 

These slipped through the cracks in the review.  This change rectifies the above issues.
  • Loading branch information
Andrew Psaltis authored Nov 11, 2021
1 parent d54885c commit ce8c20a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions install.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2021 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load(
"//pkg:install.bzl",
_pkg_install = "pkg_install"
)

pkg_install = _pkg_install
3 changes: 3 additions & 0 deletions mappings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ load(
_pkg_mkdirs = "pkg_mkdirs",
_pkg_mklink = "pkg_mklink",
_strip_prefix = "strip_prefix",
_REMOVE_BASE_DIRECTORY = "REMOVE_BASE_DIRECTORY",
)

REMOVE_BASE_DIRECTORY = _REMOVE_BASE_DIRECTORY

filter_directory = _filter_directory

pkg_attributes = _pkg_attributes
Expand Down
2 changes: 1 addition & 1 deletion pkg/install.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def pkg_install(name, srcs, **kwargs):
name = name,
srcs = [":" + name + "_install_script"],
main = name + "_install_script.py",
deps = ["//pkg/private:manifest"],
deps = [Label("//pkg/private:manifest")],
srcs_version = "PY3",
python_version = "PY3",
**kwargs
Expand Down

0 comments on commit ce8c20a

Please sign in to comment.