Skip to content

nix: add rln-stateless output; disable defaults when features are set - #436

Draft
richard-ramos wants to merge 1 commit into
vacp2p:release-v2.0.1from
richard-ramos:nix-rln-stateless
Draft

nix: add rln-stateless output; disable defaults when features are set#436
richard-ramos wants to merge 1 commit into
vacp2p:release-v2.0.1from
richard-ramos:nix-rln-stateless

Conversation

@richard-ramos

Copy link
Copy Markdown
Member

Not for merge. Draft opened for visibility only. master (v3.0.0) removed the stateless feature entirely, so this fix does not apply there as-is. We'll re-do the equivalent against v3 once we migrate our consumers off ffi_rln_new's v2 zero-argument form. Filing here so the v2.x nix packaging is at least reproducible in the meantime.

The stateless feature exposes the zero-argument form of ffi_rln_new, which downstream Nim/C bindings (e.g. mix-rln-spam-protection-plugin) rely on. There is currently no packaged way to consume it — every caller has to fork this flake to add override { features = "stateless"; }.

Changes

  • flake.nix: expose rln-stateless = buildRln.override { features = "stateless"; } alongside rln, so callers can pull it in directly.
  • nix/default.nix: when the caller passes features, add --no-default-features. Without this, --features=stateless still pulls in parallel (the current default), and the stateless build fails to compile with parallel enabled.
  • cargoHash bumped: the previous value no longer matches the vendor set that rustPlatform.buildRustPackage computes on the current nixpkgs 25.11 pin.

Verification

```
nix build .#rln # unchanged output, still works
nix build .#rln-stateless # produces librln.{a,so} without parallel
```

The `stateless` feature exposes the zero-argument form of `ffi_rln_new`,
which downstream Nim/C bindings (e.g. mix-rln-spam-protection-plugin)
rely on. Currently there's no packaged way to consume it — callers have
to fork this flake to add an `override { features = "stateless"; }`.

Two changes:
- flake.nix: expose `rln-stateless = buildRln.override { features =
  "stateless"; }` alongside `rln`, so callers can pull it in directly.
- nix/default.nix: when the caller passes `features`, add
  `--no-default-features`. Otherwise `--features=stateless` still
  pulls in `parallel` (the current default), and the stateless build
  actually fails to compile with the `parallel` feature enabled.

`cargoHash` bumped: the current `sha256-3wFnSJYU...` no longer matches
the vendor set that `rustPlatform.buildRustPackage` computes on
nixpkgs 25.11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant