Repository navigation
build: stop shipping libcerbo_lib and the desktop binary in cerbo - #5
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nix build .#cerboproduced a 289 MiB store path, and every home-manager generation withcerbo-desktoppulled it in through the launcher'scerbo migrate vocabulary --if-needed. Two causes:src-taurideclaredcrate-type = ["staticlib", "cdylib", "rlib"](the Tauri mobile template default). Only the rlib is used, but the staticlib and cdylib becamelib/libcerbo_lib.{a,so}(227 MiB + 6.4 MiB) in both packages.buildAndTestFocusis not a nixpkgs option, so both packages built and installed the whole workspace:cerboalso shipped a 41 MiBbin/cerbo-desktopand its closure pulled in WebKitGTK.Changes
src-tauri/Cargo.toml:crate-type = ["rlib"].nix/pkgs.nix:cerbobuilds with-p cerboand tests-p cerbo -p cerbo-core; drops the unusedtauri-depsbuild inputs.cerbo-desktopbuilds and tests-p cerbo-desktop; drops the curl check input (only CLI tests needed it) and therm -f $out/bin/cerboworkaround.Result
bin/cerbowas already debug-stripped by nixpkgs; a full--strip-allwould save 5 MiB more at the cost of symbol names in backtraces, so it is left as is.Verified
cargo test --workspaceinsidenix developpassesnix build .#cerbo .#cerbo-desktoppasses; the CLI runs, the man page is installed, and the desktop launcher references the newcerbo