Skip to content

build: stop shipping libcerbo_lib and the desktop binary in cerbo - #5

Merged
antono merged 1 commit into
mainfrom
feat/semantic-vault
Nov 4, 2026
Merged

antono merged 1 commit into
mainfrom
feat/semantic-vault

Conversation

@antono

@antono antono commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

nix build .#cerbo produced a 289 MiB store path, and every home-manager generation with cerbo-desktop pulled it in through the launcher's cerbo migrate vocabulary --if-needed. Two causes:

  • src-tauri declared crate-type = ["staticlib", "cdylib", "rlib"] (the Tauri mobile template default). Only the rlib is used, but the staticlib and cdylib became lib/libcerbo_lib.{a,so} (227 MiB + 6.4 MiB) in both packages.
  • buildAndTestFocus is not a nixpkgs option, so both packages built and installed the whole workspace: cerbo also shipped a 41 MiB bin/cerbo-desktop and its closure pulled in WebKitGTK.

Changes

  • src-tauri/Cargo.toml: crate-type = ["rlib"].
  • nix/pkgs.nix: cerbo builds with -p cerbo and tests -p cerbo -p cerbo-core; drops the unused tauri-deps build inputs. cerbo-desktop builds and tests -p cerbo-desktop; drops the curl check input (only CLI tests needed it) and the rm -f $out/bin/cerbo workaround.

Result

package before after closure before closure after
cerbo 289 MiB 26 MiB 1.3 GiB 315 MiB
cerbo-desktop 267 MiB 42 MiB 1.6 GiB 1.1 GiB

bin/cerbo was already debug-stripped by nixpkgs; a full --strip-all would save 5 MiB more at the cost of symbol names in backtraces, so it is left as is.

Verified

  • cargo test --workspace inside nix develop passes
  • nix build .#cerbo .#cerbo-desktop passes; the CLI runs, the man page is installed, and the desktop launcher references the new cerbo

- src-tauri: emit only an rlib; the Tauri template's staticlib and
  cdylib are for mobile targets and added 230 MiB of libcerbo_lib.{a,so}
- nix: buildAndTestFocus is not a nixpkgs option, so both packages built
  and installed the whole workspace; pass -p through cargoBuildFlags and
  cargoTestFlags, drop the unused tauri-deps and curl inputs and the
  rm -f $out/bin/cerbo workaround

nix build .#cerbo goes from 289 MiB to 26 MiB, cerbo-desktop from
267 MiB to 42 MiB.
@antono
antono merged commit 895f0d0 into main Nov 4, 2026
1 check passed
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