All Projects → cgbystrom → real-world-bazel

cgbystrom / real-world-bazel

Licence: other
Bazel build files collected from real-world GitHub projects

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to real-world-bazel

Bazel Remote
A remote cache for Bazel
Stars: ✭ 260 (+983.33%)
Mutual labels:  build, bazel
airin
A framework for automated migration of your projects to Bazel build system.
Stars: ✭ 21 (-12.5%)
Mutual labels:  build, bazel
bzl
Bzl - Integrated CLI + UI + VSCode Extension for Bazel
Stars: ✭ 43 (+79.17%)
Mutual labels:  build, bazel
Angular Bazel Example
MOVED to the bazel nodejs monorepo 👉
Stars: ✭ 354 (+1375%)
Mutual labels:  build, bazel
Please
High-performance extensible build system for reproducible multi-language builds.
Stars: ✭ 1,856 (+7633.33%)
Mutual labels:  build, bazel
Bazel Watcher
Tools for building Bazel targets when source files change.
Stars: ✭ 245 (+920.83%)
Mutual labels:  build, bazel
Bazel
a fast, scalable, multi-language and extensible build system
Stars: ✭ 17,790 (+74025%)
Mutual labels:  build, bazel
Awesome Bazel
A curated list of Bazel rules, tooling and resources.
Stars: ✭ 640 (+2566.67%)
Mutual labels:  build, bazel
Tutorial Ubuntu 18.04 Install Nvidia Driver And Cuda And Cudnn And Build Tensorflow For Gpu
Ubuntu 18.04 How to install Nvidia driver + CUDA + CUDNN + build tensorflow for gpu step by step command line
Stars: ✭ 91 (+279.17%)
Mutual labels:  build, bazel
Buildbuddy
BuildBuddy is an open source Bazel build event viewer, result store, and remote cache.
Stars: ✭ 182 (+658.33%)
Mutual labels:  build, bazel
Tensorflow-binaries
Tensorflow GNU/Linux, MacOS binaries compiled with SSE4.1, SSE4.2 and AVX
Stars: ✭ 14 (-41.67%)
Mutual labels:  build, bazel
drevops
💧 + 🐳 + ✓✓✓ + 🤖 + ❤️ Build, Test, Deploy scripts for Drupal using Docker and CI/CD
Stars: ✭ 55 (+129.17%)
Mutual labels:  build
zig-header-gen
Automatically generate headers/bindings for other languages from Zig code
Stars: ✭ 40 (+66.67%)
Mutual labels:  build
eslint4b
ESLint which works in browsers.
Stars: ✭ 33 (+37.5%)
Mutual labels:  build
pexample
Building and packaging Python with Pants and PEX - an annotated example
Stars: ✭ 21 (-12.5%)
Mutual labels:  build
freedom-middleware-webpack2
webpack2前端项目开发构建中间件,方便统一管理前端项目中95%以上的构建工作
Stars: ✭ 35 (+45.83%)
Mutual labels:  build
migration-tooling
Migration tools for Bazel
Stars: ✭ 40 (+66.67%)
Mutual labels:  bazel
Carbon.Gulp
Carbon/Gulp is a delicious blend of tasks and build tools poured into Gulp to form a full-featured modern asset pipeline for Flow Framework and Neos CMS.
Stars: ✭ 15 (-37.5%)
Mutual labels:  build
AzDo.VstsDashboard
Provide a simple way to view all Builds and Releases on a single page. The intend was to see what's currently happened into the CI/CD pipeline and provide quick feedback of what's going on.
Stars: ✭ 16 (-33.33%)
Mutual labels:  build
sp-build-tasks
👷 SharePoint front-end projects automation and tasks tool-belt
Stars: ✭ 15 (-37.5%)
Mutual labels:  build

Real-world Bazel

Bazel build files collected from real-world GitHub projects. Makes finding examples and inspiration of build rule usage much easier!

Using

  1. Clone repo and make sure Python is installed
  2. Run pip install -r requirements.txt, preferably inside a virtualenv
  3. Run python download.py. This will download into the work directory. Expect 30+ mins of runtime.
  4. Browse the downloaded BUILD and *.bzl files and learn something new! 🎓 💡

Rationale

For anyone outside Google, Bazel is quite a new build tool. It was open-sourced in 2015 and has since gained more and more traction. But being a new tool also means documentation, best practices and examples are not as easy to come by compared to other, more established build tools.

One of the things I've found most helpful in learning Bazel has been looking at other real-world usages of it. Either by googling or searching GitHub projects. This has been working okay-ish, but GitHub's code search can definitely be lacking at times when you just want to find that example snippet.

So instead of relying on their search I figured it would be much easier to just download every public, Bazel-based GitHub project out there. In that way, I could just grep and search for whatever build rule usage I wanted in mere seconds.

How this was collected

To actually find every Bazel based project on Github, first step would be to reliable detect Bazel usage. A very simple way of doing this is just checking for the presence of a WORKSPACE file in the root directory. While not 100% perfect, it's definitely good enough.

Second problem is scanning every repository for the presence of that file. Doing that through just brute force or GitHub search isn't feasible. Fortunately, Google offers the entire content of GitHub as a public dataset with BigQuery.

To find every GitHub project that contains a WORKSPACE file in the root, you can issue this query:

SELECT
  repo_name
FROM
  [bigquery-public-data:github_repos.files]
WHERE
  path == "WORKSPACE"
GROUP BY
  repo_name

Leaving you with a long list of repositories. And despite the amount of data scanned, the above query cost less than $1.

In addition of identifying Bazel based repos I also wanted the number of stars for each to help filter the list further. Since the size was quite manageable (less than 1000 repos) I just grabbed this from the public GitHub API with a script. To avoid forks and abandoned projects, any repo below 10 stars was filtered out*.

So armed with a list of repos and stars I put together another script for actually downloading every repo. It simply downloads and then removes any non-Bazel related files to keep the size down. After a good 45 minutes what is left are only Bazel BUILD files from every public GitHub project out there :)

*) I later learned you can collect this in BigQuery as well since they offer two datasets. Oh well, next time maybe!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].