commit | 63605576dd9a3643eb77053388e94f2dcd0c58b4 | [log] [tgz] |
---|---|---|
author | Jingwen Chen <jingwen@google.com> | Thu Feb 13 13:47:00 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Feb 13 13:48:00 2020 -0800 |
tree | 4f9b7057a95eed0de572c021978891efdd6d1738 | |
parent | e860453a7be19cc557d02b4edec13819358945fe [diff] |
Support sibling repository execution root layout. Enable building and depending on targets in subpackages of //external. Closes #10604. 1) Added --experimental_sibling_repository_layout starlark semantics flag 2) When enabled, the flag changes the execution root of external repository source artifacts (non-default/main repository) from <execroot cwd>/external/reponame to <execroot cwd>/../reponame. Therefore, this allows plantSymlinkForest to plant the "external" top level directory in the execution root, like any other top level source directory in the main repository. 3) The artifact roots (and therefore root relative path) of external repos' source artifacts are left unchanged. This enables RepositoryName#getRunfilesPath and RepositoryName#getSourceRoot to remain unchanged. Thus we only needed to thread StarlarkSemantics#experimentalAllowExternalDirectory from BazelRepositoryModule / ruleContext to callsites of RepositoryName#getExecPath(boolean allowExternalRepository). This took a while because I had to revert some changes in order to make the other changes less intrusive. Specifically, for external source artifacts, rosica's change set output_base/external as a source root, instead output_base. This causes all external source artifact's rootRelativePath to drop "external" as a prefix. By retaining the output_base source root, I was able to undo a lot of the intrusive changes. Another caveat: this change currently clobbers output artifacts from external repositories and subpackages of //external in the same derived output root (bazel-bin/external). This will be a problem if external repository names conflicts with directory names in the top-level external directory. We'll probably have to draft up a design following this change. PiperOrigin-RevId: 294991422
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md