-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Fix cquery based compatibility check.
Summary: Fixes cquery platform compatibility check to skip targets that are in host or exec configs. These targets were causing the incompatibility stuff to not work, because cquery would view the host config as compatible so they'd still end up in the list. I also realized that the extra bazel query is unnecessary, as cquery supports the same syntax. Test Plan: Tested with D12855, and saw that the incompatible targets don't show up in the list. Reviewers: vihang, zasgar Reviewed By: vihang Signed-off-by: James Bartlett <[email protected]> Differential Revision: https://phab.corp.pixielabs.ai/D12931 GitOrigin-RevId: fe118261921499ba7a6789134614f9454eab6df7
- Loading branch information
1 parent
0df6705
commit 62278c1
Showing
2 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
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,27 @@ | ||
# Copyright 2018- The Pixie Authors. | ||
# | ||
# 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
def format(target): | ||
build_opts = build_options(target) | ||
|
||
# We only want to get targets that are in the target configuration. So we ignore exec and host targets. | ||
if build_opts["//command_line_option:is exec configuration"] or build_opts["//command_line_option:is host configuration"]: | ||
return None | ||
|
||
# Ignore targets that are incompatible with the target configuration. | ||
if providers(target) and "IncompatiblePlatformProvider" in providers(target): | ||
return None | ||
return target.label |