Dep chain audit showed winit, iced_winit and iced_tiny_skia all had
"x11" in their default features. Even though our Wayland-only build
doesn't use any X11 code path, the defaults were propagating through
cargo feature unification — winit-x11, tiny-xlib, x11-dl, etc. were
all being linked.
Fix, at the dep declaration level:
- [dependencies.iced_winit] default-features = false + wayland/wayland-dlopen
- [dependencies.iced_tiny_skia] default-features = false + wayland
- iced submodule's workspace winit = { ..., default-features = false }
Result on cosmic-yoterm binary:
- size: 55.4 MB -> 53.8 MB (-1.6 MB, ~3%)
- winit symbols: 2151 -> 1340 (-811)
- x11 symbols: 1526 -> 503 (-1023)
Remaining x11 footprint (~500 symbols):
- clipboard_x11 / x11rb: window_clipboard pulls both x11 + wayland
backends unconditionally on unix targets. Would need forking
window_clipboard to gate x11 behind a feature.
- tiny-xlib / as-raw-xcb-connection: low-level window-handle bindings
pulled by wgpu/softbuffer even when no X11 windows ever exist.
Dead code at runtime, probably best left alone until wgpu/raw-window-handle
upstream make these optional.
Two perf + correctness wins packaged as +yoda-v2 (version bump 0.1.0-yoda
-> 0.1.0-yoda.2):
1. color_picker::draw() — use the theme: &Theme parameter already passed
to draw() instead of THEME.lock().unwrap().clone() which cloned the
whole Theme on every redraw (src/widget/color_picker/mod.rs:622).
Upstreamable.
2. Dropped feature = "winit" from 21 combined cfg attrs in context_menu.rs,
menu/menu_bar.rs, menu/menu_inner.rs. These triple-gates (wayland +
winit + surface-message) were silently disabling all context-menu and
menubar popup creation in yoda apps (which don't activate the winit
feature). Now the code only gates on wayland + surface-message, which
is our actual runtime path. Matches the ungate we already did on
surface/action.rs in Phase 3d.
cargo check --lib passes. All 4 consumer apps rebuilt + installed as
+yoda-v2 (backup of previous yoda binaries in .pre-yoda-v2 siblings).
Reverts the soft-fork pivot (6736a596). Strategy chosen with user:
full cascade fork. Every consumer (leyoda/cosmic-files + each leyoda/app)
depends on libcosmic-yoda by explicit path, so there are no transitive
deps left asking for the upstream 'libcosmic' crate — no [patch]
unification issues, no two-version traps.
Changes:
- Cargo.toml: name = libcosmic-yoda, version = 0.1.0-yoda
- i18n/*/libcosmic.ftl -> libcosmic_yoda.ftl (71 locales)
- examples/*/Cargo.toml dep refs back to libcosmic-yoda
- compat stub features (winit=[], x11=[]) kept for upstream deps that
might still request them during the migration window
cargo check --lib passes.
The initial hard rename (255cf7cc) broke because Cargo's [patch] with
`package = libcosmic-yoda` does NOT unify across the transitive graph.
cosmic-files (still upstream) asks for "libcosmic"; patched with a
renamed package it ends up as a separate crate, leading to two copies
of cosmic::Theme/Action with incompatible types.
Soft fork keeps the yoda identity where it counts and stays compatible:
- Cargo name : libcosmic (for patch/unification)
- Version : 1.0.0 (same major as upstream so [patch] semver-accepts it)
- Lib name : cosmic (unchanged)
- Repo : leyoda/libcosmic-yoda on Forgejo (yoda lineage)
- Branch : main (vs upstream master)
Revert parts:
- examples/*/Cargo.toml dep refs back to libcosmic
- i18n/*/libcosmic_yoda.ftl renamed back to libcosmic.ftl
Added:
- Compat stub features: winit = [], x11 = [] — empty so Cargo can satisfy
upstream deps asking for these, but no code is actually gated on them
any more (all removed in Phase 2).
Ungates done to make the Wayland path self-sufficient after winit removal:
- src/lib.rs: pub mod app + pub use Application/ApplicationExt no longer
gated on winit; prelude exports ApplicationExt unconditionally
- src/surface/action.rs: 6 functions had #[cfg(all(wayland, linux, winit))]
triple-gates; simplified to #[cfg(all(wayland, linux))] since winit is
no longer a meaningful gate (wayland is now the only shell)
- 12 standalone #[cfg(feature = "winit")] annotations removed from src/
(their gated code is now always compiled)
cargo check --lib + cargo check in cosmic-yoterm both pass with a single
libcosmic v1.0.0 in the tree.
Part of the yoda fork direction: libcosmic-yoda is Wayland-only going forward.
Cargo.toml changes:
- default features: remove winit, x11, iced-wayland, multi-window -> add wayland
- applet feature: remove winit dep
- merge iced-wayland into wayland (simpler feature graph)
- remove winit, winit_debug, winit_tokio, winit_wgpu, x11, iced-wayland features
- keep iced_winit dep (it's a misnomer — also hosts the wayland/cctk runtime)
Workspace:
- examples/* excluded (many depend on winit/x11) — revisited in a later phase
Behavior:
- Library builds clean in release with default features (cargo check + cargo build --release --lib OK)
- 58 lines in src/ gated on feature "winit" become unreachable (dead-code warnings — cleanup deferred)
- 108 lines gated on feature "wayland" now always active via default
--all-features is known-broken because tokio/async-std/smol are mutually
exclusive — this is pre-existing, not a Phase 2 regression.
Fork point: pop-os/libcosmic 1.0.0 + perf/quickwins-bundle + macOS
window controls feature. From here the crate diverges under the yoda
lineage with its own versioning.
Changes:
- Cargo.toml: name = libcosmic-yoda, version = 0.1.0-yoda
- [lib] name = cosmic kept unchanged — consumer code still does 'use cosmic::...'
- examples/*/Cargo.toml: updated all libcosmic dep references to libcosmic-yoda
- i18n/*/libcosmic.ftl renamed to libcosmic_yoda.ftl (71 locales) to match
the new name expected by fluent_language_loader!() macro
cargo check --lib passes. Examples not yet validated — Phase 2 (Wayland-only
cut) will rework them anyway.
This pulls in the fix in cosmic-text to fallback to the default
SansSerif if there are missing glyphs in basic shaping.
Also removes advanced-shaping from the default features list.
* fix: compiling on windows requires cosmic-icons in project root
crabtime provides crabtime::WORKSPACE_PATH to refer to the
CARGO_MANIFEST_DIR of the top level crate being built, which means when
building libcosmic directly, crabtime::WORKSPACE_PATH will work, but
when building it as a dependency of another crate,
crabtime::WORKSPACE_PATH will no longer refer to the path to libcosmic.
I don't think there's a good workaround, since when in the context of
crabtime, CARGO_MANIFEST_DIR refers to the path to the crate generated
by crabtime rather than to libcosmic.
This replaces crabtime with a simple build.rs script that generates a
file in OUT_DIR.
* fix: do not generate icon bundle for unix targets
---------
Co-authored-by: Michael Aaron Murphy <michael@mmurphy.dev>