From bde96c5aa63cc620209184d55b14cddb885a8e58 Mon Sep 17 00:00:00 2001 From: Eugene Kliuchnikov Date: Wed, 18 Dec 2024 10:47:32 +0100 Subject: [PATCH] skcms fixup: link missing symbols (#3391) BUILD file provided in initial module release was stale --- modules/skcms/20241202.0.bcr.1/MODULE.bazel | 7 + .../20241202.0.bcr.1/overlay/BUILD.bazel | 120 ++++++++++++++++++ .../20241202.0.bcr.1/overlay/MODULE.bazel | 1 + modules/skcms/20241202.0.bcr.1/presubmit.yml | 22 ++++ modules/skcms/20241202.0.bcr.1/source.json | 10 ++ modules/skcms/metadata.json | 3 +- 6 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 modules/skcms/20241202.0.bcr.1/MODULE.bazel create mode 100644 modules/skcms/20241202.0.bcr.1/overlay/BUILD.bazel create mode 120000 modules/skcms/20241202.0.bcr.1/overlay/MODULE.bazel create mode 100644 modules/skcms/20241202.0.bcr.1/presubmit.yml create mode 100644 modules/skcms/20241202.0.bcr.1/source.json diff --git a/modules/skcms/20241202.0.bcr.1/MODULE.bazel b/modules/skcms/20241202.0.bcr.1/MODULE.bazel new file mode 100644 index 00000000000..58d8f759148 --- /dev/null +++ b/modules/skcms/20241202.0.bcr.1/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "skcms", + version = "20241202.0.bcr.1", + repo_name = "skcms", + compatibility_level = 1, +) +bazel_dep(name = "platforms", version = "0.0.10") diff --git a/modules/skcms/20241202.0.bcr.1/overlay/BUILD.bazel b/modules/skcms/20241202.0.bcr.1/overlay/BUILD.bazel new file mode 100644 index 00000000000..d4a7ad6d970 --- /dev/null +++ b/modules/skcms/20241202.0.bcr.1/overlay/BUILD.bazel @@ -0,0 +1,120 @@ +# Pruned copy of https://skia.googlesource.com/skcms/+/refs/heads/main/BUILD.bazel + +config_setting( + name = "debug_build", + values = {"compilation_mode": "dbg"}, +) +config_setting( + name = "fast_build", + values = {"compilation_mode": "fastbuild"}, +) +config_setting( + name = "release_build", + values = {"compilation_mode": "opt"}, +) + +######### +# SkCMS # +######### +SHARED_COPTS = select({ + ":debug_build": [ + "--optimize=0", + "--debug", + ], + ":release_build": [ + "--optimize=3", + # Strip dead code (in conjunction with linkopts) + "-fdata-sections", + "-ffunction-sections", + ], + ":fast_build": [ + "--optimize=0", + ], +}) +cc_library( + name = "skcms_public", + srcs = [ + "skcms.cc", + "src/skcms_internals.h", + "src/skcms_public.h", + ], + hdrs = ["skcms.h"], + deps = [":skcms_TransformBaseline"] + + select({ + "@platforms//cpu:x86_64": [ + ":skcms_TransformHsw", + ":skcms_TransformSkx", + ], + "//conditions:default": [], + }), + copts = SHARED_COPTS, +) +cc_library( + name = "skcms_TransformBaseline", + srcs = [ + "src/skcms_Transform.h", + "src/skcms_TransformBaseline.cc", + "src/skcms_internals.h", + "src/skcms_public.h", + ], + # This header does not compile on its own and is meant to be included from skcms_Transform*.cc + textual_hdrs = [ + "src/Transform_inl.h", + ], + copts = SHARED_COPTS, +) +cc_library( + name = "skcms_TransformHsw", + srcs = [ + "src/skcms_Transform.h", + "src/skcms_TransformHsw.cc", + "src/skcms_internals.h", + "src/skcms_public.h", + ], + copts = SHARED_COPTS + select({ + "@platforms//cpu:x86_64": [ + "-mavx2", + "-mf16c", + ], + "//conditions:default": [], + }), + # This header does not compile on its own and is meant to be included from skcms_Transform*.cc + textual_hdrs = [ + "src/Transform_inl.h", + ], +) +cc_library( + name = "skcms_TransformSkx", + srcs = [ + "src/skcms_Transform.h", + "src/skcms_TransformSkx.cc", + "src/skcms_internals.h", + "src/skcms_public.h", + ], + copts = SHARED_COPTS + select({ + "@platforms//cpu:x86_64": [ + "-mavx512f", + "-mavx512dq", + "-mavx512cd", + "-mavx512bw", + "-mavx512vl", + ], + "//conditions:default": [], + }), + # This header does not compile on its own and is meant to be included from skcms_Transform*.cc + textual_hdrs = [ + "src/Transform_inl.h", + ], +) +cc_library( + name = "skcms", + hdrs = ["skcms.h"], + visibility = ["//visibility:public"], + deps = [ + ":skcms_TransformBaseline", + ":skcms_TransformHsw", + ":skcms_TransformSkx", + ":skcms_public", + ], + copts = SHARED_COPTS, +) diff --git a/modules/skcms/20241202.0.bcr.1/overlay/MODULE.bazel b/modules/skcms/20241202.0.bcr.1/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/skcms/20241202.0.bcr.1/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/skcms/20241202.0.bcr.1/presubmit.yml b/modules/skcms/20241202.0.bcr.1/presubmit.yml new file mode 100644 index 00000000000..700d8bd78f8 --- /dev/null +++ b/modules/skcms/20241202.0.bcr.1/presubmit.yml @@ -0,0 +1,22 @@ +matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + - windows + bazel: + - 7.x + - 8.x + build_flags: + - ['--compilation_mode=fastbuild'] + - ['--compilation_mode=opt'] + - ['--compilation_mode=dbg'] +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - '@skcms//:skcms' + build_flags: ${{ build_flags }} diff --git a/modules/skcms/20241202.0.bcr.1/source.json b/modules/skcms/20241202.0.bcr.1/source.json new file mode 100644 index 00000000000..3d642c9b92a --- /dev/null +++ b/modules/skcms/20241202.0.bcr.1/source.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/google/skia/archive/cfb2537954542e3803c8ecc7fdc7969920cb1776.tar.gz", + "integrity": "sha256-8/jlAZSiBObk/VwPGJoKmrQTnLfKNi3HakmC2xMCoHk=", + "strip_prefix": "skia-cfb2537954542e3803c8ecc7fdc7969920cb1776/modules/skcms", + "patch_strip": 0, + "overlay": { + "BUILD.bazel": "sha256-UXjqgVKqQquxbVMEfCS5zCB/O24FyYeduZiUbXeZW70=", + "MODULE.bazel": "sha256-mh8A3QA4w/UC5Z4vLw4/fGJhzPIDOMyi/Z18loitju4=" + } +} diff --git a/modules/skcms/metadata.json b/modules/skcms/metadata.json index 3f2fd3c628b..db1a2188592 100644 --- a/modules/skcms/metadata.json +++ b/modules/skcms/metadata.json @@ -12,7 +12,8 @@ "github:google/skia" ], "versions": [ - "20241202.0" + "20241202.0", + "20241202.0.bcr.1" ], "yanked_versions": {} }