mirror of
https://github.com/Tencent/flare.git
synced 2026-10-18 13:40:45 +08:00
362e00a180
* docs(readme): update for C++20 + macOS support, retranslate zh/en Bring both READMEs in line with the project's current state: * C++ badge upgraded from a generic ``C++`` to ``C++20`` to match the actual standard the project compiles with (``-std=gnu++2a``). * Platform badge upgraded from ``linux`` to ``linux | macOS`` -- macOS port landed in #158, CI matrix in #167 onwards. * Features section: drop the historical ``C++11/14/17/2a`` mix in favor of just ``C++20`` (the standard is committed; the staged adoption is no longer informative for a new reader). * System Requirements section split into ``Linux`` and ``macOS`` subsections, each listing the supported kernel/OS and the minimum toolchain that ships ``std::atomic<T>::wait`` / ``notify_*``: - Linux: GCC 11+ (libstdc++ added the operations in 11.1, per P1135 -- exposed locally on flare/fiber/detail/scheduling_group after the futex path went away in #158). - macOS: 13 (Ventura) or later with Apple Clang from Xcode 14+ (its libc++ has the matching runtime symbols). Also calls out aarch64 / arm64 / x86_64 explicitly. * Retranslated the zh README to read more like native Chinese -- the previous version had several literal-translation-isms ("吸收先前服务 框架"... etc.). Cross-checked the en against the zh and rewrote several en sentences that drifted out of step over the years (badge alt text, "out of the box" phrasing, the third-party tarball blurb, etc.). Both files now describe the same project in the same shape. * Added a back-link from the en README to the zh one (was one-way before). * Updated the blade-build link from chen3feng/blade-build to blade-build/blade-build (org moved). * Fixed bazel/support/README.md link typo (was REAMD.md). No code changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: fix two markdown-link-check failures surfaced by the README PR * Rename `bazel/support/REAMD.md` -> `bazel/support/README.md`. The file has carried the swapped-letter spelling since 2023; the previous README link pointed at the typo'd name, so it was working by accident. The README rewrite in this PR pointed at the canonical spelling and surfaced that the file on disk was wrong. * Add `.github/markdown-link-check-config.json` to suppress the spurious "Status: 0" failure for `https://bazel.build`. The site returns a valid 200 to a normal browser and to `curl`, but apparently UA-filters the markdown-link-check action -- the action reads Status 0 and counts it as broken. Listed it in `ignorePatterns`; wired the config into the existing `gaurav-nelson/github-action-markdown-link-check@v1` invocation via the documented `config-file` input. Also bumps `retryOn429` (small reliability win when the action hits rate limits) and pins the success set to 200/206. Both surfaced by CI on this PR; no other changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Bazel Support
Bazel Install
- Make sure that Bazel is installed on your system.
Ubuntu/Debian
Fedroa/Centos
Arch/Manjaro
sudo pacman -S bazel
Compile and build with bazel on flare
git clone https://github.com/Tencent/flare.git
cd flare
bazel build ... # compile all target
bazel test ... # compile and execute tests
- See this get more infomation
...Indicates recursively scan all targets, recognized as../..inoh-my-zsh, can be replaced by othershellorbash -c 'commond'to run, such asbash -c 'bazel build' ...or usebazel build ...:all
Using {flare} as a dependency
The following minimal example shows how to use {flare} as a dependency within a Bazel project.
The following file structure is assumed:
.
├── .bazelrc
├── BUILD.bazel
├── .gitignore
├── main.cc
├── REAMD.md
└── WORKSPACE.bazel
You can find these files in this directory.
#include "flare/base/logging.h"
int main(int argc, char **argv) { FLARE_LOG_INFO("Hello flare!"); }
The expected output of this example is Hello flare!.
WORKSPACE.bazel
You can also use the http_archive method to download flare:
# Use http_archive
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
FLARE_VERSION = ""
FLARE_SHA256 = ""
http_archive(
name = "com_github_tencent_flare",
sha256 = FLARE_SHA256,
urls = ["https://github.com/Tencent/flare/archive/refs/tags/{version}.zip".format(version = FLARE_VERSION)],
strip_prefix = "flare-{version}".format(version = FLARE_VERSION),
)
load("@com_github_tencent_flare//bazel:deps.bzl", "flare_dependencies")
flare_dependencies()
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
cc_binary(
name = "main",
srcs = ["main.cc"],
deps = [
"@com_github_tencent_flare//flare/base:logging",
],
)
The BUILD file defines a binary named main that has a dependency to {flare}.
To execute the binary, you can run bazel run //:main.