1# Copyright (C) 2023 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15"""List of clang versions supported by Kleaf. 16 17We can't use a glob expression because each directory is an actual bazel 18package. The glob expression is going to produce empty result, **unless** one 19delete `clang-*/BUILD.bazel`, OR use --delete_packages (except that 20--deleted_packages does not accept patterns, so we still need to provide a 21explicit list somewhere). 22 23The alternative solution is to create a workspace rule to read the directory. 24Caveat to this approach: 25- Need to hardcode the path `prebuilts/clang/host/linux-x86`, which has 26 adversary effect when using Kleaf as a subworkspace 27- Reading a directory can't be done with a shell command because one needs to 28 ensure hermeticity by hardcoding the path to `ls` 29- Reading the directory must be done with path.readdir. 30 31Such workspace rule is much more heavy-weighted than a simple array, hence we 32did not move forward with this approach unless it requires a lot of maintenance 33in the future. 34""" 35 36VERSIONS = [ 37 # keep sorted 38 "r522817", 39 "r530567", 40 "r536225", 41]