See https://monorepo.tools for "What is a monorepo" & "Why a monorepo". And Why Google Stores Billions of Lines of Code in a Single Repository is also a good reading material.
This branch is built from the bottom to apply licenses. I'll migrate codes from the master branch in the future time.
The project only compiles on Ubuntu with LLVM 14 toolchain. There was too few time to make it works on other platforms.
N.B. it only works for people who are working with almost same environment as me or the CI pipeline agent if you are using my READ-ONLY API key.
If you need this feature, please make a bazel-remote service for yourself or leverage BuildBuddy.
echo "build:buildbuddy --remote_header=x-buildbuddy-api-key=keZr2WKcTginehDBB1D0" >> user.bazelrc
Bazel would download dependencies from internet on-the-fly. There's a prepared distdir package to avoid the extra downloading. See Bazel Distribution files directories for further details.
$ONE_DISTDIR
later).--distdir $ONE_DISTDIR
.Downloading with Azure CLI tool is harder. You need to generate a PAT from Azure Devops portal to continue.
# Enter your PAT here.
az devops login
# Query the latest succeeded run-id.
az pipelines runs list --organization "https://dev.azure.com/zhangshuai89/" --project "GitHub ADO" --pipeline-ids 14 --query "[?result=='succeeded'] | [0] | id"
# Fill the run id found in previous step.
az pipelines runs artifact download --artifact-name distdir --path distdir --run-id "<run-id>" --organization "https://dev.azure.com/zhangshuai89/" --project "GitHub ADO"
clang.bazelrc
tools/setup_clang.sh /usr/lib/llvm-14
bazel build --config=libc++ --config=buildbuddy //...
# clang-asan profile is broken now, use asan profile instead.
bazel test --config=clang-asan --config=buildbuddy //... --test_tag_filters=-benchmark
bazel test -c opt --config=libc++ --config=buildbuddy //... --test_tag_filters=benchmark
compile_commands.json
bazel run @hedron_compile_commands//:refresh_all -- --config=libc++
This method would be REMOVED if I found hedron's approach stable.
tools/bazel-compdb.py -s -q //... -- --config=libc++