# # 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. """Module to create or update sample toolchain.bazelrc file.""" import os from string import Template from util import get_git_root TPL = os.path.join(get_git_root(), "release", "toolchain.bazelrc.tpl") def update_toolchain_bazelrc_file(container_configs_list, bazel_version): """Creates/updates toolchain.bazelrc file. Example toolchain.bazelrc file can be found at configs/ubuntu16_04_clang/1.0/toolchain.bazelrc. There is one toolchain.bazelrc file per container per config version. If the file already exists in this repo, the script will delete it and generate new one. Args: container_configs_list: list of ContainerConfigs, the list of
import sys # Do not generate .pyc files. sys.dont_write_bytecode = True import bazelrc import cc.create_artifacts as cc_create import cc.execute_targets as cc_execute from config import ContainerConfigs import toolchain_flags from util import get_git_root CONFIG_TYPES = ["default", "msan"] # Define path constants. GIT_ROOT = get_git_root() def _get_container_configs_list(bazel_version): """Gets the list of container configs to generate. Args: bazel_version: string, the version of Bazel used to generate configs. Returns: A list of ContainerConfigs objects corresponding to the configs to generate. """ ubuntu16_04_clang_configs = ContainerConfigs( distro="ubuntu16_04", version="1.2",