Files
lighthouse/common/malloc_utils/Cargo.toml
Moe Mahhouk 713e477912 feat: Add reproducible builds release workflows and push images to DockerHub (#7614)
This pull request introduces workflows and updates to ensure reproducible builds for the Lighthouse project. It adds two GitHub Actions workflows for building and testing reproducible Docker images and binaries, updates the `Makefile` to streamline reproducible build configurations, and modifies the `Dockerfile.reproducible` to align with the new build process. Additionally, it removes the `reproducible` profile from `Cargo.toml`.


  ### New GitHub Actions Workflows:

* [`.github/workflows/docker-reproducible.yml`](diffhunk://#diff-222af23bee616920b04f5b92a83eb5106fce08abd885cd3a3b15b8beb5e789c3R1-R145): Adds a workflow to build and push reproducible multi-architecture Docker images for releases, including support for dry runs without pushing an image.

### Build Configuration Updates:

* [`Makefile`](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L85-R143): Refactors reproducible build targets, centralizes environment variables for reproducibility, and updates Docker build arguments for `x86_64` and `aarch64` architectures.
* [`Dockerfile.reproducible`](diffhunk://#diff-587298ff141278ce3be7c54a559f9f31472cc5b384e285e2105b3dee319ba31dL1-R24): Updates the base Rust image to version 1.86, removes hardcoded reproducibility settings, and delegates build logic to the `Makefile`.
* Switch to using jemalloc-sys from Debian repos instead of building it from source. A Debian version is [reproducible](https://tests.reproducible-builds.org/debian/rb-pkg/trixie/amd64/jemalloc.html) which is [hard to achieve](https://github.com/NixOS/nixpkgs/issues/380852) if you build it from source.

### Profile Removal:

* [`Cargo.toml`](diffhunk://#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L289-L295): Removes the `reproducible` profile, simplifying build configurations and relying on external tooling for reproducibility.


Co-Authored-By: Moe Mahhouk <mohammed-mahhouk@hotmail.com>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2025-11-27 23:06:31 +00:00

42 lines
1.6 KiB
TOML

[package]
name = "malloc_utils"
version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = { workspace = true }
# Features are not rich enough to express the complexity of our defaults, so we choose to just
# use the jemalloc feature to control whether the dependency is compiled, but avoid using it if
# the `sysmalloc` feature is set.
#
# On Windows, setting the jemalloc feature will result in a compile-time error.
[features]
default = []
mallinfo2 = []
# The jemalloc feature enables the compilation of jemalloc dependencies. Jemalloc is also the
# default allocator, unless `sysmalloc` is set.
#
# It should be turned off on Windows.
jemalloc = ["tikv-jemalloc-ctl", "tikv-jemallocator"]
jemalloc-profiling = ["tikv-jemallocator/profiling"]
# Force the use of system malloc (or glibc) rather than jemalloc.
# This is a no-op on Windows where jemalloc is always disabled.
sysmalloc = []
# Enable jemalloc with unprefixed malloc (recommended for reproducible builds)
jemalloc-unprefixed = ["jemalloc", "tikv-jemallocator/unprefixed_malloc_on_supported_platforms"]
[dependencies]
libc = "0.2.79"
metrics = { workspace = true }
parking_lot = { workspace = true }
tikv-jemalloc-ctl = { version = "0.6.0", optional = true, features = ["stats"] }
[target.'cfg(not(target_os = "linux"))'.dependencies]
tikv-jemallocator = { version = "0.6.0", optional = true, features = ["stats"] }
# Jemalloc's background_threads feature requires Linux (pthreads).
[target.'cfg(target_os = "linux")'.dependencies]
tikv-jemallocator = { version = "0.6.0", optional = true, features = [
"stats",
"background_threads",
] }