skia2/tools
Kevin Lubick 7a14f783bd [bazel] Sketching out HelloWorld sk_app using GL
bazel run //example:hello_world --config=clang
causes a window to open and draws a circle and a square.
Text to follow in a future CL.

To make this work, I had to get rid of musl and use glibc.
All the shared libraries (.so files) that were pre-built
and available for download (e.g. from https://packages.debian.org/bullseye/amd64/libgl1/download)
were compiled against glibc. When I tried to run a
program statically linked with musl and dynamically linked
against things using glibc, I got a segmentation fault
on things like calloc().

Initial attempts to use glibc had failed because it was thought
that the libc.so.6 file could only be referred to by absolute
path (and thus Bazel would not be happy about it). As it turns out,
that was simply a misconfiguration of the builtin_sysroot
parameter to cc_common.create_cc_toolchain_config_info
(see //toolchain/clang_toolchain_config.bzl). By setting that
to `external/clang_linux_amd64` and not
`external/clang_linux_amd64/usr`, the libc binary which had
been extracted to `external/clang_linux_amd64/lib/x86_64-linux-gnu`
was perfectly reachable from
`external/clang_linux_amd64/usr/usr/lib/x86_64-linux-gnu/libc.so`

To bring in the shared libraries to link against (e.g. X11, GL)
I made build_toolchain.bzl easier to modify in that we simply need
to add a debian download url and sha256 hash to a list (rather than
having to plumb this through via arguments).

Recommended Review Order:
 - example/BUILD.bazel (not sure if we always want to set bare
   link arguments like that or if we want to use "features" to
   pass those along to the toolchain).
 - tools/sk_app/BUILD.bazel to see initial cc_library for
   wrapping sk_app code.
 - toolchain/build_toolchain.bzl to see removal of musl and
   new list of debs.
 - toolchain/clang_toolchain_config.bzl (where use of the
   no-canonical-prefixes was key to compilation success).
   Notice also that we statically linked libc++ (I did not
   have any shared libraries for it locally, so I guessed
   a typical developer might not either).
 - Rest of toolchain/ for trivial renames.
 - bazel/Makefile to see extra docs on those targets and
   a new target that compiles all the exes so far for a
   quick way to test the build.
 - third_party/BUILD.bazel and src/gpu/BUILD.bazel which have
   non-generated changes. (all other BUILD.bazel files do).
 - go.mod, which needed to update the infra repo version in
   order to pick up http://review.skia.org/491736).

Change-Id: I8687bd227353040eca2dffa9465798d8bd395027
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492117
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-01-11 13:06:19 +00:00
..
android Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
calmbench Update references to master branch 2021-05-21 15:18:16 +00:00
copyright Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
debugger [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
doxygen Include svg module in Doxygen generated output. 2021-01-06 16:40:09 +00:00
fiddle [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
flags [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
fm [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
fonts Fix when a glyph has a path 2021-12-07 14:58:29 +00:00
gdb Update gdb bitmap viewer. 2018-06-20 21:24:27 +00:00
gpu Reland "drawVertices in GPU backend uses drawVustomMesh implementation." 2022-01-10 23:06:15 +00:00
graphite [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
infra [infra] Use "mod download" and "install", not "get" in chrome_release_branch 2019-12-06 11:16:41 +00:00
lottie-web-perf HTML typo egde => edge 2020-06-19 15:12:06 +00:00
lottiecap HTML typo egde => edge 2020-06-19 15:12:06 +00:00
malisc Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
mdbviz [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
perf-canvaskit-puppeteer [canvaskit] Remove deprecated MakeTypefaceFromData and RefDefault 2021-10-21 16:45:42 +00:00
rebaseline Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
run-wasm-gm-tests Reland "Purge ccpr" 2021-06-19 18:42:38 +00:00
sk_app [bazel] Sketching out HelloWorld sk_app using GL 2022-01-11 13:06:19 +00:00
skdiff [bazel] Sketching out HelloWorld sk_app using GL 2022-01-11 13:06:19 +00:00
skiaserve [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
skottie_ios_app [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
skottie-wasm-perf Reland "[canvaskit] Change SkRects to be arrays, not objects." 2020-09-03 14:31:38 +00:00
skp Add skia_motionmarksuites_desktop.py 2021-07-29 19:16:05 +00:00
skpbench [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
skqp Build the NDK compliant shared library to be used by JNI in SkQP. 2022-01-10 17:11:48 +00:00
skui [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
svg Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
timer [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
trace [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
viewer Revert "Spruce up SkSL slide with a much nicer editor" 2022-01-07 15:56:16 +00:00
__init__.py
abandon_gerrit_cls.py Add wrapper script to call tool to bulk abandon Gerrit CLs 2020-03-11 18:50:57 +00:00
add_codereview_message.py
AndroidSkDebugToStdOut.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
AutoreleasePool.h Reland "Added AutoreleasePool for managing pool memory in testing apps." 2019-05-31 15:40:01 +00:00
AutoreleasePool.mm Reland "Added AutoreleasePool for managing pool memory in testing apps." 2019-05-31 15:40:01 +00:00
bloaty_treemap.py bloaty_treemap.py: Fix path/symbol name collisions; make symbols unique with _1, _2, ... instead of _x, _x_x, ... 2021-12-01 21:38:55 +00:00
blob_cache_sim.cpp move SkRemoteGlyphCache.h to private 2021-12-10 20:20:56 +00:00
build_command_buffer.py
BUILD_simulator.py
build_workaround_header.py Correct a typo in build_workaround_header.py 2021-07-29 13:06:01 +00:00
BUILD.bazel Update Bazel files 2022-01-06 18:10:57 +00:00
check-headers-self-sufficient rm SkPreConfig.h and SkPostConfig.h 2020-02-06 19:16:43 +00:00
chrome_fuzz.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
clang-tidy.sh don't run clang-tidy on third_party 2020-03-30 15:26:32 +00:00
compare_codereview.py
convert-to-nia.cpp Fix convert-to-NIA stillImage check 2021-11-24 16:45:43 +00:00
cpu_modules.cpp Particle cleanup: split SkParticleBinding out of SkParticleEffect 2019-08-30 15:32:38 +00:00
CrashHandler.cpp Reland "Add format-specifier warnings to SkDebugf." 2021-06-25 17:57:43 +00:00
CrashHandler.h
DDLPromiseImageHelper.cpp Reland "Remove GrBackendFormat's textureType use from isFormatTexturable call." 2021-08-13 22:37:13 +00:00
DDLPromiseImageHelper.h Only include SkJSONWriter when SK_ENABLE_DUMP_GPU defined 2021-11-02 16:17:17 +00:00
DDLTileHelper.cpp Reland "Remove GrBackendFormat's textureType use from isFormatTexturable call." 2021-08-13 22:37:13 +00:00
DDLTileHelper.h Move SkSpan to include/, for use in public API 2021-05-12 13:19:32 +00:00
doxygen_footer.txt
dump_record.cpp Fix cases of variable shadowing in /tools/. 2021-08-11 16:05:52 +00:00
embed_resources.py Tweak scripts to fix CK builds with python 3 2020-06-29 12:59:05 +00:00
find_run_binary.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
fix_pythonpath.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
force_older_glibc_math.h roll cast toolchain 2019-08-15 20:02:18 +00:00
gcov_shim
get_current_monitor_profile.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
get_images_from_skps.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
git-sync-deps [infra] Make git-sync-deps truncate directory from beginning 2021-11-15 15:36:07 +00:00
HashAndEncode.cpp More angle brackets for system includes for third_party deps 2021-11-23 18:35:52 +00:00
HashAndEncode.h [canvaskit] POC bindings for testing gms 2020-10-08 16:03:08 +00:00
image_diff_metric.cpp pdf-comparison and image_diff_metric tools 2019-09-19 21:18:28 +00:00
imgcvt.cpp Move skcms.h to include/third_party/skcms 2019-04-29 15:02:45 +00:00
install_dependencies.sh Add optional --yes argument to tools/install_dependencies.sh. 2021-01-05 16:30:22 +00:00
ios_utils.h
ios_utils.m rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
jsondiff.py Fix pylint check in presubmit 2018-06-22 14:38:28 +00:00
list_gms.cpp gm: GMFactory returns a unique_ptr<> 2019-08-12 19:02:40 +00:00
list_gpu_unit_tests.cpp Name Test struct's member variables consistently 2021-10-13 17:37:39 +00:00
LsanSuppressions.cpp stifle leaks in terminator_CreateDevice() 2020-04-08 15:28:48 +00:00
merge_static_libs.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
milestone.py Update references to master branch 2021-05-21 15:18:16 +00:00
mirror-dev.sh
misc_utils.py
MSKPPlayer.cpp Move canvas helper structs to header 2021-08-10 17:53:16 +00:00
MSKPPlayer.h Move canvas helper structs to header 2021-08-10 17:53:16 +00:00
OverwriteLine.h
parse_llvm_coverage.py
pathops_sorter.htm fix pathops bug 8380 2018-12-21 19:15:54 +00:00
pathops_visualizer.htm fix pathops bug 8380 2018-12-21 19:15:54 +00:00
ProcStats.cpp Add heap usage of SkSL::Compiler to nanobench output 2020-07-09 00:05:28 +00:00
ProcStats.h Add heap usage of SkSL::Compiler to nanobench output 2020-07-09 00:05:28 +00:00
public_headers_warnings_check.cpp
random_parse_path.cpp Fix cases of variable shadowing in /tools/. 2021-08-11 16:05:52 +00:00
random_parse_path.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
reformat-json.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
Registry.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
remote_demo.cpp cleanup TODOs, and warnings 2021-12-15 17:38:34 +00:00
ResourceFactory.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
Resources.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
Resources.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
retrieve_from_googlesource.py Update references to master branch 2021-05-21 15:18:16 +00:00
rewrite_includes.py Fix rewrite_includes to work in both Python 2 and 3. 2021-08-17 11:53:50 +00:00
RuntimeBlendUtils.cpp Convert internal SkSL to use .eval() 2021-09-03 15:54:54 +00:00
RuntimeBlendUtils.h Simplify GetRuntimeBlendForBlendMode. 2021-07-30 16:42:36 +00:00
sanitize_source_files.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
serve_wasm.py [infra] Deduplicate serve.py 2021-10-12 11:42:50 +00:00
SkMetaData.cpp Move fontmgr_bounds labels to tight bounds 2020-08-24 15:02:44 +00:00
SkMetaData.h Move fontmgr_bounds labels to tight bounds 2020-08-24 15:02:44 +00:00
skottie2movie.cpp Fix skottie2movie gpu async crash 2021-09-11 15:49:19 +00:00
skp_parser.cpp Remove an uncessary and unused parameter for partially generating the JSON command list 2019-12-13 19:30:03 +00:00
skpinfo.cpp Print out picture version even if its unsupported 2021-07-20 00:11:39 +00:00
SkSharingProc.cpp Support building on clang with -std=c++14 but no C++17 extension warning. 2021-10-12 16:34:30 +00:00
SkSharingProc.h Accept a callback used in MultiPictureDocument::endPage 2021-01-06 16:52:50 +00:00
Stats.h Update SkTQSort to use half-open ranges. 2020-07-14 22:13:59 +00:00
test_all.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
test_pdfs.py
ToolUtils.cpp Extract ToolUtils::sniff_paths 2021-10-19 17:39:11 +00:00
ToolUtils.h Extract ToolUtils::sniff_paths 2021-10-19 17:39:11 +00:00
UrlDataManager.cpp begin refactoring SkTDynamicHash and SkTMultiMap 2020-03-16 14:06:30 +00:00
UrlDataManager.h Enable ClangTidy check readability-redundant-smartptr-get. 2020-08-16 15:56:48 +00:00
using_skia_and_harfbuzz.cpp Support building on clang with -std=c++14 but no C++17 extension warning. 2021-10-12 16:34:30 +00:00
valgrind.supp Add another make_get_error_with_random_oom valgrind suppression 2020-06-24 22:15:33 +00:00
win_dbghelp.cpp Remove "dummy" to comply with Android's inclusive language guidance 2020-07-31 19:11:23 +00:00
win_dbghelp.h
win_lcid.cpp Move SkTSearch.h into src. 2019-05-15 14:15:07 +00:00
xsan.supp rename tools/xsan.blacklist 2020-07-24 18:12:31 +00:00