Skip to content

Commit ec262c6

Browse files
committed
docs: add maintainer guide
1 parent 4f77fe0 commit ec262c6

File tree

2 files changed

+92
-7
lines changed

2 files changed

+92
-7
lines changed

MAINTANERS.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Maintainer Guide
2+
3+
This document collects notes and commands useful when maintaining
4+
`codetracer-ruby-recorder`.
5+
6+
## Development environment
7+
8+
This repository provides a Nix flake for the development shell. With
9+
`direnv` installed, the shell is loaded automatically when you enter the
10+
repository directory. Run `direnv allow` once to enable it.
11+
12+
The same environment is configured for GitHub Codespaces via the
13+
provided devcontainer configuration.
14+
15+
## Building the native extension
16+
17+
The tracer ships with a Rust extension located in `ext/native_tracer`.
18+
To build it locally run:
19+
20+
```bash
21+
just build-extension
22+
```
23+
24+
This compiles the extension in release mode using Cargo. The resulting
25+
shared library is placed under
26+
`ext/native_tracer/target/release/` and is loaded by `src/native_trace.rb`.
27+
28+
## Running tests and benchmarks
29+
30+
Execute the full test suite with:
31+
32+
```bash
33+
just test
34+
```
35+
36+
The tests run several sample programs from `test/programs` and compare
37+
the generated traces with the fixtures under `test/fixtures`.
38+
39+
Benchmarks can be executed with:
40+
41+
```bash
42+
just bench
43+
```
44+
45+
## Publishing gems
46+
47+
Two Ruby gems are published from this repository:
48+
49+
* **codetracer-ruby-recorder** – the tracer with the compiled native
50+
extension. Prebuilt gems are produced per target platform using
51+
[`rb_sys`](https://github.com/oxidize-rb/rb-sys).
52+
* **codetracer_pure_ruby_recorder** – a pure Ruby fallback without the
53+
native extension.
54+
55+
### Native extension gem
56+
57+
1. Install the development dependencies:
58+
59+
```bash
60+
bundle install
61+
```
62+
63+
2. For each target platform set `RB_SYS_CARGO_TARGET` and build the gem:
64+
65+
```bash
66+
RB_SYS_CARGO_TARGET=x86_64-unknown-linux-gnu rake cross_native_gem
67+
```
68+
69+
Replace the target triple with the desired platform (for example
70+
`aarch64-apple-darwin`).
71+
72+
3. Push the generated gem found in `pkg/` to RubyGems:
73+
74+
```bash
75+
gem push pkg/codetracer-ruby-recorder-<version>-x86_64-linux.gem
76+
```
77+
78+
Repeat these steps for each supported platform.
79+
80+
### Pure Ruby gem
81+
82+
The pure Ruby tracer is packaged from the files under `src/`. Build and
83+
publish it with:
84+
85+
```bash
86+
gem build codetracer_pure_ruby_recorder.gemspec
87+
gem push codetracer_pure_ruby_recorder-<version>.gem
88+
```
89+
90+
Ensure the version matches the native extension gem so that both
91+
packages can be used interchangeably.

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,8 @@ ruby src/native_trace.rb <path to ruby file>
2424
```
2525

2626
however you probably want to use it in combination with CodeTracer, which would be released soon.
27-
28-
### Development
29-
30-
This repository provides a Nix flake for the development shell. With direnv installed, the shell is loaded automatically when you enter the directory. Run `direnv allow` once to enable it.
31-
32-
The same environment is configured for GitHub Codespaces via devcontainer configuration.
33-
3427
### env variables
28+
For maintainer instructions, see [MAINTANERS.md](MAINTANERS.md).
3529

3630
* if you pass `CODETRACER_RUBY_TRACER_DEBUG=1`, you enables some additional debug-related logging
3731
* `CODETRACER_DB_TRACE_PATH` can be used to override the path to `trace.json` (it's used internally by codetracer as well)

0 commit comments

Comments
 (0)