-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
150 lines (137 loc) · 6.67 KB
/
Copy pathCargo.toml
File metadata and controls
150 lines (137 loc) · 6.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
[package]
name = "openc3-cosmos-app"
version = "0.5.3"
edition = "2021"
rust-version = "1.91"
description = "OpenC3 COSMOS native launcher and manager (installer, container orchestration, GUI/CLI)"
license = "AGPL-3.0-only"
repository = "https://github.com/OpenC3/cosmos"
[[bin]]
name = "openc3"
path = "src/main.rs"
[features]
# The GUI is on by default per the requirements. Build with
# `--no-default-features` for a smaller headless-only binary.
default = ["gui"]
gui = ["dep:iced", "dep:rfd", "dep:image", "dep:fs4"]
[dependencies]
clap = { version = "4.5", features = ["derive"] }
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# JSON structured logging matching the COSMOS logger format (see src/logging.rs):
# chrono for the ISO8601/nanosecond timestamps, gethostname for container_name.
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
gethostname = "1"
sha2 = "0.10"
base64 = "0.22"
flate2 = "1"
tar = "0.4"
zip = { version = "2", default-features = false, features = ["deflate"] }
# Use iced's software renderer (tiny-skia) rather than the GPU wgpu backend:
# adequate for a control panel, needs no GPU drivers at runtime (better for VMs
# and the cross-built Linux/Windows binaries), and avoids pulling wgpu/metal
# (and their future-incompat `block` dependency).
iced = { version = "0.13", default-features = false, features = ["tiny-skia", "tokio", "image"], optional = true }
# Decode the embedded PNG logo into RGBA for the system-tray icon (GUI only).
# Already in the tree via iced's "image" feature, so this adds no real build cost.
image = { version = "0.24", default-features = false, features = ["png"], optional = true }
# Cross-platform advisory file lock for the single-instance guard (GUI only). A
# lock file avoids a fixed TCP port (no chance of colliding with another app) and
# the OS releases the lock on crash. Sits on rustix/windows-sys, already in tree.
fs4 = { version = "0.13", optional = true }
# Iroh peer-to-peer bridge between the app and host microservices.
iroh = "1"
tokio = { version = "1", features = ["rt-multi-thread", "io-util", "sync", "time", "macros"] }
iroh-tickets = "1.0.0"
# Talk to the Docker Engine API directly over its socket / named pipe for the
# status+stats poll (see monitor.rs / dockerapi.rs) instead of spawning a
# `docker` subprocess every tick. Falls back to the CLI when the socket isn't
# reachable. futures-util is for consuming bollard's stats stream.
bollard = "0.21"
futures-util = "0.3"
# Native folder picker for the Development Mode setting (GUI only). The
# xdg-portal backend avoids a GTK C dependency on Linux (keeping the build
# pure-Rust/cross-compilable); native dialogs on macOS/Windows.
rfd = { version = "0.15", default-features = false, features = ["xdg-portal", "tokio"], optional = true }
# The software renderer (tiny-skia) and text shaping (cosmic-text) are painfully
# slow when built unoptimized, so a debug `cargo run` feels sluggish even though
# release is snappy. Optimize dependencies (but NOT our own crate, so app-crate
# incremental builds stay fast and debuggable) so `cargo run` renders at full
# speed. Standard practice for graphics/GUI apps.
[profile.dev.package."*"]
opt-level = 3
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
panic = "abort"
# Profiling build: optimized but with debug symbols kept and LTO off for clear
# stack frames. Use with samply (https://github.com/mstange/samply):
# cargo build --profile profiling
# samply record ./target/profiling/openc3
[profile.profiling]
inherits = "release"
opt-level = 2
lto = false
debug = true
strip = false
[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
tray-icon = "0.24.1"
[target.'cfg(target_os = "macos")'.dependencies]
# Toggle the Dock icon via the NSApplication activation policy when hiding to /
# showing from the menu-bar tray. objc2 0.6 is already in the tree (tray-icon/
# winit), so this adds no real build cost.
objc2 = "0.6"
[target.'cfg(windows)'.build-dependencies]
# Embed assets/icons/icon.ico into the .exe (see build.rs) so Explorer, the
# taskbar, and the desktop/Start shortcuts show the OpenC3 COSMOS logo. Host-
# scoped: only pulled when building on a Windows host (the release workflow's
# Windows job), matching build.rs's `#[cfg(windows)]` gate.
winresource = "0.1"
# Native installer configuration (cargo-packager). The host OS determines which
# formats are produced: dmg/app on macOS, deb/appimage on Linux, and the WiX
# .msi on Windows. See package.sh / package.ps1.
[package.metadata.packager]
# Underscored so the installed app, installers, and artifacts have no spaces in
# their names/paths. (In-app UI text still reads "OpenC3 COSMOS".)
product-name = "OpenC3_COSMOS"
identifier = "com.openc3.cosmos"
description = "OpenC3 COSMOS native launcher and manager"
long-description = "Installs and manages a complete OpenC3 COSMOS environment: a Docker engine, an isolated Python runtime, and the COSMOS containers. Runs as a GUI by default or fully headless from the command line."
authors = ["OpenC3, Inc."]
homepage = "https://openc3.com"
license-file = "LICENSE.md"
category = "Utility"
# App/installer icons, generated from assets/icon.png by tools/gen_app_icons.py.
# AppImage requires a square PNG; macOS uses the .icns and Windows the .ico.
icons = [
"assets/icons/32x32.png",
"assets/icons/128x128.png",
"assets/icons/128x128@2x.png",
"assets/icons/512x512.png",
"assets/icons/icon.icns",
"assets/icons/icon.ico",
]
[package.metadata.packager.macos]
minimum-system-version = "11.0"
# cargo-packager reads the codesign identity from THIS field (not an env var).
# Default to ad-hoc ("-") so every build produces a valid, self-consistent .app
# bundle — an unsigned bundle is rejected by Gatekeeper ("damaged" / "code has
# no resources"). The release workflow replaces this with the real
# "Developer ID Application: …" identity when signing secrets are present, which
# also enables notarization.
signing-identity = "-"
# winit (the GUI's windowing) loads libxkbcommon at runtime via dlopen for
# keyboard handling on Linux (X11 and Wayland). Because it's dlopen'd it never
# appears in the binary's dynamic deps, so cargo-packager can't auto-detect it —
# declare it explicitly so installs pull it in. Minimal images (e.g. some cloud
# GUI AMIs) don't ship it by default.
[package.metadata.packager.deb]
depends = ["libxkbcommon0", "libxkbcommon-x11-0"]
# Bundle the same libs into the AppImage so it's self-contained. They're located
# on the build machine via `find -L /usr/lib* -name <lib>`, so libxkbcommon must
# be installed where the AppImage is packaged.
[package.metadata.packager.appimage]
libs = ["libxkbcommon.so.0", "libxkbcommon-x11.so.0"]