From fccc500b3ec14562a474b5cdf175e0cdc88206e2 Mon Sep 17 00:00:00 2001 From: Markus Hofauer Date: Fri, 20 Dec 2024 11:26:42 +0100 Subject: [PATCH 1/6] Add std --- .../stb/0.0.0-20241109-5c20573/MODULE.bazel | 7 +++++++ .../0.0.0-20241109-5c20573/overlay/BUILD.bazel | 11 +++++++++++ .../overlay/MODULE.bazel | 1 + .../stb/0.0.0-20241109-5c20573/presubmit.yml | 18 ++++++++++++++++++ modules/stb/0.0.0-20241109-5c20573/source.json | 10 ++++++++++ modules/stb/metadata.json | 16 ++++++++++++++++ 6 files changed, 63 insertions(+) create mode 100644 modules/stb/0.0.0-20241109-5c20573/MODULE.bazel create mode 100644 modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel create mode 120000 modules/stb/0.0.0-20241109-5c20573/overlay/MODULE.bazel create mode 100644 modules/stb/0.0.0-20241109-5c20573/presubmit.yml create mode 100644 modules/stb/0.0.0-20241109-5c20573/source.json create mode 100644 modules/stb/metadata.json diff --git a/modules/stb/0.0.0-20241109-5c20573/MODULE.bazel b/modules/stb/0.0.0-20241109-5c20573/MODULE.bazel new file mode 100644 index 00000000000..1fc1547b323 --- /dev/null +++ b/modules/stb/0.0.0-20241109-5c20573/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "stb", + version = "0.0.0-20241109-5c20573", + compatibility_level = 0, +) + +bazel_dep(name = "rules_cc", version = "0.0.17") diff --git a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel new file mode 100644 index 00000000000..0e20e9a3379 --- /dev/null +++ b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel @@ -0,0 +1,11 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +cc_library( + name = "stb", + hdrs = glob([ + "*.h", + ]), + defines = ["STB_IMAGE_IMPLEMENTATION"], + includes = [""], + visibility = ["//visibility:public"], +) diff --git a/modules/stb/0.0.0-20241109-5c20573/overlay/MODULE.bazel b/modules/stb/0.0.0-20241109-5c20573/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/stb/0.0.0-20241109-5c20573/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/stb/0.0.0-20241109-5c20573/presubmit.yml b/modules/stb/0.0.0-20241109-5c20573/presubmit.yml new file mode 100644 index 00000000000..c8d5c92a348 --- /dev/null +++ b/modules/stb/0.0.0-20241109-5c20573/presubmit.yml @@ -0,0 +1,18 @@ +matrix: + platform: + - debian10 + - debian11 + - macos + - macos_arm64 + - ubuntu2004 + - ubuntu2204 + - ubuntu2404 + - windows + bazel: [7.x, 8.x] +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - '@stb//...' diff --git a/modules/stb/0.0.0-20241109-5c20573/source.json b/modules/stb/0.0.0-20241109-5c20573/source.json new file mode 100644 index 00000000000..07d69f2d301 --- /dev/null +++ b/modules/stb/0.0.0-20241109-5c20573/source.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/nothings/stb/archive/5c205738c191bcb0abc65c4febfa9bd25ff35234.tar.gz", + "integrity": "sha256-z+q5+ACWGILW0i3fNullUjszAC9Pk33ggyEwTJunKvM=", + "strip_prefix": "stb-5c205738c191bcb0abc65c4febfa9bd25ff35234", + "patch_strip": 0, + "overlay": { + "BUILD.bazel": "sha256-OcVFcbhTthnOOZKnk0IFxp1pL9mcmaRAenyxLiI0n1Y=", + "MODULE.bazel": "sha256-OVRPBnEBUp917qFg9XnpqBYVfVkWDYRT5BHJgnjkcxI=" + } +} diff --git a/modules/stb/metadata.json b/modules/stb/metadata.json new file mode 100644 index 00000000000..7d8d295a94a --- /dev/null +++ b/modules/stb/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/nothings/stb", + "maintainers": [ + { + "github": "hofbi", + "name": "Markus Hofbauer" + } + ], + "repository": [ + "github:nothings/stb" + ], + "versions": [ + "0.0.0-20241109-5c20573" + ], + "yanked_versions": {} +} From d6f11a004bb716d6aa6713292cf1ae6d5239d9c6 Mon Sep 17 00:00:00 2001 From: Markus Hofauer Date: Fri, 20 Dec 2024 11:35:40 +0100 Subject: [PATCH 2/6] fix includes --- modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel | 2 +- modules/stb/0.0.0-20241109-5c20573/source.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel index 0e20e9a3379..0509db5abd6 100644 --- a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel +++ b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel @@ -6,6 +6,6 @@ cc_library( "*.h", ]), defines = ["STB_IMAGE_IMPLEMENTATION"], - includes = [""], + includes = ["."], visibility = ["//visibility:public"], ) diff --git a/modules/stb/0.0.0-20241109-5c20573/source.json b/modules/stb/0.0.0-20241109-5c20573/source.json index 07d69f2d301..5db145adde0 100644 --- a/modules/stb/0.0.0-20241109-5c20573/source.json +++ b/modules/stb/0.0.0-20241109-5c20573/source.json @@ -4,7 +4,7 @@ "strip_prefix": "stb-5c205738c191bcb0abc65c4febfa9bd25ff35234", "patch_strip": 0, "overlay": { - "BUILD.bazel": "sha256-OcVFcbhTthnOOZKnk0IFxp1pL9mcmaRAenyxLiI0n1Y=", + "BUILD.bazel": "sha256-W1YYCQ6iXWUYIqoTidf0nlQNpM3kBoK1Fjm3/Me8ThM=", "MODULE.bazel": "sha256-OVRPBnEBUp917qFg9XnpqBYVfVkWDYRT5BHJgnjkcxI=" } } From e96750fcf70edb2c264e944cbbb9f7bc48a53f13 Mon Sep 17 00:00:00 2001 From: Markus Hofauer Date: Fri, 20 Dec 2024 12:27:31 +0100 Subject: [PATCH 3/6] try one lib per header --- .../overlay/BUILD.bazel | 19 +++++++++++++++---- .../stb/0.0.0-20241109-5c20573/presubmit.yml | 3 +++ .../stb/0.0.0-20241109-5c20573/source.json | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel index 0509db5abd6..0b679399886 100644 --- a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel +++ b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel @@ -1,11 +1,22 @@ load("@rules_cc//cc:defs.bzl", "cc_library") cc_library( - name = "stb", - hdrs = glob([ - "*.h", - ]), + name = "stb_image", + hdrs = ["stb_image.h"], defines = ["STB_IMAGE_IMPLEMENTATION"], includes = ["."], visibility = ["//visibility:public"], ) + +[ + cc_library( + name = "stb_{suffix}".format(suffix = suffix), + hdrs = ["stb_{suffix}.h".format(suffix = suffix)], + includes = ["."], + visibility = ["//visibility:public"], + ) + for suffix in glob( + "stb_*.h", + exclude = ["stb_image.h"], + ) +] diff --git a/modules/stb/0.0.0-20241109-5c20573/presubmit.yml b/modules/stb/0.0.0-20241109-5c20573/presubmit.yml index c8d5c92a348..ce559aac577 100644 --- a/modules/stb/0.0.0-20241109-5c20573/presubmit.yml +++ b/modules/stb/0.0.0-20241109-5c20573/presubmit.yml @@ -14,5 +14,8 @@ tasks: name: Verify build targets platform: ${{ platform }} bazel: ${{ bazel }} + build_flags: + - '--process_headers_in_dependencies' + - '--features=parse_headers' build_targets: - '@stb//...' diff --git a/modules/stb/0.0.0-20241109-5c20573/source.json b/modules/stb/0.0.0-20241109-5c20573/source.json index 5db145adde0..5a2f7eb3775 100644 --- a/modules/stb/0.0.0-20241109-5c20573/source.json +++ b/modules/stb/0.0.0-20241109-5c20573/source.json @@ -4,7 +4,7 @@ "strip_prefix": "stb-5c205738c191bcb0abc65c4febfa9bd25ff35234", "patch_strip": 0, "overlay": { - "BUILD.bazel": "sha256-W1YYCQ6iXWUYIqoTidf0nlQNpM3kBoK1Fjm3/Me8ThM=", + "BUILD.bazel": "sha256-PxUR5yrclDfI7Gh7NDbl4ApWmBhNdp0sFu/eJ9OH+GA=", "MODULE.bazel": "sha256-OVRPBnEBUp917qFg9XnpqBYVfVkWDYRT5BHJgnjkcxI=" } } From 045ed5574cc33f7318ed95daaae80d12750274b4 Mon Sep 17 00:00:00 2001 From: Markus Hofauer Date: Fri, 20 Dec 2024 18:15:43 +0100 Subject: [PATCH 4/6] ifx glob --- modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel index 0b679399886..af965e05205 100644 --- a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel +++ b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel @@ -16,7 +16,7 @@ cc_library( visibility = ["//visibility:public"], ) for suffix in glob( - "stb_*.h", + ["stb_*.h"], exclude = ["stb_image.h"], ) ] From 8b43c5de89d40dbb05ce376640350b4dc65f21f9 Mon Sep 17 00:00:00 2001 From: Markus Hofauer Date: Fri, 20 Dec 2024 18:16:55 +0100 Subject: [PATCH 5/6] fix integrety --- modules/stb/0.0.0-20241109-5c20573/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/stb/0.0.0-20241109-5c20573/source.json b/modules/stb/0.0.0-20241109-5c20573/source.json index 5a2f7eb3775..f5d2b0f15f8 100644 --- a/modules/stb/0.0.0-20241109-5c20573/source.json +++ b/modules/stb/0.0.0-20241109-5c20573/source.json @@ -4,7 +4,7 @@ "strip_prefix": "stb-5c205738c191bcb0abc65c4febfa9bd25ff35234", "patch_strip": 0, "overlay": { - "BUILD.bazel": "sha256-PxUR5yrclDfI7Gh7NDbl4ApWmBhNdp0sFu/eJ9OH+GA=", + "BUILD.bazel": "sha256-nEsvXzefASwwXp4ApdrZRv5Ih9Z0HQeSanXdQMRmChE=", "MODULE.bazel": "sha256-OVRPBnEBUp917qFg9XnpqBYVfVkWDYRT5BHJgnjkcxI=" } } From abf842fc77d18d8711c81fac36a742996f012874 Mon Sep 17 00:00:00 2001 From: Markus Hofauer Date: Fri, 20 Dec 2024 18:19:25 +0100 Subject: [PATCH 6/6] fix loop --- modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel | 6 +++--- modules/stb/0.0.0-20241109-5c20573/source.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel index af965e05205..33fb98c9b57 100644 --- a/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel +++ b/modules/stb/0.0.0-20241109-5c20573/overlay/BUILD.bazel @@ -10,12 +10,12 @@ cc_library( [ cc_library( - name = "stb_{suffix}".format(suffix = suffix), - hdrs = ["stb_{suffix}.h".format(suffix = suffix)], + name = header.split(".")[0], + hdrs = [header], includes = ["."], visibility = ["//visibility:public"], ) - for suffix in glob( + for header in glob( ["stb_*.h"], exclude = ["stb_image.h"], ) diff --git a/modules/stb/0.0.0-20241109-5c20573/source.json b/modules/stb/0.0.0-20241109-5c20573/source.json index f5d2b0f15f8..0d041a9e69e 100644 --- a/modules/stb/0.0.0-20241109-5c20573/source.json +++ b/modules/stb/0.0.0-20241109-5c20573/source.json @@ -4,7 +4,7 @@ "strip_prefix": "stb-5c205738c191bcb0abc65c4febfa9bd25ff35234", "patch_strip": 0, "overlay": { - "BUILD.bazel": "sha256-nEsvXzefASwwXp4ApdrZRv5Ih9Z0HQeSanXdQMRmChE=", + "BUILD.bazel": "sha256-kZIQc1csNAuEu8Elo8OMJksy7ZJbDfXkXqgYNSLLUYU=", "MODULE.bazel": "sha256-OVRPBnEBUp917qFg9XnpqBYVfVkWDYRT5BHJgnjkcxI=" } }