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 rootbazel-my-project => <..._main>          <== Symlink to execRootbazel-out => <...bazel-out>             <== Convenience symlink to outputPathbazel-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:outputUserRootinstall/fba9a2c87ee9589d72889caf082f1029/   <== Hash of the Bazel install manifest: installBase_embedded_binaries/               <== Contains binaries and scripts unpacked from the data section ofthe bazel executable on first run (such as helper scripts and themain 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): outputBaseaction_cache/                       <== Action cache directory hierarchyThis contains the persistent record of the filemetadata (timestamps, and perhaps eventually also MD5sums) used by the FilesystemValueChecker.操作缓存目录层次结构,这包含 FilesystemValueChecker 使用的文件元数据(时间戳,可能最终还有 MD5总和持久记录。command.log                         <== A copy of the stdout/stderr output from the mostrecent bazel command.external/                           <== The directory that remote repositories aredownloaded/symlinked into.远程存储库下载/符号链接到的目录。server/                             <== The Bazel server puts all server-related files (suchas socket file, logs, etc) here.jvm.out                           <== The debugging output for the server.execroot/                           <== The working directory for all actions. For specialcases such as sandboxing and remote execution, theactions run in a directory that mimics execroot.所有操作的工作目录。对于沙盒和远程执行等特殊情况,操作将在模拟 execroot 的目录中运行。Implementation details, such as where the directoriesare created, are intentionally hidden from the action.Every action can access its inputs and outputs relativeto 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 thestdout/stderr for every action from the most recentbazel run that produced output.local_linux-fastbuild/        <== one subdirectory per unique target BuildConfiguration instance;this is currently encodedbin/                        <== Bazel outputs binaries for target configuration here: $(BINDIR)foo/bar/_objs/baz/        <== Object files for a cc_* rule named //foo/bar:bazfoo/bar/baz1.o          <== Object files from source //foo/bar:baz1.ccother_package/other.o   <== Object files from source //other_package:other.ccfoo/bar/baz               <== foo/bar/baz might be the artifact generated by a cc_binary named//foo/bar:bazfoo/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:bargentestlogs/                   <== Bazel internal test runner puts test log files herefoo/bartest.log               such as foo/bar.log might be an output of the //foo:bartest test withfoo/bartest.status            foo/bartest.status containing exit status of the test (such asPASSED or FAILED (Exit 1), etc)include/                    <== a tree with include symlinks, generated as needed. Thebazel-include symlinks point to here. This is used forlinkstamp stuff, etc.host/                         <== BuildConfiguration for build host (user's workstation), forbuilding prerequisite tools, that will be used in later stagesof 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.mzph.cn/news/858148.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何开发一个项目脚手架cli

目录 背景正文unbuildpromptsprogresskolorist 设置打包命令npm execnpxnpm init/ npm create/ npm innit 使用最后 背景 随着团队项目类型越来越多&#xff0c;方便后续快速去开发项目&#xff0c;会出现各种类型的项目模版项目。 这样开发只需要通过脚手架选择自己需要的项目…

示例:推荐一个自定义的Ribbon皮肤

一、目的&#xff1a;WPF自带的Ribbon控件功能很强大&#xff0c;但使用过程中感觉显示的样式不是很好&#xff0c;或者不适合自己的项目&#xff0c;下面介绍一个基于自带Ribbon控件样式的修改&#xff0c;主要修改了些高度&#xff0c;间距&#xff0c;背景色&#xff0c;前景…

【漏洞复现】AJ-Report开源数据大屏 verification;swagger-ui RCE漏洞

0x01 产品简介 AJ-Report是一个完全开源的B平台&#xff0c;酷炫大屏展示&#xff0c;能随时随地掌控业务动态&#xff0c;让每个决策都有数据支撑。多数据源支持&#xff0c;内置mysql、elasticsearch、kudu等多种驱动&#xff0c;支持自定义数据集省去数据接口开发&#xff…

什么是APP分发-了解APP分发的核心概念

APP分发的定义和意义 大家有没有过这样的经历&#xff1a;辛辛苦苦开发了一款APP&#xff0c;却不知道该怎么让更多人知道和使用&#xff1f;APP分发的重要性就凸显出来了。APP分发就是将你的应用推送到不同的应用市场和平台&#xff0c;让更多用户能够下载和使用。 小猪app封…

Python的pip切换国内源

&#x1f4da;目录 起因&#xff1a;pip切换国内源&#xff1a;操作永久修改pip配置文件测试永久源配置是否成功 pip其他环境的配置永久源配置 起因&#xff1a; pyCharm安装模块的手出现ModuleNotFoundError: No module named distutils 由于使用pip install distutils下载不了…

[图解]建模相关的基础知识-16

1 00:00:00,350 --> 00:00:04,130 刚才那个&#xff0c;就相当于&#xff0c;12这个我们可以认为是什么 2 00:00:05,020 --> 00:00:11,360 我们用类图来表达就是&#xff0c;员工、电话 3 00:00:13,320 --> 00:00:15,080 多个 4 00:00:15,090 --> 00:00:16,440 …

Python与Java实现SM2互调

文章目录 一、项目背景二、环境极其依赖三、具体功能1.Python生成密钥对2.java生成密钥对3.Python加签验签4.java加签验签 四、遇到的问题五、解决方案 一、项目背景 Python对接Java接口互相SM2加签验签 二、环境极其依赖 python环境 pip3 install gmssljava环境 <depen…

100多个ChatGPT指令提示词分享

当前&#xff0c;ChatGPT几乎已经占领了整个互联网。全球范围内成千上万的用户正使用这款人工智能驱动的聊天机器人来满足各种需求。然而&#xff0c;并不是每个人都知道如何充分有效地利用ChatGPT的潜力。其实有许多令人惊叹的ChatGPT指令提示词&#xff0c;可以提升您与ChatG…

智能优化算法改进策略之局部搜索算子(七)--自适应模式搜索法

1、原理介绍 模式搜索法[1]是Hooke与Jeeves提出的一种直接搜索算法&#xff0c;其目的是通过比较目标函数在有限点集中的函数值来优化目标函数。更重要的是&#xff0c;它不仅不使用任何导数知识&#xff0c;而且不需要隐式地建立任何一种导数近似。 在这种直接搜索技术中&…

【大数据 复习】第3章 分布式文件系统HDFS(重中之重)

一、概念 1.分布式文件系统把文件分布存储到多个计算机节点上&#xff0c;通过网络实现、文件在多台主机上进行分布式存储的文件系统。&#xff08;就是你的电脑存a&#xff0c;我的电脑存pple&#xff09; 2.降低了硬件开销: 与之前使用多个处理器和专用高级硬件的并行化处理装…

pytest测试框架flaky插件重试失败用例

Pytest提供了丰富的插件来扩展其功能&#xff0c;本章介绍下插件flaky &#xff0c;用于在测试用例失败时自动重新运行这些测试用例。与前面文章介绍的插件pytest-rerunfailures功能有些类似&#xff0c;但是功能上不如pytest-rerunfailures插件丰富。 flaky官方并没有明确pyt…

git stash Pop 后丢失,要如何找回?

文章目录 须知背景描述解决过程 须知 写在前面&#xff1a;我们都知道 stash list 中如果 pop 出来一条&#xff0c;那 list 里就会少一条&#xff0c;但其实使用 git stash pop 并没有真正地将该条 stash 删掉的&#xff0c;而是删除引用而已&#xff0c;因此当我们误 pop 时…

AI在软件开发中的应用

AI在软件开发中的应用可以帮助开发人员更高效地编写和测试代码&#xff0c;并提高软件的质量和性能。它能够帮助加快软件的部署和维护过程&#xff0c;提供更好的开发体验。 编码辅助 帮助开发人员更快地编写代码。例如&#xff0c;AI可以识别代码中的语法错误&#xff0c;并提…

WSL+Anconda(pytorch深度学习)环境配置

动机 最近在读point cloud相关论文&#xff0c;准备拉github上相应的code跑一下&#xff0c;但是之前没有深度学习的经验&#xff0c;在配置环境方面踩了超级多的坑&#xff0c;依次来记录一下。 一开始我直接将code拉到了windows本地来运行&#xff0c;遇到了数不清的问题&a…

LoRaWAN网关源代码分析(基础概念篇)

目录 一、简介 1、lora_gateway 2、packet_forwarder 二、目录结构 1、lora_gateway 2、packet_forwarder 一、简介 LoRaWAN网关的实现主要依赖两个源代码&#xff1a;lora_gateway和packet_forwarder。接下来&#xff0c;我们将从分析源代码入手&#xff0c;移植LoRaWAN源…

ThinkPHP:查询数据库数据之后,更改查询数据的字段名称

一、原始查询数据 含有字段item_no&#xff0c;lot_num&#xff0c;position $data[brushed] db::table(wip_station_transaction) ->where([wip_entity_name>$wip_entity_name,line_code>$line_code,]) ->field([item_no, lot_num, position]) ->select(); …

DAC测试实验——FPGA学习笔记7

一、DAC简介 DAC全称Digital to Analog Converter&#xff0c;即数模转换器。它用于将主控芯片产生的数字值(0和1)转换为模拟值(电压值)。 1、DAC参数指标 2、DAC类型 常用的DAC可大致分为权电阻网络DAC、T型电阻网络DAC、倒T型电阻网络DAC以及权电流型DAC。 3、AD9708/3PD9…

Linux - 记一次某Java程序启动报错(申请内存失败)

文章目录 问题可能原因分析可能原因分析尝试各种解决方案尝试解决过程 解决办法&#xff1a; 调整 overcommit_meory参数overcommit_memory详解什么是 overcommit_memory&#xff1f;overcommit_memory 的选项及其含义配置 overcommit_memory查看当前设置设置 overcommit_memor…

github-chinese,跟英文GitHub说拜拜

背景 对于我们程序员来说,Github是一个常逛的web网站,里面学习资源众多,不管是查问题还是查资料都离不开他。 但是Github作为一个国际化的网站,语言主要是英语,所以对于一些英语似懂非懂的同学来说还是有一些难处。 想过找一个国内中文的Github作为一个平替网站,但是资…

访问网站时IP被屏蔽是什么原因?

在互联网使用中&#xff0c;有时我们可能会遇到访问某个网站时IP地址被屏蔽的情况。IP地址被网站屏蔽是一个相对常见的现象&#xff0c;而导致这种情况的原因多种多样&#xff0c;包括恶意行为、违规访问等。本文将解释IP地址被网站屏蔽的常见原因&#xff0c;同时&#xff0c;…