Skip to content

Commit

Permalink
ci: add check for missing binaries in .deb (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah authored Oct 9, 2024
1 parent fc1a9aa commit 83057cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ci/rust_ci_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,17 @@ def run_cargo_deb(*, out_dir, cargo_profile, targets, crate):
os.makedirs(out, exist_ok=True)
stderr(f"Creating .deb packages for {crate_name} and copying to {out}:")
for t in targets:
output_deb_path = f"{out}/{crate_name}_{t}.deb"
run(
f"cargo deb --no-build --no-strip "
f"--profile {cargo_profile} "
f"-p {crate_name} "
f"--target {t}-unknown-linux-gnu "
f"-o {out}/{crate_name}_{t}.deb"
f"-o {output_deb_path}"
)
# Ensures that the .deb actually contains the binary
run(
f"dpkg --contents {output_deb_path} | grep -E 'usr(/local)?/bin/{crate_name}'"
)


Expand Down
1 change: 1 addition & 0 deletions nix/shells/development.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ in
cargo-deny # Checks licenses and security advisories
cargo-expand # Useful for inspecting macros
cargo-zigbuild # Used to cross compile rust
dpkg # Used to test outputs of cargo-deb
mdbook-mermaid # Adds mermaid support
mdbook # Generates site for docs
nixpkgs-fmt # Nix autoformatter
Expand Down
3 changes: 2 additions & 1 deletion orb-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ chrono = "0.4.35"
[package.metadata.deb]
maintainer-scripts = "debian/"
assets = [
["sound/assets/*.wav", "/home/worldcoin/data/sounds/", "644"]
["sound/assets/*.wav", "/home/worldcoin/data/sounds/", "644"],
["target/release/orb-ui", "/usr/local/bin/", "755"],
]
systemd-units = [
{ unit-name = "worldcoin-ui" },
Expand Down
2 changes: 1 addition & 1 deletion orb-ui/debian/orb-ui.worldcoin-ui.service
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/worldcoin_bus_socket"
Environment="RUST_BACKTRACE=1"
SyslogIdentifier=worldcoin-ui
WorkingDirectory=/home/worldcoin
ExecStart=/usr/bin/orb-ui daemon
ExecStart=/usr/local/bin/orb-ui daemon
Restart=always

[Install]
Expand Down

0 comments on commit 83057cb

Please sign in to comment.