tweag / skyscope

A tool for visualising and exploring Bazel Skyframe graphs.
MIT License
55 stars 7 forks source link

Support bazel development with skyscope #114

Closed matts1 closed 11 months ago

matts1 commented 11 months ago

Is your feature request related to a problem? Please describe. Bazel has a bazel-dev.sh script which essentially compiles bazel and then runs the dev version of bazel that you just built.

However, bazel version on a dev version is missing the "Build label" entry that skyscope attempts to parse for:

$ /usr/bin/bazel version
Build label: 6.4.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Oct 19 17:07:43 2023 (1697735263)
Build timestamp: 1697735263
Build timestamp as int: 1697735263
$ bazel-bin/src/bazel-dev version
Build target: bazel-out/k8-dbg/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0

I tried to get it working, but I was unable to compile skyscope at head for reasons I think relate to nix, so I couldn't implement the feature myself. It appeared to be permission issues that I'm guessing is related to the fact that this is a work machine with work policies on it, and compiling with sudo gave me a different error, so I gave up on it.

Describe the solution you'd like I would like to add two features to skyscope:

Describe alternatives you've considered A --bazel-version flag could also work

benradf commented 11 months ago

Thanks for opening this issue @matts1.

As requested, I've made Skyscope assume the latest version of Bazel if parsing bazel version fails. I've also added a new SKYSCOPE_BAZEL_BIN environment variable that you can use to specify a custom Bazel binary:

SKYSCOPE_BAZEL_BIN=/path/to/bazel-dev skyscope import

Update to v0.3.2 to try it out. Let me know if you have any problems.