docs: add Building from source section to CONTRIBUTING.md (#26364)

pull/26365/head
Trevor Hilton 2025-05-07 09:47:18 -04:00 committed by GitHub
parent 1cc03ed937
commit 0e946718a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 45 additions and 2 deletions

View File

@ -141,7 +141,7 @@ the `TEST_LOG` environment variable, for example:
TEST_LOG= cargo nextest run -p influxdb3 --nocapture
```
## Running `rustfmt` and `clippy`
### Running `rustfmt` and `clippy`
CI will check the code formatting with [`rustfmt`] and Rust best practices with [`clippy`].
@ -171,3 +171,46 @@ cargo clippy --all-targets --workspace -- -D warnings
[`rustfmt`]: https://github.com/rust-lang/rustfmt
[`clippy`]: https://github.com/rust-lang/rust-clippy
## Building from source
InfluxDB 3 is built with Rust. Use [`rustup`][rustup] to install a recent Rust toolchain.
You can clone and build the `influxdb3` binary:
```
git clone https://github.com/influxdata/influxdb.git
cd influxdb
cargo build
```
### System dependencies
* `influxdb3` requires a working installation of `python3`. See [`README_processing_engine.md`](README_processing_engine.md)
for more details on the system requirements.
* `influxdb3` requires a working [`protoc`][protoc] Protocol Buffers compiler installed.
### Build profiles
The default build profile used when running `cargo build` will build quickly, but will not produce
an optimized binary. To build a more optimized build, you can use a different `--profile`:
```
cargo build --profile <PROFILE>
```
The following profiles are available:
* `release`: this profile optimizes for runtime performance and small binary size at the expense
of longer build times. It's most suitable for final release builds.
* `quick-release`: this profile optimizes for short build times at the expense of larger binary
size and slower runtime performance. It's most suitable for development iterations.
* `quick-bench`: this profile extends the `quick-release` profile with debuginfo turned on in
order to produce more human friendly symbols for profiling tools.
The [default profiles][cargo-default-profiles] supported by `cargo` can also be used.
[rustup]: https://www.rust-lang.org/tools/install
[protoc]: https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation
[cargo-default-profiles]: https://doc.rust-lang.org/cargo/reference/profiles.html

View File

@ -55,7 +55,7 @@ We have nightly and versioned Docker images, Debian packages, RPM packages, and
- For InfluxDB 3 Core see the [InfluxDB 3 Core getting started guide](https://docs.influxdata.com/influxdb3/core/get-started/).
- For InfluxDB 3 Enterprise see the [InfluxDB 3 Enterprise getting started guide](https://docs.influxdata.com/influxdb3/enterprise/get-started/).
If you are interested in building from source, see the [building from source](https://github.com/influxdata/influxdb/blob/main-2.x/CONTRIBUTING.md#building-from-source) guide for contributors.
If you are interested in building from source, see the [building from source](CONTRIBUTING.md#building-from-source) guide for contributors.
To begin using InfluxDB, visit our [Getting Started with InfluxDB](https://docs.influxdata.com/influxdb/v1/introduction/get-started/) documentation.