skia2/third_party/file_map_for_bazel.json

106 lines
4.5 KiB
JSON
Raw Normal View History

{
"D3D12MemAlloc.h": "SK_GAZELLE_IGNORE TODO //third_party:d3d12allocator",
"dawn/dawn_proc.h": "//third_party:dawn",
"dawn/dawn_wsi.h": "//third_party:dawn",
"dawn/native/D3D12Backend.h": "//third_party:dawn",
"dawn/native/DawnNative.h": "//third_party:dawn",
"dawn/native/OpenGLBackend.h": "//third_party:dawn",
"dawn/native/VulkanBackend.h": "//third_party:dawn",
"webgpu/webgpu.h": "//third_party:dawn",
"webgpu/webgpu_cpp.h": "//third_party:dawn",
"dng_area_task.h": "//third_party:dng_sdk",
"dng_color_space.h": "//third_party:dng_sdk",
"dng_errors.h": "//third_party:dng_sdk",
"dng_exceptions.h": "//third_party:dng_sdk",
"dng_host.h": "//third_party:dng_sdk",
"dng_info.h": "//third_party:dng_sdk",
"dng_memory.h": "//third_party:dng_sdk",
"dng_render.h": "//third_party:dng_sdk",
"dng_stream.h": "//third_party:dng_sdk",
[bazel] Compile gms for wasm and WebGL PS 1 is re-generating existing BUILD.bazel files PS 2 is generating BUILD.bazel files for tests/gms PS 3+ makes modifications to build all of the gms and tests. It is recommended to view this CL with just a diff between PS 2 and the end, due to the large amount of generated changes in PS 1 and 2. We make a filegroup for the gms and tests because they need to be compiled as one large blob in order for the registries to work. Maybe in the future we will break these up, but at least for WASM/JS, the overhead of starting a browser for each new test would likely grind things to a halt, so we just group them all together for now. It's also the most similar to what we currently do. In gm/BUILD.bazel and tests/BUILD.bazel, we add a cc_library that encapsulates all of the deps of the tests, so we can easily include that the build. These were discovered via trial and error, not anything automatic or systematic. The is_skia_dev_build config_setting is very similar to the GN equivalent from which it was based. The list of gms and tests to skip (e.g. which are incompatible with WASM) was determined by building the wasm bundle: modules/canvaskit$ make bazel_gms_release tools/run-wasm-gm-tests$ make run_local_debug # Don't forget to click the button on the screen after the # browser loads This way of invoking the tests will be replace soon with `bazel test <something>`. As such, I didn't bother fully documenting the current way. Suggested review order: - modules/canvaskit/BUILD.bazel taking note that we always use profiling-funcs to make the stacktraces human readable. - gm/BUILD.bazel and tests/BUILD.bazel to see the lists of gms/tests. Notice the tests are roughly partitioned because we don't support things like vulkan/PDF in the wasm build and we will want a way to not build certain tests for certain configurations - tools/* noting some of the cc_libraries added to make dependencies easier to add when needed. - All other files. Change-Id: I43059cd93c28af1c4c12b93d6ebd9c46a12d381f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506256 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-09 18:14:25 +00:00
"third_party/etc1/etc1.h": "//third_party:etc1",
"ft2build.h": "//third_party:freetype2",
"freetype/ftadvanc.h": "//third_party:freetype2",
"freetype/ftimage.h": "//third_party:freetype2",
"freetype/ftbitmap.h": "//third_party:freetype2",
"freetype/ftcolor.h": "//third_party:freetype2",
"freetype/freetype.h": "//third_party:freetype2",
"freetype/ftlcdfil.h": "//third_party:freetype2",
"freetype/ftmodapi.h": "//third_party:freetype2",
"freetype/ftmm.h": "//third_party:freetype2",
"freetype/ftoutln.h": "//third_party:freetype2",
"freetype/ftsizes.h": "//third_party:freetype2",
"freetype/ftsystem.h": "//third_party:freetype2",
"freetype/tttables.h": "//third_party:freetype2",
"freetype/t1tables.h": "//third_party:freetype2",
"freetype/ftfntfmt.h": "//third_party:freetype2",
"hb-subset.h": "//third_party:harfbuzz",
"hb.h": "//third_party:harfbuzz",
"SkLoadICU.h": "//third_party:icu",
"unicode/ubidi.h": "//third_party:icu",
[bazel] Try adding cc_binary rules that use generated rules To make the atomic rules a bit easier to work with, in many of the folders, this adds in cc_library rules to group together the sources from that folder (and subfolders where prudent). We only needs sources because those atoms should have their headers as deps. One issue that was pointed out is that there is currently no way to restrict the inclusion of certain packages, a la, `gn check`. For example, there is no mechanism from stopping a dev from adding #include "modules/canvaskit/WasmCommon.h" to something in //src/core (except circular dependencies). We can probably address that using Bazel's visibility rules as needed: https://docs.bazel.build/versions/main/visibility.html https://docs.bazel.build/versions/main/be/functions.html#package_group It is recommended to look at this CL patchset by patchset. PS1: Update gazelle command to generate rules in more folders. PS2: A few changes to make generation work better. PS3: The result of running make generate in //bazel PS4: Adding the rules to build sksllex, the simplest binary I could find in the Skia repo. PS5: Adding the rules to build skdiff, a more complex binary. I tried a few approaches, but ended up gravitating back towards the layout where we have each folder/package group up the sources. I imagine at some point, we'll have skdiff depend on skia_core or something, which will have things like //src/core, //src/codecs, //src/pathops all bundled together. PS7: Added in the groupings of sources, similar to what we had earlier. I liked these for readability. These helped fix up the //:skia_core build, and by extension, the CanvasKit build. Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 13:15:24 +00:00
"imgui.h": "SK_GAZELLE_IGNORE TODO //third_party:imgui",
"png.h": "//third_party:libpng",
"jerror.h": "//third_party:libjpeg-turbo",
"jpeglib.h": "//third_party:libjpeg-turbo",
"webp/decode.h": "//third_party:libwebp",
"webp/demux.h": "//third_party:libwebp",
"webp/encode.h": "//third_party:libwebp",
"webp/mux.h": "//third_party:libwebp",
[bazel] Try adding cc_binary rules that use generated rules To make the atomic rules a bit easier to work with, in many of the folders, this adds in cc_library rules to group together the sources from that folder (and subfolders where prudent). We only needs sources because those atoms should have their headers as deps. One issue that was pointed out is that there is currently no way to restrict the inclusion of certain packages, a la, `gn check`. For example, there is no mechanism from stopping a dev from adding #include "modules/canvaskit/WasmCommon.h" to something in //src/core (except circular dependencies). We can probably address that using Bazel's visibility rules as needed: https://docs.bazel.build/versions/main/visibility.html https://docs.bazel.build/versions/main/be/functions.html#package_group It is recommended to look at this CL patchset by patchset. PS1: Update gazelle command to generate rules in more folders. PS2: A few changes to make generation work better. PS3: The result of running make generate in //bazel PS4: Adding the rules to build sksllex, the simplest binary I could find in the Skia repo. PS5: Adding the rules to build skdiff, a more complex binary. I tried a few approaches, but ended up gravitating back towards the layout where we have each folder/package group up the sources. I imagine at some point, we'll have skdiff depend on skia_core or something, which will have things like //src/core, //src/codecs, //src/pathops all bundled together. PS7: Added in the groupings of sources, similar to what we had earlier. I liked these for readability. These helped fix up the //:skia_core build, and by extension, the CanvasKit build. Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 13:15:24 +00:00
"microhttpd.h": "SK_GAZELLE_IGNORE TODO //third_party:microhttpd",
"src/piex.h": "//third_party:piex",
"sample/chromium/font_subsetter.h": "SK_GAZELLE_IGNORE TODO //third_party:sfntly",
"third_party/externals/spirv-cross/spirv_hlsl.hpp": "SK_GAZELLE_IGNORE TODO //third_party:spirv_cross",
"spirv-tools/libspirv.hpp": "SK_GAZELLE_IGNORE TODO //third_party:spirv_tools",
"vk_platform.h": "//include/third_party/vulkan/vulkan:vk_platform_hdr",
"vulkan_android.h": "//include/third_party/vulkan/vulkan:vulkan_android_hdr",
"vulkan_core.h": "//include/third_party/vulkan/vulkan:vulkan_core_hdr",
"vulkan_ios.h": "//include/third_party/vulkan/vulkan:vulkan_ios_hdr",
"vulkan_macos.h": "//include/third_party/vulkan/vulkan:vulkan_macos_hdr",
"vulkan_win32.h": "//include/third_party/vulkan/vulkan:vulkan_win32_hdr",
"vulkan_xcb.h": "//include/third_party/vulkan/vulkan:vulkan_xcb_hdr",
"vulkan/vulkan.h": "//include/third_party:skias_vulkan_headers",
"vulkan_beta.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_directfb.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_fuchsia.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_ggp.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_metal.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_screen.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_vi.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_wayland.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_xlib.h": "SK_GAZELLE_IGNORE not actually included by us",
"vulkan_xlib_xrandr.h": "SK_GAZELLE_IGNORE not actually included by us",
"GrVulkanMemoryAllocator.h": "//third_party:vulkanmemoryallocator",
"wuffs-v0.3.c": "//third_party:wuffs",
"zlib.h": "//third_party:zlib",
"HeifDecoderAPI.h": "SK_GAZELLE_IGNORE Android-only build",
"SkGifCodec.h": "SK_GAZELLE_IGNORE Deprecated gif library",
[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 12:35:26 +00:00
"log/log_main.h": "SK_GAZELLE_IGNORE",
"mozilla/mozalloc.h": "SK_GAZELLE_IGNORE",
"mozilla/mozalloc_abort.h": "SK_GAZELLE_IGNORE",
"mozilla/mozalloc_oom.h": "SK_GAZELLE_IGNORE",
"libavcodec/avcodec.h": "SK_GAZELLE_IGNORE for experimental/ffmpeg",
"libavformat/avformat.h": "SK_GAZELLE_IGNORE",
"libavformat/avio.h": "SK_GAZELLE_IGNORE",
"libavutil/pixdesc.h": "SK_GAZELLE_IGNORE",
"libswscale/swscale.h": "SK_GAZELLE_IGNORE"
}