-
Notifications
You must be signed in to change notification settings - Fork 32
docs: add cpp build guides with examples #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zhaohaidao
wants to merge
9
commits into
apache:main
Choose a base branch
from
zhaohaidao:feat/bzl-mgmt-docs-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6dad827
docs: add cpp system and build usage guides with examples
zhaohaidao 6f12dff
docs: use fluss-cpp module name and direct bazel cpp target
zhaohaidao 5833464
docs: remove hardcoded local path in bazel system example
zhaohaidao e4e8a5c
address comments
zhaohaidao 345b64e
address comments
zhaohaidao 439ffe1
address comments
zhaohaidao 72bf7af
address comments
zhaohaidao aab47d0
address comments
zhaohaidao ad458b9
address comments
zhaohaidao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # Required at repository root for root module mode (`bazel_dep(name = "fluss-cpp", ...)`). | ||
| # Consumer examples use `local_path_override(..., path = "/path/to/fluss-rust")`, so | ||
| # Bazel resolves the module from the repository root. This also matches the Rust | ||
| # workspace layout used by `bindings/cpp` during cargo-based Bazel/CMake builds. | ||
| # `0.0.0` is a local-development placeholder in this repository branch. | ||
| # Consumers should depend on a published release version. | ||
| module( | ||
| name = "fluss-cpp", | ||
| version = "0.0.0", | ||
| ) | ||
|
|
||
| bazel_dep(name = "rules_cc", version = "0.0.17") | ||
| bazel_dep(name = "platforms", version = "0.0.10") | ||
| bazel_dep(name = "rules_foreign_cc", version = "0.15.1") | ||
| bazel_dep(name = "rules_python", version = "1.2.0") | ||
|
|
||
| python = use_extension("@rules_python//python/extensions:python.bzl", "python") | ||
| python.toolchain(python_version = "3.12") | ||
| use_repo(python, "python_3_12") | ||
|
|
||
| foreign_cc_tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools") | ||
| use_repo( | ||
| foreign_cc_tools, | ||
| "cmake_3.31.8_toolchains", | ||
| "cmake_src", | ||
| "ninja_1.13.0_toolchains", | ||
| "ninja_build_src", | ||
| "rules_foreign_cc_framework_toolchains", | ||
| ) | ||
|
|
||
| register_toolchains( | ||
| "@rules_foreign_cc_framework_toolchains//:all", | ||
| "@cmake_3.31.8_toolchains//:all", | ||
| "@ninja_1.13.0_toolchains//:all", | ||
| "@python_3_12//:all", | ||
| "@rules_foreign_cc//toolchains:all", | ||
| ) | ||
|
|
||
| cpp_sdk = use_extension("//bindings/cpp/bazel/cpp:deps.bzl", "cpp_sdk") | ||
| cpp_sdk.config( | ||
| mode = "build", | ||
| arrow_cpp_version = "19.0.1", | ||
| protobuf_version = "3.25.5", | ||
| ep_cmake_ranlib = "/usr/bin/ranlib", | ||
| ep_cmake_ar = "/usr/bin/ar", | ||
| ep_cmake_nm = "/usr/bin/nm", | ||
| ) | ||
| use_repo(cpp_sdk, "apache_arrow_cpp") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| # Stable indirection target for the Arrow C++ dependency. The implementation | ||
| # repo name can change across modes (registry/build/system) without touching | ||
| # bindings/cpp/BUILD.bazel. | ||
| alias( | ||
| name = "arrow_cpp_dep", | ||
| actual = "@apache_arrow_cpp//:arrow_cpp", | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FetchContent_Declare(apache_arrow_src ...)pulls the Arrow C++ source from${FLUSS_CPP_ARROW_SOURCE_URL}without specifying a hash or other integrity verification. If the download is tampered with (e.g., compromised mirror, DNS poisoning, or MITM), CMake will build and link against attacker-controlled Arrow code in your C++ bindings. Add an integrity check (such asURL_HASHwith a pinned digest) for the Arrow archive to ensure the downloaded contents are exactly the expected release.