From 8949bbe68a7d7827941f06346c495629bde0e19f Mon Sep 17 00:00:00 2001 From: Connor McEntee Date: Mon, 14 Apr 2025 21:49:40 -0600 Subject: [PATCH] fix: build with --stamp --- MODULE.bazel | 2 +- MODULE.bazel.lock | 28 ++----------- examples/transition_settings.bzl | 60 --------------------------- include/jemalloc/BUILD.bazel | 5 ++- include/jemalloc/internal/BUILD.bazel | 6 ++- test/BUILD.bazel | 2 +- test/integration/BUILD.bazel | 4 +- test/unit/BUILD.bazel | 4 +- tools/BUILD.bazel | 0 9 files changed, 16 insertions(+), 95 deletions(-) delete mode 100644 examples/transition_settings.bzl create mode 100644 tools/BUILD.bazel diff --git a/MODULE.bazel b/MODULE.bazel index cee2ba20..e743a4d7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "jemalloc", - version = "5.3.0-bcr.alpha.1", + version = "5.3.0-bcr.alpha.2", bazel_compatibility = [">=7.2.1"], compatibility_level = 5, ) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 2c68d75f..a9f38588 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -89,8 +89,8 @@ "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", - "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", - "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960", + "https://bcr.bazel.build/modules/rules_java/8.11.0/MODULE.bazel": "c3d280bc5ff1038dcb3bacb95d3f6b83da8dd27bba57820ec89ea4085da767ad", + "https://bcr.bazel.build/modules/rules_java/8.11.0/source.json": "302b52a39259a85aa06ca3addb9787864ca3e03b432a5f964ea68244397e7544", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", @@ -600,28 +600,6 @@ ] } }, - "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { - "general": { - "bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=", - "usagesDigest": "jTQDdLDxsS43zuRmg1faAjIEPWdLAbDAowI1pInQSoo=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "compatibility_proxy": { - "repoRuleId": "@@rules_java+//java:rules_java_deps.bzl%_compatibility_proxy_repo_rule", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "rules_java+", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { "bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=", @@ -688,7 +666,7 @@ }, "@@rules_python+//python/private/pypi:pip.bzl%pip_internal": { "general": { - "bzlTransitiveDigest": "Ktlvuwl7iL6H5Xizfvv0C5YgMwxj7b5iMqQlU33QDP4=", + "bzlTransitiveDigest": "hvKweoM9/zduyw8QX3arHXJQWZdHQBLRU6qcww8Z0So=", "usagesDigest": "OLoIStnzNObNalKEMRq99FqenhPGLFZ5utVLV4sz7OI=", "recordedFileInputs": { "@@rules_python+//tools/publish/requirements_darwin.txt": "2994136eab7e57b083c3de76faf46f70fad130bc8e7360a7fed2b288b69e79dc", diff --git a/examples/transition_settings.bzl b/examples/transition_settings.bzl deleted file mode 100644 index 2cfc2a29..00000000 --- a/examples/transition_settings.bzl +++ /dev/null @@ -1,60 +0,0 @@ -def _settings_transition_impl(settings, attr): - return { - "@jemalloc//settings/flags:jemalloc_prefix": "je_", - "@jemalloc//settings/flags:jemalloc_cprefix": "JE_", - } - -_settings_transition = transition( - implementation = _settings_transition_impl, - inputs = [ - "@jemalloc//settings/flags:jemalloc_prefix", - "@jemalloc//settings/flags:jemalloc_cprefix", - ], - outputs = [ - "@jemalloc//settings/flags:jemalloc_prefix", - "@jemalloc//settings/flags:jemalloc_cprefix", - # "//settings/platform:lg_page", - ], -) - -def _transition_settings_impl(ctx): - return [ctx.attr.src[0][DefaultInfo]] - -# target = ctx.attr.src -# possible_providers = [ -# DefaultInfo, -# CcInfo, -# InstrumentedFilesInfo, -# OutputGroupInfo, -# ] -# -# print(target[0]) -# -# return [target[0][provider] for provider in possible_providers if provider in target[0]] - -transition_settings = rule( - implementation = _transition_settings_impl, - attrs = { - "target": attr.label(cfg = _settings_transition), - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), - }, -) - -platform_transition_binary = rule( - implementation = _platform_transition_binary_impl, - attrs = { - "basename": attr.string(), - "binary": attr.label(allow_files = True, cfg = binary_cfg), - "target_platform": attr.label( - doc = "The target platform to transition the binary.", - mandatory = True, - ), - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), - }, - executable = True, - doc = "Transitions the binary to use the provided platform. Will forward RunEnvironmentInfo", -) diff --git a/include/jemalloc/BUILD.bazel b/include/jemalloc/BUILD.bazel index bd72b89e..2552145e 100644 --- a/include/jemalloc/BUILD.bazel +++ b/include/jemalloc/BUILD.bazel @@ -1,13 +1,14 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") -load("//:tools/autoconf.bzl", "configure_header", "define_macro_if", "define_macro_with") -load("//:tools/version.bzl", "parse_version") +load("//tools:autoconf.bzl", "configure_header", "define_macro_if", "define_macro_with") +load("//tools:version.bzl", "parse_version") version = parse_version(module_version()) configure_header( name = "jemalloc_defs", out = "jemalloc_defs.h", + stamp = 0, substitutions = define_macro_if("JEMALLOC_HAVE_ATTR_ALLOC_SIZE", "//settings/compiler:gcc_compatible") | define_macro_if("JEMALLOC_HAVE_ATTR_FORMAT_ARG", "//settings/compiler:gcc_compatible") | diff --git a/include/jemalloc/internal/BUILD.bazel b/include/jemalloc/internal/BUILD.bazel index 59c08513..03b3f2d3 100644 --- a/include/jemalloc/internal/BUILD.bazel +++ b/include/jemalloc/internal/BUILD.bazel @@ -1,8 +1,8 @@ load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template") load("@bazel_skylib//lib:selects.bzl", "selects") load("@rules_cc//cc:defs.bzl", "cc_library") -load("//:tools/autoconf.bzl", "configure_header", "define_macro_if", "define_macro_if_any", "define_macro_if_with", "define_macro", "define_macro_with", "undefine_macro") -load("//:tools/version.bzl", "parse_version") +load("//tools:autoconf.bzl", "configure_header", "define_macro", "define_macro_if", "define_macro_if_any", "define_macro_if_with", "define_macro_with", "undefine_macro") +load("//tools:version.bzl", "parse_version") load(":private_namespace.bzl", "private_namespace") load(":public_symbols.bzl", "public_symbols") @@ -148,6 +148,7 @@ cc_library( expand_template( name = "jemalloc_preamble", out = "jemalloc_preamble.h", + stamp = 0, substitutions = { "@install_suffix@": "", "@private_namespace@": "je_", @@ -224,6 +225,7 @@ selects.config_setting_group( configure_header( name = "jemalloc_internal_defs", out = "jemalloc_internal_defs.h", + stamp = 0, substitutions = select({ "//settings/flags:no_jemalloc_prefix": undefine_macro("JEMALLOC_PREFIX") | diff --git a/test/BUILD.bazel b/test/BUILD.bazel index c31f8444..3b6b04bc 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -1,6 +1,6 @@ load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@rules_cc//cc:defs.bzl", "cc_library") -load("//:tools/cc.bzl", "COPTS") +load("//tools:cc.bzl", "COPTS") expand_template( name = "jemalloc_test", diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel index b9ea8db7..e9140e30 100644 --- a/test/integration/BUILD.bazel +++ b/test/integration/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//:tools/cc.bzl", "COPTS") -load("//:tools/transition.bzl", "PLATFORM", "transition_default_constraints") +load("//tools:cc.bzl", "COPTS") +load("//tools:transition.bzl", "PLATFORM", "transition_default_constraints") INTEGRATION_TESTS = [ {"src": "allocated.c"}, diff --git a/test/unit/BUILD.bazel b/test/unit/BUILD.bazel index 42d9429f..b9f932fe 100644 --- a/test/unit/BUILD.bazel +++ b/test/unit/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//:tools/cc.bzl", "COPTS") -load("//:tools/transition.bzl", "PLATFORM", "transition_default_constraints") +load("//tools:cc.bzl", "COPTS") +load("//tools:transition.bzl", "PLATFORM", "transition_default_constraints") # TODO: Handle conf when enable_prof = True #{ "src": "batch_alloc_prof.c" }, diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel new file mode 100644 index 00000000..e69de29b