-
Notifications
You must be signed in to change notification settings - Fork 31
feat!: ship one binary — bundle exec-harness and memtrack, drop the LD_PRELOAD hack #531
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
base: main
Are you sure you want to change the base?
Changes from all commits
5abd69c
51bb339
331541e
f539a42
48d370f
4edc228
59c9756
11785e4
d7d36be
b631658
c43aaba
21525d5
6bb8b75
728fdde
5c8807b
7368b6a
763c894
36afa18
a05e42e
6fdfd07
3ce6305
c87836c
2ec7cee
069fbab
99827e6
c862935
8e2d7e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # What a musl build of the bundled `memtrack` needs. Refs COD-3440. | ||
| # | ||
| # `libbpf-sys` vendors elfutils, whose `configure` unconditionally looks for | ||
| # `argp`, `obstack` and `fts`. musl ships none of them, so the checks fail and | ||
| # the build stops before it reaches libelf — even though a libelf-only build | ||
| # never calls into any of them. Pre-seeding autoconf's cache skips the three | ||
| # checks. "none required" is the answer a glibc host reaches on its own, so | ||
| # these are unconditional rather than per-target; on gnu they only save three | ||
| # `configure` probes. | ||
| # | ||
| # Applies to everything below: cargo does *not* override a variable already set | ||
| # in the environment unless the entry carries `force = true`. A shell exporting | ||
| # `CFLAGS` or `CPATH` therefore loses these values, and the musl build fails on | ||
| # a missing <argp.h> or <asm/types.h>. They are left unforced so a caller who | ||
| # sets them deliberately keeps them; no CI job does. | ||
| [env] | ||
| ac_cv_search_argp_parse = "none required" | ||
| ac_cv_search__obstack_free = "none required" | ||
| ac_cv_search_fts_close = "none required" | ||
|
|
||
| # Where the `argp.h` stub lives. `CPATH` rather than `CFLAGS -I<path>`, because | ||
| # `relative = true` can only make a *bare* path absolute and a `CFLAGS` value | ||
| # has nowhere to put the `-I`. It resolves against the project root — the | ||
| # directory holding `.cargo/`, not `.cargo/` itself. | ||
| # | ||
| # Not target-scoped, so the stub is on the gnu build's include path too; the | ||
| # header defers to the real <argp.h> whenever it detects glibc. | ||
| CPATH = { value = "crates/memtrack/musl", relative = true } | ||
|
|
||
| # libbpf includes <asm/unistd.h> and <asm/types.h>. Debian's musl-gcc runs with | ||
| # -nostdinc and only sees /usr/include/<arch>-linux-musl, so the kernel UAPI | ||
| # headers from linux-libc-dev have to be added back. `-idirafter` puts them last, | ||
| # behind musl's own, which is what keeps a glibc build unaffected. | ||
| # | ||
| # Both Debian multiarch triplets are listed because `[env]` cannot branch on the | ||
| # host architecture. A `-idirafter` naming a directory that does not exist is | ||
| # ignored silently, so the wrong one does nothing — as do both off Debian. | ||
| CFLAGS = "-idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include/aarch64-linux-gnu -idirafter /usr/include" | ||
|
|
||
| # rustc links with `-nodefaultlibs`, so gcc does not pull in libgcc. On aarch64, | ||
| # libbpf's C code needs the outline-atomic helpers (`__aarch64_ldadd4_sync` and | ||
| # friends) that live there, and the link fails without it. x86_64 has no such | ||
| # helpers and needs nothing. | ||
| [target.aarch64-unknown-linux-musl] | ||
| rustflags = ["-C", "link-arg=-lgcc"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,50 +10,28 @@ prek install | |
|
|
||
| ## Release Process | ||
|
|
||
| This repository is a Cargo workspace containing multiple crates. The release process differs depending on which crate you're releasing. | ||
| This repository is a Cargo workspace containing multiple crates, but only one of them is released: the main runner. Everything else is linked into its binary. | ||
|
|
||
| ### Workspace Structure | ||
|
|
||
| - **`codspeed-runner`**: The main CLI binary (`codspeed`) | ||
| - **`memtrack`**: Memory tracking binary (`codspeed-memtrack`) | ||
| - **`exec-harness`**: Execution harness binary | ||
| - **`memtrack`**: Memory tracker, built into `codspeed` and reached as `codspeed memtrack` | ||
| - **`exec-harness`**: Execution harness, built into `codspeed` and reached as `codspeed exec-harness` | ||
| - **`runner-shared`**: Shared library used by other crates | ||
|
|
||
| ### Releasing Support Crates (memtrack, exec-harness, runner-shared) | ||
| `memtrack` and `exec-harness` are **not released on their own**. They are linked into the | ||
| `codspeed` binary and invoked as hidden subcommands, so one tag produces one artifact set and | ||
| there is no version for the runner to be out of step with. Their `[[bin]]` targets remain for | ||
| development and for the tests, which build them to exercise the standalone path. | ||
|
|
||
| For any crate other than the main runner: | ||
|
|
||
| ```bash | ||
| cargo release -p <PACKAGE_NAME> --execute <VERSION_BUMP> | ||
| ``` | ||
|
|
||
| Where `<VERSION_BUMP>` is one of: `alpha`, `beta`, `patch`, `minor`, or `major`. | ||
|
|
||
| **Examples:** | ||
|
|
||
| ```bash | ||
| # Release a new patch version of memtrack | ||
| cargo release -p memtrack --execute patch | ||
|
|
||
| # Release a beta version of exec-harness | ||
| cargo release -p exec-harness --execute beta | ||
| ``` | ||
|
|
||
| #### Post-Release: Update Version References | ||
|
|
||
| After releasing `memtrack` or `exec-harness`, you **must** update the version references in the runner code: | ||
|
|
||
| 1. **For memtrack**: Update the `MEMTRACK_INSTALLER` pin record in `src/binary_pins.rs` (see [Pinned binary hashes](#pinned-binary-hashes) below). | ||
|
|
||
| 2. **For exec-harness**: Update the `EXEC_HARNESS_INSTALLER` pin record in `src/binary_pins.rs`. | ||
|
|
||
| These constants are used by the runner to download and install the correct versions of the binaries from GitHub releases. | ||
| Both still keep their own `version` in `Cargo.toml` — that is what | ||
| `codspeed exec-harness --version` reports — but bumping it is a plain edit, not a release. | ||
|
Comment on lines
+22
to
+28
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deslop + simplify, way too verbose |
||
|
|
||
| ### Pinned binary hashes | ||
|
|
||
| Every binary the runner downloads at install time is SHA-256-pinned. The pins live in two places: | ||
|
|
||
| - **`src/binary_pins.rs`** — the patched valgrind `.deb`, the memtrack installer, the exec-harness installer, and the mongo-tracer installer. Each artifact keeps its version, URL template, and hash together in a pin record. | ||
| - **`src/binary_pins.rs`** — the patched valgrind `.deb` and the mongo-tracer installer. Each artifact keeps its version, URL template, and hash together in a pin record. | ||
| - **`src/executor/helpers/introspected_golang/go.sh`** — the go-runner installer published by [CodSpeedHQ/codspeed-go](https://github.com/CodSpeedHQ/codspeed-go), one `<version> <sha256>` row per release in the `GO_RUNNER_INSTALLER_SHA256S` table. `DEFAULT_GO_RUNNER_VERSION` (just below the table) selects the row used by default. | ||
|
|
||
| When you bump a pinned version (or add a new go-runner row), update the matching pin record / table row with the new version and its SHA-256. | ||
|
|
@@ -84,16 +62,12 @@ These tests also run in CI, but running them locally before opening the PR avoid | |
|
|
||
| ### Releasing the Main Runner | ||
|
|
||
| The main runner (`codspeed-runner`) should be released after ensuring all dependency versions are correct. | ||
| The main runner (`codspeed-runner`) is the only crate that is released. | ||
|
|
||
| #### Pre-Release Check | ||
|
|
||
| **Verify binary version references**: Check that version constants in the runner code match the released versions: | ||
|
|
||
| - `MEMTRACK_VERSION` in `src/binary_pins.rs` | ||
| - `EXEC_HARNESS_VERSION` in `src/binary_pins.rs` | ||
|
|
||
| Also confirm the SHA-256 entries in the pin records in `src/binary_pins.rs` match the released artifacts. | ||
| Confirm the SHA-256 entries in the pin records in `src/binary_pins.rs` match the released | ||
| artifacts they point at. | ||
|
|
||
| #### Release Command | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,10 +20,7 @@ serde = { workspace = true } | |
| humantime = "2.3" | ||
| runner-shared = { path = "../runner-shared" } | ||
| tempfile = { workspace = true } | ||
| object = { workspace = true } | ||
|
|
||
| [build-dependencies] | ||
| cc = "1" | ||
|
|
||
| [package.metadata.dist] | ||
| targets = ["aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] | ||
| # Deliberately no `[package.metadata.dist]`: exec-harness ships inside the | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this comment, we don't need to document the non-existence of something ^^ |
||
| # `codspeed` binary and is not released on its own. The `[[bin]]` stays for | ||
| # development and for the tests, which exercise the standalone path. | ||
Uh oh!
There was an error while loading. Please reload this page.