如何在Bazel中配置工具链

时间:2019-04-27 03:11:23

标签: arm cross-compiling bazel toolchain

我们计划使用Bazel对不同的目标目标进行交叉编译,但会遇到有关工具链的一些问题:

根据docs,我们将工具链配置为:

toolchain_include_directories_feature = feature(
        name = "toolchain_include_directories",
        enabled = True,
        flag_sets = [
            flag_set(
                actions = [
                    "ACTION_NAMES.assemble",
                    "ACTION_NAMES.preprocess_assemble",
                    "ACTION_NAMES.linkstamp_compile",
                    "ACTION_NAMES.c_compile",
                    "ACTION_NAMES.cpp_compile",
                    "ACTION_NAMES.cpp_header_parsing",
                    "ACTION_NAMES.cpp_module_compile",
                    "ACTION_NAMES.cpp_module_codegen",
                    "ACTION_NAMES.lto_backend",
                    "ACTION_NAMES.clif_match",
                ],
                flag_groups = [
                    flag_group(
                        flags = [
                             "-isystem",
                             "/opt/buildtools/sdk/usr/include",
                        ],
                    ),
                ],
            ),
        ],
    )

我们得到了错误:

ERROR: /home/project/aa/BUILD:1:1: undeclared inclusion(s) in rule '//aa:mylib':
this rule is missing dependency declarations for the following files included by 'aa/source/export.c':
  '/opt/buildtools/sdk/usr/include/stdc-predef.h'

任何想法,谢谢。

已添加:环境信息

LSB Version:    n/a
Distributor ID: SUSE
Description:    SUSE Linux Enterprise Server 12 SP4
Release:        12.4
Codename:       n/a
4.12.14-94.41-default #1 SMP Wed Oct 31 12:25:04 UTC 2018 (3090901) x86_64 x86_64 x86_64 GNU/Linux

Bazel version: 0.24.1

2 个答案:

答案 0 :(得分:0)

当您使用from splinter import Browser import smtplib import os from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import time with Browser('chrome') as browser: # Visit URL url = "$some_url" browser.visit(url) if browser.is_text_present("All rights reserved."): # fill the user pass area on startpage browser.fill('usernameField', 'XXUSERNAME') browser.fill('passwordField', 'XXpassword') # find the submit button on the page and click it button = browser.find_by_id('SubmitButton') button.click() else: browser.quit() msg_text="""<p style="color:red;"><b> ERR1 </b></p>""" # print("Errtext") 创建工具链配置时,请不要忘记通过添加通常的包含路径来设置其create_cc_toolchain_config_info参数,例如

cxx_builtin_include_directories

答案 1 :(得分:0)

动作列表中的ACTION_NAMES也不应该用引号引起来。看到这个:https://github.com/bazelbuild/bazel/pull/7673