Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bazel_dep(name = "rules_shell", version = "0.5.0")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
bazel_dep(name = "fmt", version = "10.0.0")
bazel_dep(name = "fmt", version = "12.1.0-codeql.1")
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.1")
bazel_dep(name = "gazelle", version = "0.40.0")
bazel_dep(name = "rules_dotnet", version = "0.19.2-codeql.1")
Expand Down
26 changes: 21 additions & 5 deletions misc/bazel/registry/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def patch_json(file, **kwargs):
def update(data):
data = json.loads(data) if data else {}
data.update(kwargs)
for k, v in kwargs.items():
if v is None:
data.pop(k)
return json.dumps(data, indent=4) + "\n"

patch_file(file, update)
Expand All @@ -48,8 +51,21 @@ def update(data):
patch_json(entry / "metadata.json", versions=[v.name for v in versions])

for version in versions:
patch_json(version / "source.json", patches={
p.name: sha256(p) for p in version.joinpath("patches").iterdir()
})
patch_file(version / "MODULE.bazel",
lambda s: re.sub(r'''version\s*=\s*['"].*['"]''', f'version = "{version.name}"', s, 1))
patches = version.joinpath("patches")
overlay = version.joinpath("overlay")
modules = [version / "MODULE.bazel", overlay / "MODULE.bazel"]
for module in modules:
if module.is_file():
patch_file(
module,
lambda s: re.sub(r'''version\s*=\s*['"].*['"]''', f'version = "{version.name}"', s, 1))
patch_json(
version / "source.json",
patches={
p.name: sha256(p) for p in patches.iterdir()
} if patches.is_dir() else None,
patch_strip=1 if patches.is_dir() else None,
overlay={
o.name: sha256(o) for o in overlay.iterdir()
} if overlay.is_dir() else None,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "fmt",
version = "12.1.0-codeql.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 10,
)

bazel_dep(name = "rules_cc", version = "0.2.13")
bazel_dep(name = "rules_license", version = "1.0.0")
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_license//rules:license.bzl", "license")

package(
default_applicable_licenses = [":license"],
)

exports_files([
"LICENSE",
])

license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:MIT"],
license_text = "LICENSE",
)

cc_library(
name = "fmt",
srcs = [
#"src/fmt.cc", # No C++ module support, yet in Bazel (https://github.com/bazelbuild/bazel/pull/19940)
"src/format.cc",
"src/os.cc",
],
hdrs = glob([
"include/fmt/*.h",
]),
# codeql change: disable UTF8 support, it's causing issues on Windows
# copts = select({
# "@rules_cc//cc/compiler:msvc-cl": ["/utf-8"],
# "//conditions:default": [],
# }),
defines = select({
"@rules_cc//cc/compiler:msvc-cl": ["FMT_UNICODE=0"],
"//conditions:default": [],
}),
includes = ["include"],
strip_include_prefix = "include", # workaround: only needed on some macOS systems (see https://github.com/bazelbuild/bazel-central-registry/issues/1537)
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "fmt",
version = "12.1.0-codeql.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 10,
)

bazel_dep(name = "rules_cc", version = "0.2.13")
bazel_dep(name = "rules_license", version = "1.0.0")
9 changes: 9 additions & 0 deletions misc/bazel/registry/modules/fmt/12.1.0-codeql.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/fmtlib/fmt/releases/download/12.1.0/fmt-12.1.0.zip",
"integrity": "sha256-aV/Rl/pa/4/Ge18rvBEEkKh1zfekFoashRL7SA+orac=",
"strip_prefix": "fmt-12.1.0",
"overlay": {
"BUILD.bazel": "sha256-T6CBBdPY92Iloq9NrMjm9kQeQA3nTZJeym6xG5cclOQ=",
"MODULE.bazel": "sha256-Dgke/2OMsffv9jPSDxIwIgJIb4L77VW6lR8TsNHsekg="
}
}
22 changes: 22 additions & 0 deletions misc/bazel/registry/modules/fmt/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"homepage": "https://github.com/fmtlib/fmt",
"maintainers": [
{
"email": "[email protected]",
"github": "Vertexwahn",
"github_user_id": 3775001,
"name": "Julian Amann"
},
{
"github": "mering",
"github_user_id": 133344217
}
],
"repository": [
"github:fmtlib/fmt"
],
"versions": [
"12.1.0-codeql.1"
],
"yanked_versions": {}
}
20 changes: 0 additions & 20 deletions swift/logging/Formatters.h

This file was deleted.

3 changes: 1 addition & 2 deletions swift/logging/SwiftLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#include <fmt/format.h>
#include <fmt/chrono.h>

#include "swift/logging/Formatters.h"
#include <fmt/std.h>

#include <binlog/binlog.hpp>
#include <binlog/TextOutputStream.hpp>
Expand Down
Loading