bazel :Output Directory Layout

Output Directory Layout

This page covers requirements and layout for output directories.

Requirements for an output directory layout:

Doesn’t collide if multiple users are building on the same box.如果多个用户在同一个盒子上建造则不会发生冲突。

Supports building in multiple workspaces at the same time.支持同时在多个工作区中构建。
Supports building for multiple target configurations in the same workspace.支持在同一个工作区中构建多个目标配置。
Doesn’t collide with any other tools.
Is easy to access.
Is easy to clean, even selectively.
Is unambiguous, even if the user relies on symbolic links when changing into their client directory.是明确的,即使用户在切换到其客户端目录时依赖符号链接。
All the build state per user should be underneath one directory (“I’d like to clean all the .o files from all my clients.”)
每个用户的所有构建状态都应位于一个目录下(“我想清除所有客户端的所有 .o 文件。”)

Current layout

在这里插入图片描述
当前实施的解决方案:

  • 包含repo 边界文件的目录

    • 必须从包含 repo 边界文件的目录或其子目录调用 Bazel。换句话说,必须从存储库内部调用 Bazel。否则,会报告错误。
  • outputRoot 目录

    • 在 Linux 上 默认为 ${XDG_CACHE_HOME}/bazel(如果未设置 XDG_CACHE_HOME 环境变量,则为 ~/.cache/bazel),
    • 在 macOS 上为 /private/var/tmp
      /private/var/tmp
  • outputUserRoot 目录

    • Bazel 用户的构建状态位于 outputRoot/_bazel_$USER 下方。这称为 outputUserRoot 目录。
      /private/var/tmp/_bazel_jack/
  • installBase 目录

    • outputUserRoot 目录下有一个 install 目录,其中有一个 installBase 目录,其名称是 Bazel 安装清单的 MD5 哈希值。/private/var/tmp/_bazel_jack/install/407b1ab4400596af2aee426156d1f82d
  • outputBase 目录

    • 在 outputUserRoot 目录下,还会创建一个 outputBase 目录,其名称是工作区根目录路径名的 MD5 哈希值。因此,例如,如果 Bazel 在工作区根目录 /home/user/src/my-project(或在与该目录符号链接的目录中)中运行,则会创建一个名为:/home/user/.cache/bazel/_bazel_user/d41a31ac2e17db9f7c57cb77e1261555 的输出基目录。您还可以在工作区根目录中运行 echo -n $(pwd) | md5sum 来获取 MD5。
      /private/var/tmp/_bazel_jack/d41a31ac2e17db9f7c57cb77e1261555

    • 您可以使用 Bazel 的 --output_base 启动选项覆盖默认的输出基目录。例如,bazel --output_base=/tmp/bazel/output build x/y:z。

  • the default install base and output base directories

    • 您还可以使用 Bazel 的 --output_user_root 启动选项来覆盖默认安装基目录和输出基目录 install base and output base directories。例如:bazel --output_user_root=/tmp/bazel build x/y:z。

The symlinks for “bazel-”, “bazel-out”, “bazel-testlogs”, and “bazel-bin” are put in the workspace directory; these symlinks point to some directories inside a target-specific directory inside the output directory. (Output Directory Layout)These symlinks are only for the user’s convenience, as Bazel itself does not use them. Also, this is done only if the workspace root is writable.“bazel-”、“bazel-out”、“bazel-testlogs”和“bazel-bin”的符号链接放在工作区目录中;这些符号链接指向输出目录中特定于目标的目录中的某些目录。这些符号链接只是为了方便用户,因为 Bazel 本身并不使用它们。此外,只有当工作区根目录可写时才会这样做。
在这里插入图片描述

Layout diagram

The directories are laid out as follows:目录布局如下:

<workspace-name>/                         <== The workspace root
  bazel-my-project => <..._main>          <== Symlink to execRoot
  bazel-out => <...bazel-out>             <== Convenience symlink to outputPath
  bazel-bin => <...bin>                   <== Convenience symlink to most recent written bin dir $(BINDIR)
  bazel-testlogs => <...testlogs>         <== Convenience symlink to the test logs directory

/home/user/.cache/bazel/                  <== Root for all Bazel output on a machine: outputRoot
  _bazel_$USER/                           <== Top level directory for a given user depends on the user name:
                                              outputUserRoot
    install/
      fba9a2c87ee9589d72889caf082f1029/   <== Hash of the Bazel install manifest: installBase
        _embedded_binaries/               <== Contains binaries and scripts unpacked from the data section of
                                              the bazel executable on first run (such as helper scripts and the
                                              main Java file BazelServer_deploy.jar)包含首次运行时从 bazel 可执行文件的数据部分解压的二进制文件和脚本(例如辅助脚本和主 Java 文件 BazelServer_deploy.jar)
    7ffd56a6e4cb724ea575aba15733d113/     <== Hash of the client's workspace root (such as
                                              /home/user/src/my-project): outputBase
      action_cache/                       <== Action cache directory hierarchy
                                              This contains the persistent record of the file
                                              metadata (timestamps, and perhaps eventually also MD5
                                              sums) used by the FilesystemValueChecker.操作缓存目录层次结构,这包含 FilesystemValueChecker 使用的文件元数据(时间戳,可能最终还有 MD5总和持久记录。
      command.log                         <== A copy of the stdout/stderr output from the most
                                              recent bazel command.
      external/                           <== The directory that remote repositories are
                                              downloaded/symlinked into.远程存储库下载/符号链接到的目录。
      server/                             <== The Bazel server puts all server-related files (such
                                              as socket file, logs, etc) here.
        jvm.out                           <== The debugging output for the server.
      execroot/                           <== The working directory for all actions. For special
                                              cases such as sandboxing and remote execution, the
                                              actions run in a directory that mimics execroot.所有操作的工作目录。对于沙盒和远程执行等特殊情况,操作将在模拟 execroot 的目录中运行。
                                              Implementation details, such as where the directories
                                              are created, are intentionally hidden from the action.
                                              Every action can access its inputs and outputs relative
                                              to the execroot directory.
        _main/                            <== Working tree for the Bazel build & root of symlink forest: execRootBazel ,构建的工作树和符号链接林的根:execRoot
          _bin/                           <== Helper tools are linked from or copied to here.

          bazel-out/                      <== All actual output of the build is under here: outputPath
            _tmp/actions/                 <== Action output directory. This contains a file with the
                                              stdout/stderr for every action from the most recent
                                              bazel run that produced output.
            local_linux-fastbuild/        <== one subdirectory per unique target BuildConfiguration instance;
                                              this is currently encoded
              bin/                        <== Bazel outputs binaries for target configuration here: $(BINDIR)
                foo/bar/_objs/baz/        <== Object files for a cc_* rule named //foo/bar:baz
                  foo/bar/baz1.o          <== Object files from source //foo/bar:baz1.cc
                  other_package/other.o   <== Object files from source //other_package:other.cc
                foo/bar/baz               <== foo/bar/baz might be the artifact generated by a cc_binary named
                                              //foo/bar:baz
                foo/bar/baz.runfiles/     <== The runfiles symlink farm for the //foo/bar:baz executable. ,//foo/bar:baz 可执行文件的运行文件符号链接场。
                  MANIFEST
                  _main/
                    ...
              genfiles/                   <== Bazel puts generated source for the target configuration here:
                                              $(GENDIR)
                foo/bar.h                     such as foo/bar.h might be a headerfile generated by //foo:bargen
              testlogs/                   <== Bazel internal test runner puts test log files here
                foo/bartest.log               such as foo/bar.log might be an output of the //foo:bartest test with
                foo/bartest.status            foo/bartest.status containing exit status of the test (such as
                                              PASSED or FAILED (Exit 1), etc)
              include/                    <== a tree with include symlinks, generated as needed. The
                                              bazel-include symlinks point to here. This is used for
                                              linkstamp stuff, etc.
            host/                         <== BuildConfiguration for build host (user's workstation), for
                                              building prerequisite tools, that will be used in later stages
                                              of the build (ex: Protocol Compiler)
        <packages>/                       <== Packages referenced in the build appear as if under a regular workspace
       

在这里插入图片描述

https://bazel.build/rules/lib/builtins/runfiles
A container of information regarding a set of files required at runtime execution. This object should be passed via DefaultInfo in order to tell the build system about the runfiles needed by the outputs produced by the rule.
运行时执行所需的一组文件信息的容器。此对象应通过DefaultInfo传递,以便告知构建系统规则生成的输出所需的运行文件。

bazel clean

bazel clean does an rm -rf on the outputPath and the action_cache directory. It also removes the workspace symlinks. The --expunge option will clean the entire outputBase.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/736876.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

视频监控平台:支持交通部行业标准JT/T905协议(即:出租汽车服务管理信息系统)的源代码的函数和功能介绍及分享

目录 一、视频监控平台介绍 &#xff08;一&#xff09;概述 &#xff08;二&#xff09;视频接入能力介绍 &#xff08;三&#xff09;功能介绍 二、JT/T905协议介绍 &#xff08;一&#xff09;概述 &#xff08;二&#xff09;主要内容 1、设备要求 2、业务功能要求…

【ajax实战01】数据管理网站总述

一&#xff1a;功能实现 登录和权限判断查看文章内容列表&#xff08;筛选和分页&#xff09;编辑文章&#xff08;数据回显&#xff09;删除文章发布文章&#xff08;图片上传&#xff0c;富文本编辑器&#xff09; 该网站最终实现&#xff1a;登录后台管理系统&#xff0c;…

理解 什么是 滚动更新,蓝绿部署,灰度发布 以及它们的区别

滚动更新&#xff0c;蓝绿部署&#xff0c;灰度发布 这3种 现代化的 发布模式相信很多人都听过&#xff0c; 但是并不是都能正确理解他们的作用和区别 滚动更新 Rolling Update 所谓滚动更新是for 那些多实例的service的。 假如1个 service 有n 个instance, 更新时并不是n 个…

鸿蒙开发系统基础能力:【@ohos.faultLogger (故障日志获取)】

故障日志获取 说明&#xff1a; 本模块首批接口从API version 8开始支持。后续版本的新增接口&#xff0c;采用上角标单独标记接口的起始版本。 导入模块 import faultLogger from ohos.faultLoggerFaultType 故障类型枚举。 系统能力&#xff1a; 以下各项对应的系统能力…

【Python/Pytorch 】-- SVM算法

文章目录 文章目录 00 写在前面01 SVM算法简介02 SVM算法的基本原理线性SVM非线性SVM 03 基于Python 版本的SVM算法04 优化目标表达式理解&#xff1a;05 约束条件表达式理解 00 写在前面 SVM算法可以结合鲸鱼算法、飞蛾扑火算法、粒子群算法、灰狼算法、蝙蝠算法等等各种优化…

预训练是什么?

预训练是什么&#xff1f; 图像领域的预训练 在介绍图像领域的预训练之前&#xff0c;我们首先介绍下卷积神经网络&#xff08;CNN&#xff09;&#xff0c;CNN 一般用于图片分类任务&#xff0c;并且CNN 由多个层级结构组成&#xff0c;不同层学到的图像特征也不同&#xff…

qt 5.6 qmake手册

qt 5.6 qmake手册 &#xff08;笔者翻译的qmake手册&#xff0c;多数是机翻&#xff0c;欢迎评论区纠错修正&#xff09; Qmake工具有助于简化跨不同平台开发项目的构建过程。它自动生成Makefile&#xff0c;因此创建每个Makefile只需要几行信息。您可以将qmake用于任何软件项目…

细粒度图像分类论文阅读笔记

细粒度图像分类论文阅读笔记 摘要Abstract1. 用于细粒度图像分类的聚合注意力模块1.1 文献摘要1.2 研究背景1.3 本文创新点1.4 计算机视觉中的注意力机制1.5 模型方法1.5.1 聚合注意力模块1.5.2 通道注意力模块通道注意力代码实现 1.5.3 空间注意力模块空间注意力代码实现 1.5.…

20240624 每日AI必读资讯

&#x1f916;AI学会篡改奖励函数、欺骗研究者&#xff01;Claude团队&#xff1a;无法根除的行为&#xff0c;令人不安 - 实验中让AI可以访问自己的强化学习代码&#xff0c;并且提问&#xff1a;目前为止&#xff0c;我们总共进行了几轮强化学习&#xff1f;AI在自以为不会被…

三十八篇:架构大师之路:探索软件设计的无限可能

架构大师之路&#xff1a;探索软件设计的无限可能 1. 引言&#xff1a;架构的艺术与科学 在软件工程的广阔天地中&#xff0c;系统架构不仅是设计的骨架&#xff0c;更是灵魂所在。它如同建筑师手中的蓝图&#xff0c;决定了系统的结构、性能、可维护性以及未来的扩展性。本节…

测试测量-DMM直流精度

测试测量-DMM直流精度 最近去面试&#xff0c;发现了自己许多不足&#xff0c;比如我从未考虑过万用表准或者不准&#xff0c;或者万用表有多准&#xff1f; 在过去的实验室中&#xff0c;常用的DMM有KEYSIGHT 34401A以及 KEITHLEY THD2015&#xff0c;就以这两台为例&#x…

Typora + Hexo 图片路径问题(Typedown)

文章目录 1. 冲突来源2. 解决思路3. 实现1. typora图片路径2. hexo脚本 1. 冲突来源 Hexo上对于图片在md中的引用&#xff0c;使用了post_asset_folder: true配置&#xff0c;来更好的管理图片。 当一篇名为xxx.md的文章引用1.png图片时&#xff0c;默认让1.png保持在xxx文件夹…

eNSP启动设备失败,错误代码40,网卡配置正常,虚拟机导致的错误解决过程

安装eNSP后出现以下错误。 按照帮助文档&#xff0c;查看了相关软件&#xff0c;尤其是vitualbox的版本以及网卡问题。网卡设置正常&#xff0c;vitualbox也匹配成功。 附&#xff1a;vitualbox各个版本的下载地址&#xff1a; 关于网卡名称的修改方法&#xff0c;参照博客 …

【驱动篇】龙芯LS2K0300之单总线驱动

实验过程 实验目的&#xff1a; 在龙芯开发板上面使用单总线驱动DS18B20温度传感器 ① 根据原理图连接DS18B20模块 ② 将i2c0引脚的功能复用为GPIO ③ 注册字符设备&#xff0c;按照DS18B20的读写时序编写读写驱动接口 ④ 编写测试用例解析传感器的数值 原理图 将板子上…

【chatgpt】train_split_test的random_state

在使用train_test_split函数划分数据集时&#xff0c;random_state参数用于控制随机数生成器的种子&#xff0c;以确保划分结果的可重复性。这样&#xff0c;无论你运行多少次代码&#xff0c;只要使用相同的random_state值&#xff0c;得到的训练集和测试集划分就会是一样的。…

Linux_软硬链接

目录 1、软链接 2、软链接的使用方式 3、软链接的删除 4、硬链接 5、硬链接的使用方式 6、软硬链接的使用场景 7、软硬链接的区别 结语 前言&#xff1a; 在Linux操作系统中&#xff0c;有软链接和硬链接&#xff0c;他们是一种特殊的文件引用&#xff0c;主要用于与…

破碎的像素地牢探险:游戏分享

软件介绍 《破碎的像素地牢》是开源一款地牢冒险探索类的游戏&#xff0c;融合了日系RPG经典风格&#xff0c;玩家将控制主角进行未知场景的探索。除了经典地牢玩法外&#xff0c;游戏还添加了更多创意内容&#xff0c;如黑屏状态前的挑战性等&#xff0c;使得游戏更加富有挑战…

git 初基本使用-----------笔记

Git命令 下载git 打开Git官网&#xff08;git-scm.com&#xff09;&#xff0c;根据自己电脑的操作系统选择相应的Git版本&#xff0c;点击“Download”。 基本的git命令使用 可以在项目文件下右击“Git Bash Here” &#xff0c;也可以命令终端下cd到指定目录执行初始化命令…

【React】登录-封装Token的存取删方法--共享复用

在token.js中 // 封装存取方法const TOKENKEY token_keyfunction setToken (token) {return localStorage.setItem(TOKENKEY, token) }function getToken () {return localStorage.getItem(TOKENKEY) }function clearToken () {return localStorage.removeItem(TOKENKEY) }ex…

springboot3多模块实践

先帖下目录结构&#xff0c;直接在idea里面新建就行&#xff0c;删掉多余的文件 子模块的新建 根目录pom文件&#xff0c;注意modules、packaging&#xff0c;dependencyManagement统一管理依赖&#xff0c;子模块添加依赖的时候就不用加版本号 <?xml version"1.0…