-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move the rpmbuild toolchain definition to //toolchains/rpm. (#514)
* move the rpmbuild toolchain to toolchains/rpm * update CODEOWNERS
- Loading branch information
Showing
15 changed files
with
100 additions
and
86 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright 2020 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. | ||
|
||
"""toolchain to wrap an rpmbuild binary. | ||
Type: @rules_pkg//toolchains/rpm:rpmbuild_toolchain_type | ||
Toolchains: | ||
- rpmbuild_missing_toolchain: provides a fallback toolchain for exec plaforms | ||
where rpmbuild might not be available. | ||
- rpmbuild_auto_toolchain: a toolchain that uses the installed rpmbuild. See | ||
rpmbuild_configure.bzl%find_system_rpmbuild for usage. | ||
""" | ||
|
||
load("//toolchains/rpm:rpmbuild.bzl", "is_rpmbuild_available", "rpmbuild_toolchain") | ||
|
||
filegroup( | ||
name = "standard_package", | ||
srcs = glob([ | ||
"*", | ||
]), | ||
visibility = ["//distro:__pkg__"], | ||
) | ||
|
||
exports_files( | ||
glob(["*"]), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# Expose the availabilty of an actual rpmbuild as a config_setting, so we can | ||
# select() on it. | ||
config_setting( | ||
name = "have_rpmbuild", | ||
flag_values = { | ||
":is_rpmbuild_available": "1", | ||
}, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# Expose the availabilty of an actual rpmbuild as a feature flag, so we can | ||
# create a config_setting from it. | ||
is_rpmbuild_available( | ||
name = "is_rpmbuild_available", | ||
visibility = ["//:__subpackages__"], | ||
) | ||
|
||
toolchain_type( | ||
name = "rpmbuild_toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# rpmbuild_missing_toolchain provides a fallback toolchain so that toolchain | ||
# resolution can succeed even on platforms that do not have a working rpmbuild. | ||
# If this toolchain is selected, the constraint ":have_rpmbuild" will not be | ||
# satistifed. | ||
rpmbuild_toolchain( | ||
name = "no_rpmbuild", | ||
) | ||
|
||
toolchain( | ||
name = "rpmbuild_missing_toolchain", | ||
toolchain = ":no_rpmbuild", | ||
toolchain_type = ":rpmbuild_toolchain_type", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters