A collection of distorted Git mirrors
-
Have a Linux machine with Bazel installed
-
Start the server, passing a URL to a public GitHub repository:
bazel run //server:funhouse_server -- \ --grpc_port=8080 \ --base_path=/tmp/funhouse_data \ --repo_url=https://github.com/minorhacks/advent_2020 \ --alsologtostderr \ --v=1
-
Start the client, passing the address to the server, as well as the directory to mount to:
bazel run //client -- \ --mount_point=/tmp/funhouse \ --server_addr=localhost:8080 \ --insecure \ --alsologtostderr
-
List files in a particular commit:
ls -la /tmp/funhouse/commits/0802d5e6cee084a8f867c5406e46a3fca556bf4e
-
Run a build from a particular commit:
NOTE: Writes in-tree will fail with
EROFS
(read-only filesystem) so build tools must be configured to produce build artifacts out-of-tree# The example is a Rust repo, so with the proper Rust tooling installed: cd /tmp/funhouse/commits/0802d5e6cee084a8f867c5406e46a3fca556bf4e CARGO_TARGET_DIR=/tmp/rust_build_out cargo build
-
To unmount -
Ctrl-C
the client process.If you get an error like:
E0918 23:09:45.058320 3148580 main.go:72] Error while unmounting: /usr/bin/fusermount: failed to unmount /tmp/funhouse: Device or resource busy
make sure you
cd
out of the mounted directory in all open terminals.
-
Run
gazelle
:bazel run //:gazelle
-
Make updates to
go.mod
viago get
commands:go get -d golang.org/x/tools@v0.1.4
-
Run
gazelle
to generate Bazel imports fromgo.mod
:bazel run //:gazelle -- \ update-repos \ -from_file=go.mod \ -to_macro=third_party/go_deps.bzl%go_third_party_deps