focus
is a tool to manage Git sparse checkouts derived from the Bazel build graph.
focus
is written in Rust and supports macOS and Linux. Git v2.35+ and Bazel need to be installed in the PATH env. General
Warning: If you run a cargo test
you may run out of file descriptors. On MacOS you will need to use ulimit -n X
to set a large file limit for the current shell. On macOS Big Sur, you can write a plist to do this permanently:
Write the following to a file named /Library/LaunchDaemons/limit.maxfiles.plist
(hint: you'll need to invoke your editor with sudo
because this file is protected):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>sudo</string>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>655360</string>
<string>1048576</string>
</array>
<key>RunAtLoad</key>
<true />
</dict>
</plist>
then load it with sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
. This seems to work better if you restart your Mac.
Note: these instructions are from a GitHub issue gradle/gradle#17274. Thanks to those folks.
Install Git: Git 2.35+: get this through your distro's package manager or download pre-built binaries or sources here.
Install Bazel: You'll need Bazel installed. See these instructions for details on how to install on mainstream Linux distros. Alternative distros probably have a reasonable Bazel package available by now.
Install Rust, then install focus
with
$ cargo install --locked --git https://github.com/twitter/focus
If you are the repository administrator, first configure focus
for your repo using the Administration instructions.
For end-users, see Usage for instructions on how to use focus
to manage your sparse checkouts.
For new or curious users, see Bazel Tutorial for instructions on how to try focus
on the bazel repository itself.
See various design documents at https://github.com/twitter/focus/tree/main/focus/doc. Focus was presented at Git Merge 2022; see the slides here.