Building Skia Debugger Locally with Buildbot

75 views
Skip to first unread message

Dominic

unread,
May 27, 2024, 10:56:32 AMMay 27
to skia-discuss
I've spent a ton of time trying to get Skia Debugger to build locally. I've read through the instructions countless times and still can't get it to work. I also can't seem to find any working examples.

I am currently using a Mac. I tried using Docker to build the Linux version as well but that isn't working either. Any help would be appreciated.

John Stiles

unread,
May 27, 2024, 11:00:21 AMMay 27
to skia-d...@googlegroups.com
Could you please be more specific about what sorts of issues you are encountering? It is hard to know where to start diagnosing remotely from "I can't get it to work." Thanks :)

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/3fa73a47-7d86-4427-9d86-fd0dc053e70fn%40googlegroups.com.

Dominic

unread,
May 28, 2024, 9:24:40 AMMay 28
to skia-discuss
Thanks for answering so quickly. I've tried/failed with several approaches, but here is the first one. I'm very new to Bazel and C++ in general, but I think my primary issue is I have no clue how to setup a macOS toolchain for Bazxel. I will also post the docker errors in a second.

For installing natively on my mac:

```shell
# Go to the skia directory
cd $SKIA_ROOT;

# Set environment variables
export WORKDIR=$SKIA_ROOT;
export GOPATH=${HOME}/.cache/gopath/$(basename ${WORKDIR});
export SKIA_INFRA_ROOT="$SKIA_ROOT/buildbot";

# Update dependencies
python3 tools/git-sync-deps;
# Get emsdk
source "$SKIA_ROOT/third_party/externals/emsdk/emsdk_env.sh";

# Download buildbot
git clone https://skia.googlesource.com/buildbot.git "$SKIA_ROOT/buildbot";

# Set GOPATH
export GOPATH=${HOME}/.cache/gopath/$(basename ${WORKDIR});
mkdir $GOPATH;
cd "$SKIA_ROOT/buildbot";


# Almost all applications are built with Bazel, and bazelisk is the recommended tool to ensure you have the right version of bazel installed:
go install github.com/bazelbuild/bazelisk@latest;
go install github.com/bazelbuild/buildtools/buildifier@latest;
go install github.com/kisielk/errcheck@latest;
go install golang.org/x/tools/cmd/goimports@latest;
go install github.com/mikefarah/yq/v4@latest;
go install go.chromium.org/luci/client/cmd/...@latest;

# Add bazelisk to path
export PATH=$PATH:$(go env GOPATH)/bin;

# Install other dependencies:
brew install jq; # sudo apt-get install jq for linux

# Build ~everything
bazelisk build --config=mayberemote //...
```

The last line gets me this error:
```
Starting local Bazel server and connecting to it...
Analyzing: 13956 targets (2404 packages lo\
aded, 7113 targets configured)
ERROR: <path/to/SKIA_ROOT>/buildbot/bazel/rbe/generated/cc/BUILD:47:19: in cc_toolchain_suite rule //bazel/rbe/generated/cc:toolchain: cc_toolchain_suite '//bazel/rbe/generated/cc:toolchain' does not contain a toolchain for cpu 'darwin'
Analyzing: 13956 targets (2404 packages lo\
aded, 7171 targets configured)
ERROR: <path/to/SKIA_ROOT>/buildbot/bazel/rbe/generated/cc/BUILD:47:19: Analysis of target '//bazel/rbe/generated/cc:toolchain' failed
Analyzing: 13956 targets (2404 packages lo\
aded, 7183 targets configured)
    currently loading: @nodejs_toolchains/\
INFO: Repository com_google_protobuf instantiated at:
  <path/to/SKIA_ROOT>/buildbot/WORKSPACE:103:13: in <toplevel>
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
Analyzing: 13956 targets (2404 packages lo\
aded, 7204 targets configured)
    currently loading: @nodejs_toolchains/\
INFO: Repository nodejs_linux_amd64 instantiated at:
  <path/to/SKIA_ROOT>/buildbot/WORKSPACE:221:27: in <toplevel>
  /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/rules_nodejs/nodejs/repositories.bzl:404:26: in nodejs_register_toolchains
Repository rule node_repositories defined at:
  /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/rules_nodejs/nodejs/repositories.bzl:378:36: in <toplevel>
Analyzing: 13956 targets (2404 packages lo\
aded, 7204 targets configured)
    currently loading: @nodejs_toolchains/\
INFO: Repository nodejs_darwin_arm64 instantiated at:
  <path/to/SKIA_ROOT>/buildbot/WORKSPACE:221:27: in <toplevel>
  /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/rules_nodejs/nodejs/repositories.bzl:404:26: in nodejs_register_toolchains
Repository rule node_repositories defined at:
  /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/rules_nodejs/nodejs/repositories.bzl:378:36: in <toplevel>
Analyzing: 13956 targets (2404 packages lo\
aded, 7204 targets configured)
    currently loading: @nodejs_toolchains/\
ERROR: Analysis of target '//bazel/rbe/generated/cc:toolchain' failed; build aborted:
Analyzing: 13956 targets (2404 packages lo\
INFO: Elapsed time: 18.502s
Analyzing: 13956 targets (2404 packages lo\
INFO: 0 processes.
Analyzing: 13956 targets (2404 packages lo\
FAILED: Build did NOT complete successfull\
y (2404 packages loaded, 7204 targets conf\
igured)
    currently loading: @nodejs_toolchains/\
/ ... (7 packages)
    Fetching ...g_golang_x_tools; starting
    Fetching ...nned_debugger; Restarting.
    Fetching ...nned_jsfiddle; Restarting.
    Fetching ...tar.gz; 101.4 KiB (103,816\
B)
    Fetching ...tar.gz; 152.2 KiB (155,882\
B)
```


Dominic

unread,
May 28, 2024, 9:24:57 AMMay 28
to skia-discuss
```shell
# Go to buildbot/debugger-app directory
cd "$SKIA_INFRA_ROOT/debugger-app";
# Run the following to run the debugger instance locally using the version built from ToT. Talk to the Skia Infra team if you have permission issues that need to be sorted out.
make run-local-instance;
```

Gets me this error:
```rm -rf build
mkdir -p build/canvaskit
touch build/canvaskit/canvaskit.js
touch build/canvaskit/canvaskit.wasm
touch build/version.js
bazelisk build --config=mayberemote //debugger-app/...
INFO: Repository pinned_debugger instantiated at:
  <path/to/SKIA_ROOT>/buildbot/WORKSPACE:379:15: in <toplevel>
Repository rule container_pull defined at:
  /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/io_bazel_rules_docker/container/pull.bzl:294:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'pinned_debugger':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/io_bazel_rules_docker/container/pull.bzl", line 240, column 13, in _impl
                fail("Pull command failed: %s (%s)" % (result.stderr, " ".join([str(a) for a in args])))
Error in fail: Pull command failed: 2024/05/27 11:57:21 Running the Image Puller to pull images from a Docker Registry...
2024/05/27 11:57:22 Image pull was unsuccessful: reading image "gcr.io/skia-public/debugger-app-final@sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d": GET https://gcr.io/v2/skia-public/debugger-app-final/manifests/sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d: DENIED: Permission denied for "sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d" from request "/v2/skia-public/debugger-app-final/manifests/sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d".
 (/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/go_puller_darwin/file/downloaded -directory /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/pinned_debugger/image -os linux -os-version  -os-features  -architecture amd64 -variant  -features  -name gcr.io/skia-public/debugger-app-final@sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d)
ERROR: <path/to/SKIA_ROOT>/buildbot/WORKSPACE:379:15: fetching container_pull rule //external:pinned_debugger: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/io_bazel_rules_docker/container/pull.bzl", line 240, column 13, in _impl
                fail("Pull command failed: %s (%s)" % (result.stderr, " ".join([str(a) for a in args])))
Error in fail: Pull command failed: 2024/05/27 11:57:21 Running the Image Puller to pull images from a Docker Registry...
2024/05/27 11:57:22 Image pull was unsuccessful: reading image "gcr.io/skia-public/debugger-app-final@sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d": GET https://gcr.io/v2/skia-public/debugger-app-final/manifests/sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d: DENIED: Permission denied for "sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d" from request "/v2/skia-public/debugger-app-final/manifests/sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d".
 (/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/go_puller_darwin/file/downloaded -directory /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/pinned_debugger/image -os linux -os-version  -os-features  -architecture amd64 -variant  -features  -name gcr.io/skia-public/debugger-app-final@sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d)
ERROR: <path/to/SKIA_ROOT>/buildbot/debugger-app/wasm_libs/BUILD.bazel:12:39: //debugger-app/wasm_libs:fetch_debugger_wasm_skia_wasm_container_filesystem depends on @pinned_debugger//image:image in repository @pinned_debugger which failed to fetch. no such package '@pinned_debugger//image': Pull command failed: 2024/05/27 11:57:21 Running the Image Puller to pull images from a Docker Registry...
2024/05/27 11:57:22 Image pull was unsuccessful: reading image "gcr.io/skia-public/debugger-app-final@sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d": GET https://gcr.io/v2/skia-public/debugger-app-final/manifests/sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d: DENIED: Permission denied for "sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d" from request "/v2/skia-public/debugger-app-final/manifests/sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d".
 (/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/go_puller_darwin/file/downloaded -directory /private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/pinned_debugger/image -os linux -os-version  -os-features  -architecture amd64 -variant  -features  -name gcr.io/skia-public/debugger-app-final@sha256:d63e5ee97f80701a7bf5c0f69da9858a9ca9a349c3f07de39e7d261527c7021d)
ERROR: Analysis of target '//debugger-app/modules/debugger-page-sk:_validate_debugger-page-sk_options' failed; build aborted:
INFO: Elapsed time: 1.849s
INFO: 0 processes.

FAILED: Build did NOT complete successfull\
y (0 packages loaded, 0 targets configured\
)
make: *** [build] Error 1
```
On Monday, May 27, 2024 at 11:00:21 AM UTC-4 johns...@google.com wrote:

Dominic

unread,
May 28, 2024, 9:25:21 AMMay 28
to skia-discuss
```shell
# Go to the skia directory
cd $SKIA_ROOT;
# To run debugger locally with a custom build of debugger, run the following in the Skia repo.
make -C modules/canvaskit with_debugger;
```
This part seems to work with no errors:
```
# Does an incremental build where possible.
./compile.sh debug_build enable_debugger
+++ dirname ./compile.sh
++ cd .
++ pwd
+ BASE_DIR=<path/to/SKIA_ROOT>/modules/canvaskit
+ pushd <path/to/SKIA_ROOT>/modules/canvaskit/../..
~/chromium_build/skia_root/skia ~/chromium_build/skia_root/skia/modules/canvaskit
+ ./bin/fetch-gn
+ IS_OFFICIAL_BUILD=true
+ IS_DEBUG=false
+ FORCE_TRACING=false
+ PROFILE_BUILD=false
+ [[ debug_build enable_debugger != *force_tracing* ]]
+ FORCE_TRACING=true
+ [[ debug_build enable_debugger == *debug_build* ]]
+ echo 'Building a Debug build'
Building a Debug build
+ IS_DEBUG=true
+ IS_OFFICIAL_BUILD=false
+ BUILD_DIR=out/canvaskit_wasm_debug
+ mkdir -p out/canvaskit_wasm_debug
+ rm -f out/canvaskit_wasm_debug/libbrotli.a out/canvaskit_wasm_debug/libdebugger.a out/canvaskit_wasm_debug/libexpat.a out/canvaskit_wasm_debug/libfreetype2.a out/canvaskit_wasm_debug/libharfbuzz.a out/canvaskit_wasm_debug/libicu.a out/canvaskit_wasm_debug/libjpeg.a out/canvaskit_wasm_debug/libpng.a out/canvaskit_wasm_debug/libskcms.a out/canvaskit_wasm_debug/libskia.a out/canvaskit_wasm_debug/libskottie.a out/canvaskit_wasm_debug/libskparagraph.a out/canvaskit_wasm_debug/libskresources.a out/canvaskit_wasm_debug/libsksg.a out/canvaskit_wasm_debug/libskshaper.a out/canvaskit_wasm_debug/libskunicode.a out/canvaskit_wasm_debug/libspvtools.a out/canvaskit_wasm_debug/libspvtools_val.a out/canvaskit_wasm_debug/libwebp.a out/canvaskit_wasm_debug/libwebp_sse41.a out/canvaskit_wasm_debug/libwuffs.a out/canvaskit_wasm_debug/libzlib.a
+ ENABLE_GANESH=true
+ ENABLE_GRAPHITE=false
+ ENABLE_WEBGL=false
+ ENABLE_WEBGPU=false
+ [[ debug_build enable_debugger == *cpu* ]]
+ [[ debug_build enable_debugger == *webgpu* ]]
+ ENABLE_WEBGL=true
+ SERIALIZE_SKP=true
+ [[ debug_build enable_debugger == *no_skp_serialization* ]]
+ DESERIALIZE_EFFECTS=true
+ [[ debug_build enable_debugger == *no_effects_deserialization* ]]
+ ENABLE_SKOTTIE=true
+ [[ debug_build enable_debugger == *no_skottie* ]]
+ INCLUDE_VIEWER=false
+ USE_EXPAT=false
+ [[ debug_build enable_debugger == *viewer* ]]
+ ENABLE_PATHOPS=true
+ [[ debug_build enable_debugger == *no_pathops* ]]
+ ENABLE_SKSL_TRACE=true
+ [[ debug_build enable_debugger == *no_sksl_trace* ]]
+ ENABLE_MATRIX=true
+ [[ debug_build enable_debugger == *no_matrix* ]]
+ ENABLE_CANVAS=true
+ [[ debug_build enable_debugger == *no_canvas* ]]
+ [[ debug_build enable_debugger == *no_matrix* ]]
+ GN_FONT='skia_enable_fontmgr_custom_directory=false '
+ WOFF2_FONT=skia_use_freetype_woff2=true
+ ENABLE_FONT=true
+ ENABLE_EMBEDDED_FONT=true
+ [[ debug_build enable_debugger == *no_font* ]]
+ [[ debug_build enable_debugger == *no_embedded_font* ]]
+ GN_FONT+='skia_enable_fontmgr_custom_embedded=true skia_enable_fontmgr_custom_empty=false '
+ [[ debug_build enable_debugger == *no_woff2* ]]
+ ENABLE_ALIAS_FONT=true
+ [[ debug_build enable_debugger == *no_alias_font* ]]
+ LEGACY_DRAW_VERTICES=false
+ [[ debug_build enable_debugger == *legacy_draw_vertices* ]]
+ DEBUGGER_ENABLED=false
+ [[ debug_build enable_debugger == *enable_debugger* ]]
+ DEBUGGER_ENABLED=true
+ GN_SHAPER='skia_use_icu=true skia_use_client_icu=false skia_use_libgrapheme=false skia_use_icu4x=false skia_use_system_icu=false skia_use_harfbuzz=true skia_use_system_harfbuzz=false'
+ [[ debug_build enable_debugger == *primitive_shaper* ]]
+ [[ debug_build enable_debugger == *no_font* ]]
+ ENABLE_PARAGRAPH=true
+ [[ debug_build enable_debugger == *no_paragraph* ]]
+ [[ debug_build enable_debugger == *primitive_shaper* ]]
+ [[ debug_build enable_debugger == *no_font* ]]
+ DO_DECODE=true
+ [[ debug_build enable_debugger == *no_codecs* ]]
+ ENCODE_PNG=true
+ NO_ENCODE_PNG=false
+ [[ debug_build enable_debugger == *no_encode_png* ]]
+ ENCODE_JPEG=true
+ NO_ENCODE_JPEG=false
+ [[ debug_build enable_debugger == *no_encode_jpeg* ]]
+ ENCODE_WEBP=true
+ NO_ENCODE_WEBP=false
+ [[ debug_build enable_debugger == *no_encode_webp* ]]
+ ./bin/fetch-ninja
Already up to date.
+ NINJA=third_party/ninja/ninja
+ echo Compiling
Compiling
+ ./bin/gn gen out/canvaskit_wasm_debug '--args=is_debug=true   is_official_build=false   is_component_build=false   is_trivial_abi=true   werror=true   target_cpu="wasm"     skia_use_angle=false   skia_use_dng_sdk=false   skia_use_dawn=false   skia_use_webgl=true   skia_use_webgpu=false   skia_use_expat=false   skia_use_fontconfig=false   skia_use_freetype=true   skia_use_libheif=false   skia_use_libjpeg_turbo_decode=true   skia_use_libjpeg_turbo_encode=true   skia_use_no_jpeg_encode=false   skia_use_libpng_decode=true   skia_use_libpng_encode=true   skia_use_no_png_encode=false   skia_use_libwebp_decode=true   skia_use_libwebp_encode=true   skia_use_no_webp_encode=false   skia_use_lua=false   skia_use_piex=false   skia_use_system_freetype2=false   skia_use_system_libjpeg_turbo=false   skia_use_system_libpng=false   skia_use_system_libwebp=false   skia_use_system_zlib=false  skia_use_vulkan=false   skia_use_wuffs=true   skia_use_zlib=true   skia_enable_ganesh=true   skia_enable_graphite=false   skia_build_for_debugger=true   skia_enable_skottie=true   skia_enable_sksl_tracing=true     skia_use_icu=true skia_use_client_icu=false skia_use_libgrapheme=false skia_use_icu4x=false skia_use_system_icu=false skia_use_harfbuzz=true skia_use_system_harfbuzz=false   skia_enable_fontmgr_custom_directory=false skia_enable_fontmgr_custom_embedded=true skia_enable_fontmgr_custom_empty=false    skia_use_freetype_woff2=true     skia_enable_skshaper=true   skia_enable_skparagraph=true   skia_enable_pdf=false   skia_canvaskit_enable_rt_shader=true   skia_canvaskit_force_tracing=true   skia_canvaskit_profile_build=false   skia_canvaskit_enable_skp_serialization=true   skia_canvaskit_enable_effects_deserialization=true   skia_canvaskit_include_viewer=false   skia_canvaskit_enable_pathops=true   skia_canvaskit_enable_matrix_helper=true   skia_canvaskit_enable_canvas_bindings=true   skia_canvaskit_enable_font=true   skia_canvaskit_enable_embedded_font=true   skia_canvaskit_enable_alias_font=true   skia_canvaskit_legacy_draw_vertices_blend_mode=false   skia_canvaskit_enable_debugger=true   skia_canvaskit_enable_paragraph=true   skia_canvaskit_enable_webgl=true   skia_canvaskit_enable_webgpu=false'
Done. Made 177 targets from 69 files in 97ms
+ third_party/ninja/ninja -C out/canvaskit_wasm_debug canvaskit.js
ninja: Entering directory `out/canvaskit_wasm_debug'
[23/23] link canvaskit.js
rm -rf build/
mkdir build
cp ../../out/canvaskit_wasm_debug/canvaskit.js   ./build/
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./build/
mkdir <path/to/SKIA_ROOT>/buildbot/debugger-app/wasm_libs/local_build/
mkdir: <path/to/SKIA_ROOT>/buildbot/debugger-app/wasm_libs/local_build/: File exists
make: [with_debugger] Error 1 (ignored)
cp ./build/canvaskit.js         <path/to/SKIA_ROOT>/buildbot/debugger-app/wasm_libs/local_build/
cp ./build/canvaskit.wasm       <path/to/SKIA_ROOT>/buildbot/debugger-app/wasm_libs/local_build/
cp ./npm_build/types/index.d.ts <path/to/SKIA_ROOT>/buildbot/debugger-app/wasm_libs/local_build/canvaskit.d.ts
```

But the next part produces an error:
```shell
# The next line should copy the canvaskit.js, canvaskit.wasm, and canvaskit.d.ts to //debugger-app/wasm_libs/local_build, assuming you have the SKIA_INFRA_ROOT environment variable set. Then, you can run (in the buildbot/debugger-app directory)
cd "$SKIA_INFRA_ROOT/debugger-app";
make run-with-custom;
```


```
echo "Using the debugger files in //debugger-app/wasm_libs/local_build"
Using the debugger files in //debugger-app/wasm_libs/local_build
bazelisk build --config=mayberemote //debugger-app/... --with_local_debugger
ERROR: <path/to/SKIA_ROOT>/buildbot/debugger-app/modules/debugger-page-sk/BUILD.bazel:57:11: in js_test rule //debugger-app/modules/debugger-page-sk:debugger-page-sk_test:
Traceback (most recent call last):
        File "/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/aspect_rules_js/js/private/js_binary.bzl", line 556, column 32, in _js_binary_impl
                launcher = _create_launcher(
        File "/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/aspect_rules_js/js/private/js_binary.bzl", line 537, column 31, in _create_launcher
                runfiles = gather_runfiles(
        File "/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/aspect_rules_js/js/private/js_helpers.bzl", line 246, column 61, in gather_runfiles
                files_runfiles.append(copy_js_file_to_bin_action(ctx, d))
        File "/private/var/tmp/_bazel_<my_username>/6893bbe37d7384f905719aa5a48762c3/external/aspect_rules_js/js/private/js_helpers.bzl", line 173, column 13, in copy_js_file_to_bin_action
                fail(msg)
Error in fail:

Expected to find source file canvaskit.js in '//debugger-app/modules/debugger-page-sk', but instead it is in '//debugger-app/wasm_libs'.

All source and data files that are not in the Bazel output tree must be in the same package as the
target so that they can be copied to the output tree in an action.

See https://docs.aspect.build/rules/aspect_rules_js/docs/#javascript for more context on why this is required.

Either move canvaskit.js to '//debugger-app/modules/debugger-page-sk', or add a 'js_library'
target in canvaskit.js's package and add that target to the deps of @//debugger-app/modules/debugger-page-sk:debugger-page-sk_test:

buildozer 'new_load @aspect_rules_js//js:defs.bzl js_library' //debugger-app/wasm_libs:__pkg__
buildozer 'new js_library canvaskit_js' //debugger-app/wasm_libs:__pkg__
buildozer 'add srcs canvaskit.js' //debugger-app/wasm_libs:canvaskit_js
buildozer 'add visibility //debugger-app/modules/debugger-page-sk:__pkg__' //debugger-app/wasm_libs:canvaskit_js
buildozer 'remove srcs //debugger-app/wasm_libs:canvaskit.js' @//debugger-app/modules/debugger-page-sk:debugger-page-sk_test
buildozer 'add srcs //debugger-app/wasm_libs:canvaskit_js' @//debugger-app/modules/debugger-page-sk:debugger-page-sk_test

For exceptional cases where copying is not possible or not suitable for an input file such as
a file in an external repository, exceptions can be added to 'no_copy_to_bin'. In most cases,
this option is not needed.

ERROR: <path/to/SKIA_ROOT>/buildbot/debugger-app/modules/debugger-page-sk/BUILD.bazel:57:11: Analysis of target '//debugger-app/modules/debugger-page-sk:debugger-page-sk_test' failed
ERROR: Analysis of target '//debugger-app/modules/debugger-page-sk:debugger-page-sk_test' failed; build aborted:
INFO: Elapsed time: 0.302s

INFO: 0 processes.
FAILED: Build did NOT complete successfull\
y (0 packages loaded, 0 targets configured\
)
make: *** [run-with-custom] Error 1```
On Monday, May 27, 2024 at 11:00:21 AM UTC-4 johns...@google.com wrote:

Dominic

unread,
May 28, 2024, 9:25:33 AMMay 28
to skia-discuss
And the docker error:
```shell
# Build docker image
cd "$SKIA_ROOT/buildbot/docker";
docker build --build-arg HASH=$(git rev-parse HEAD) -t skia-infra .
```

```
[+] Building 0.0s (0/0)  docker:desktop-linu[+] Building 0.0s (0/0)  docker:desktop-linu[+] Building 0.0s (0/1)  docker:desktop-linu[+] Building 0.2s (1/2)  docker:desktop-linu[+] Building 0.3s (1/2)  docker:desktop-linu[+] Building 0.5s (1/2)  docker:desktop-linu[+] Building 0.6s (1/2)  docker:desktop-linu[+] Building 0.7s (2/2)  docker:desktop-linu[+] Building 0.8s (11/14)  docker:desktop-li[+] Building 1.0s (11/14)  docker:desktop-li[+] Building 1.1s (11/14)  docker:desktop-li[+] Building 1.3s (11/14)  docker:desktop-li[+] Building 1.4s (11/14)  docker:desktop-li[+] Building 1.6s (11/14)  docker:desktop-li[+] Building 1.7s (11/14)  docker:desktop-li[+] Building 1.9s (11/14)  docker:desktop-li[+] Building 2.0s (11/14)  docker:desktop-li[+] Building 2.2s (11/14)  docker:desktop-li[+] Building 2.3s (11/14)  docker:desktop-li[+] Building 2.5s (11/14)  docker:desktop-li[+] Building 2.6s (11/14)  docker:desktop-li[+] Building 2.8s (11/14)  docker:desktop-li[+] Building 2.9s (11/14)  docker:desktop-li[+] Building 3.1s (11/14)  docker:desktop-li[+] Building 3.2s (11/14)  docker:desktop-li[+] Building 3.4s (11/14)  docker:desktop-li[+] Building 3.5s (11/14)  docker:desktop-li[+] Building 3.7s (11/14)  docker:desktop-li[+] Building 3.8s (11/14)  docker:desktop-li[+] Building 4.0s (11/14)  docker:desktop-li[+] Building 4.1s (11/14)  docker:desktop-li[+] Building 4.3s (11/14)  docker:desktop-li[+] Building 4.4s (11/14)  docker:desktop-li[+] Building 4.6s (11/14)  docker:desktop-li[+] Building 4.7s (11/14)  docker:desktop-li[+] Building 4.9s (11/14)  docker:desktop-li[+] Building 5.0s (11/14)  docker:desktop-li[+] Building 5.2s (11/14)  docker:desktop-li[+] Building 5.3s (11/14)  docker:desktop-li[+] Building 5.5s (11/14)  docker:desktop-li[+] Building 5.6s (11/14)  docker:desktop-li[+] Building 5.8s (11/14)  docker:desktop-li[+] Building 5.9s (11/14)  docker:desktop-li[+] Building 6.1s (11/14)  docker:desktop-li[+] Building 6.2s (11/14)  docker:desktop-li[+] Building 6.3s (11/14)  docker:desktop-li[+] Building 6.4s (12/14)  docker:desktop-linux => transferring context: 2B        0.0s
 => [internal] load build definition   0.0s
 => => transferring dockerfile 2.02kB  0.0s
 => [internal] load metadata for dock  0.6s
 => [internal] load .dockerignore      0.0s
 => => transferring context: 2B        0.0s
 => [ 1/11] FROM docker.io/library/de  0.0s
 => CACHED [ 2/11] RUN groupadd -g 20  0.0s
 => CACHED [ 3/11] RUN mkdir -p /home  0.0s
 => CACHED [ 4/11] RUN cd /home/skia/  0.0s
 => CACHED [ 5/11] RUN cd /home/skia/  0.0s
 => CACHED [ 6/11] RUN if [ -z "6cab4  0.0s
 => CACHED [ 7/11] RUN cd /home/skia/  0.0s
 => CACHED [ 8/11] RUN if [ ! -z "${P  0.0s
 => ERROR [ 9/11] RUN cd /home/skia/g  5.7s
------
 > [ 9/11] RUN cd /home/skia/golib/src/go.skia.org/infra     && go install ./...:
5.623 go: cloud.google.com/go/bigt...@v1.19.0 requires
5.623   cloud.google.com/g...@v0.110.2: missing go.sum entry; to add it:
5.623   go mod download cloud.google.com/go
------
Dockerfile:54
--------------------
  53 |    
  54 | >>> RUN cd $GOPATH/src/go.skia.org/infra \
  55 | >>>     && go install ./...
  56 |    
--------------------
ERROR: failed to solve: process "/bin/sh -c cd $GOPATH/src/go.skia.org/infra     && go install ./..." did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/irxb1hyi2q0arh8zbxvp7vd6n
```
On Monday, May 27, 2024 at 11:00:21 AM UTC-4 johns...@google.com wrote:

Dominic

unread,
May 28, 2024, 9:25:47 AMMay 28
to skia-discuss
Last post –and I am quite unfamiliar with Google's cloud service so I am probably doing this wrong– but "skia-public" doesn't seem to yield any results when I go to https://gcr.io/v2/skia-public
Screenshot 2024-05-27 at 12.17.45 PM.png
Screenshot 2024-05-27 at 12.17.45 PM

On Monday, May 27, 2024 at 11:00:21 AM UTC-4 johns...@google.com wrote:

Dominic

unread,
May 28, 2024, 9:26:06 AMMay 28
to skia-discuss
I really would prefer to be able to build Skia Debugger locally from scratch myself so that I can test out all of my local changes in real-time rather than being dependent on re-downloading and then re-patching Google's Docker images for every single change but I will honestly take whatever I can get at this point.

On Monday, May 27, 2024 at 11:00:21 AM UTC-4 johns...@google.com wrote:

kjlu...@google.com

unread,
May 28, 2024, 11:31:27 AMMay 28
to skia-discuss
make run-local-instance
Is the target you should be running, but due to some Bazel dependency resolution things, it appears to still be trying to get you to download some of our prebuilt Docker images (which we do not want you to do).

If you are willing to patch your local checkout of the skia-buildbot repo, try removing all the "use_debugger_from_container_true" branches of these select statements
https://github.com/google/skia-buildbot/blob/b523cfab24b2fc07c86478acd98f4e23b9500378/debugger-app/wasm_libs/BUILD.bazel#L24-L49

I'm hopeful that will remove the docker issues and let you just run the debugger-app backend with a custom build of canvaskit that you seem to have been able to build successfully.

Kaylee

Dominic

unread,
May 29, 2024, 9:10:56 AMMay 29
to skia-discuss
Kaylee,
You're awesome.

I'm brand new to bazel so please be patient with me on this one. The only 2 things that I've really learned about bazel so far are that it's super confusing and that I hate it.

Not sure if this is what you meant but I commented out these 3 lines in buildbot/debugger-app/wasm_libs/BUILD.bazel:
":use_debugger_from_container_true": ["from_container/canvaskit.js"],
":use_debugger_from_container_true": ["from_container/canvaskit.wasm"],
":use_debugger_from_container_true": ["from_container/canvaskit.d.ts"],

That resulted in a different error. I'll spare you the details but it resulted in a series of error messages with instructions in them for diagnosing the problem and I just kept following the instructions one after the other.

Eventually, it told me to just change the default value to False  (defined at the top of debugger-app/wasm_libs/BUILD.bazel)
```
bool_flag(
    default = False,
    flag_name = "use_debugger_from_container",
)
```

Then, `$ make run-local-instance;` resulted in this error:
```
rm -rf build
mkdir -p build/canvaskit
touch build/canvaskit/canvaskit.js
touch build/canvaskit/canvaskit.wasm
touch build/version.js
bazelisk build --config=mayberemote //debugger-app/...
ERROR: <my/path/to>/skia/buildbot/debugger-app/modules/debugger-page-sk/BUILD.bazel:57:11: in js_test rule //debugger-app/modules/debugger-page-sk:debugger-page-sk_test:
ERROR: <my/path/to>/skia/buildbot/debugger-app/modules/debugger-page-sk/BUILD.bazel:57:11: Analysis of target '//debugger-app/modules/debugger-page-sk:debugger-page-sk_test' failed

ERROR: Analysis of target '//debugger-app/modules/debugger-page-sk:debugger-page-sk_test' failed; build aborted:
INFO: Elapsed time: 68.611s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (663 packages loaded, 20208 targets configured)

make: *** [build] Error 1
```
^ I honestly have no clue what 99% of this means but I ended up just commenting out the following chunk of code from `buildbot/debugger-app/modules/debugger-page-sk/BUILD.bazel` and I was at least able to get Skia Debugger to start running. Is this part important or will I be okay without it?
I'm guessing you can probably think of a better/cleaner way to do this than I can. Either way, I'm quite happy to finally have Skia Debugger running locally on my mac so thank you very much!
```
karma_test(
    name = "debugger-page-sk_test",
    src = "debugger-page-sk_test.ts",
    karma_config_file = "debugger.karma.conf.js",
    static_karma_files = [
        "//debugger-app/wasm_libs:version.js",
        "//debugger-app/wasm_libs:canvaskit.js",
        "//debugger-app/wasm_libs:canvaskit.wasm",
    ],
    deps = [
        ":debugger-page-sk",
        "//:node_modules/@types/chai",
        "//:node_modules/chai",
        "//debugger-app/modules/commands-sk",
        "//debugger-app/modules/commands-sk:test-data_ts_lib",
        "//debugger-app/modules/histogram-sk",
        "//infra-sk/modules:test_util_ts_lib",
    ],
)
```
Reply all
Reply to author
Forward
0 new messages