cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.6k stars 424 forks source link

Makefile: add gen-bazel target #3666

Closed RaduBerinde closed 6 days ago

RaduBerinde commented 2 weeks ago

This change adds a gen-bazel target which generates a WORKSPACE file and runs gazelle to generate BUILD.bazelfiles. Generating these files allows a local clone of the repository to be used directly when building Cockroach using the override_repository flag, for example:

./dev build short -- --override_repository=com_github_cockroachdb_pebble=~/go/src/github.com/cockroachdb/pebble

The new files are added to .gitignore so that generating them doesn't interfere with commits.

We also add a clean-bazel target that cleans up these files (useful when switching back to an older branch)

cockroach-teamcity commented 2 weeks ago

This change is Reviewable

RaduBerinde commented 1 week ago

I'm a little weary of having to run make gen-bazel every time some imports change.. I wonder if there's a better way.

RaduBerinde commented 1 week ago

I will try something a little different - instead of checking in the new files, I will add them to .gitignore and we can run make gen-bazel only when we need to use it as a dependency. That way generating the files won't interfere with the commits on that branch.

RaduBerinde commented 1 week ago

Updated to add just a new target and .gitignore the bazel files.

RaduBerinde commented 6 days ago

TFTRs!