Skip to content

Feat/linux infra#2

Merged
hmziqrs merged 15 commits into
freeoxide:masterfrom
hmziqagent:feat/linux-infra
Jun 29, 2026
Merged

Feat/linux infra#2
hmziqrs merged 15 commits into
freeoxide:masterfrom
hmziqagent:feat/linux-infra

Conversation

@hmziqagent

Copy link
Copy Markdown
Contributor

No description provided.

…os = "macos")

The liquid_glass module uses objc2/objc2_app_kit/objc2_foundation/raw_window_handle,
which are macOS-only dependencies. Compiling it on Linux produced 40 unresolved-import
errors. Gate the pub mod declaration so the file is excluded from non-macOS builds,
matching the desktop_shell::tray convention. The command_palette.rs call site was
already cfg-gated, so no other changes were needed.
…, IPC, UI, CI)

Ports reusable Linux/platform infrastructure (inspired by a Linux/Wayland GPUI
launcher reference) into the boilerplate via a multi-agent audit + parallel-agent
implementation + adversarial review (60 findings, 14 workstreams).

Platform (cfg-gated, macos-primary build unaffected):
- compositor/: Compositor trait + detect cascade + Hyprland/Niri + Noop (linux)
- ipc/{command,rpc}: typed bidirectional command/response over existing framing
- process/{detached,session_env}: setsid detached spawn + systemd env (unix)
- clipboard/: history store + arboard write + optional wlr monitor (linux/feature)
- layer_shell.rs: Wayland overlay window helper (linux)
- app/reload.rs: exec()-based self-reload (unix)

Integration: flume reactive bridge in single_instance (replaces 180ms poll) +
typed request/response + Drop RAII; activated the inert notify watcher in
desktop_actions; tokio spawn/handle ergonomics; RemoteCommand event; CombinedAssets
(rust-embed); serializable Ipc error; Restart action.

UI scaffolding: ui/{core,color_serde,utils/color,helpers_styled,markdown,components}
(FocusManager, InputHandler, color serde, Color util, markdown, list_item/section_header);
features/palette delegate/mode/view split + SkimMatcherV2 fuzzy (command_palette public
surface preserved). Feature-gated: ai-chat (stream-to-view), config_validation lints.

Build/packaging: flake.nix (devShell + buildRustPackage + patchelf rpath); ubuntu CI
lane + Swatinem/rust-cache; dual-arch build-linux release job (patchelf + .so bundle +
PKGBUILD); normalize-version/install-linux-deps/gen-pkgbuild scripts; corrected README
apt block + Nix section; Cargo deps + ai-chat/clipboard-history features + description/repository.

Verified on Linux: cargo check --lib, clippy -D warnings, --features ai-chat, and
--features clipboard-history all pass.

Known limitation: exec-reload single-instance interaction needs runtime verification
(see src/main.rs caveat).
… at stage/ root but they nest inside stage/gpui-starter/ -> GNU tar exits 2 (Cannot stat) under set -e; archive the gpui-starter/ dir + PKGBUILD only
… cache

Native Linux notifications failed silently when no org.freedesktop.Notifications
daemon owned the session bus (confirmed: notify_rust::show() -> ServiceUnknown).
Both backends hit the identical D-Bus call and the error was buried in trace
logs, so users saw nothing with no explanation. This hardens the path per the
freedesktop spec, maximum-compatibility + feature-flagged for the boilerplate.

Notifications:
- notify-rust: convert send() to show_async() (no UI-thread blocking) + add
  Hint::DesktopEntry so the daemon resolves the .desktop/icon (.appname alone is
  freeform and never looked up).
- Startup daemon probe (get_server_information/get_capabilities via tokio
  spawn_blocking, scheduled from cx.spawn -- never blocks the UI thread) ->
  surfaces "no daemon -- install notify-osd/dunst/mako" immediately instead of
  only after the first failed send. NotifyRust stays the active backend so a
  real D-Bus Err still fires the in-app fallback (no silent drop).
- notifications-portal feature (default OFF): PortalBackend via ashpd
  (zbus/async-io, reuses the transitive 0.13.x) for Flatpak/Snap/sandboxed
  runs, auto-selected when is_sandboxed(). Native installs never need it.
- Canonical app identity (display name / desktop-entry id / WM_CLASS) + window
  app_id so the .desktop StartupWMClass matches.
- Settings UI now shows last_backend_error + daemon_capabilities.
- Tests: fallback, panic-doesn't-bypass-fallback, both-fail->UiOnly, disabled,
  Linux notify-rust selection + Unsupported permission, portal kind/caps.

Packaging:
- resources/com.gpui-starter.app.desktop + gpui-starter.png shipped in the
  release tarball; scripts/install-linux.sh installs them to the user's XDG
  dirs (otherwise the .desktop/icon are inert inside the tarball).
- gen-pkgbuild.sh: .desktop filename = desktop-entry id (so Hint::DesktopEntry
  resolves) + StartupWMClass + icon install into the hicolor tree.

CI:
- sccache (zero-config GHA cache backend) on the release jobs (build-macos,
  build-linux) -- complements rust-cache for the cold release codegen.
- Re-enable a SCOPED test job: cargo test -p gpui-starter --lib (not the
  workspace-wide multi-hour build) behind sccache + a dedicated rust-cache key,
  non-blocking until proven stable.

Also: bump version to 0.2.1; fix a pre-existing clippy collapsible_if in the
main.rs reload block. (cargo clippy --all-features still fails on PRE-EXISTING
websocket-feature breakage in src/platform/network/websocket/client.rs, out of
scope here.)
…> unresolvable -> all release jobs failed at setup)
…r_information/get_capabilities are non-macOS-Unix only; unconditional use broke the macOS release build)
…cOS backend has neither; use sync show() on macOS/Windows)
…n Linux

GNOME returns Ok from the Notify D-Bus call even when the banner is suppressed by Do-Not-Disturb / per-app mute / busy / fullscreen, so the optimistic delivered_natively=true hid the in-app fallback and the user saw nothing. Map NotificationImportance to a FreeDesktop urgency hint (BackgroundWorthy->Critical, ForegroundOnly->Normal -- only Critical pierces GNOME's suppression gates), route the Test affordance through a new test_notification() that forces in-app feedback regardless of delivery, and enable open_system_settings on Linux (gnome-control-center notifications). Verified against GNOME Shell messageTray.js / notificationDaemon.js.
Drops the AppRoot / status-bar / HomePage 'render prepared' DEBUG logs that flooded output each frame. Frame timing is still persisted for the status-bar readout and slow-frame warnings are retained.
force-release (move tag to HEAD + delete/re-push on the fork), dispatch-release (workflow_dispatch, no tag move), watch-release, release-runs. CI is tag-triggered on hmziqagent/gpui-starter; softprops/action-gh-release@v2 upserts the release in place.
The macOS job previously built only the host arch (arm64 on macos-latest), so the published DMG didn't run on Intel Macs. Now builds both aarch64-apple-darwin and x86_64-apple-darwin (cross-compiled on the arm64 runner — no Intel runner needed) and lipo-merges them into one fat Mach-O inside the .app. Verified the macOS release dep tree has no openssl (reqwest uses rustls-tls; tokio-tungstenite's native-tls is behind the non-default 'websocket' feature) and only universal-system-framework FFI + ring, so the x86_64 cross-compile is clean. Codesign/notarize operate on the .app unchanged (codesign handles fat binaries natively).
…al one

The v0.2.1 release now ships three macOS artifacts: the universal GPUI-Starter-X.dmg (arm64+x86_64, default download) plus slim GPUI-Starter-X-aarch64.dmg and GPUI-Starter-X-x86_64.dmg for users who want a smaller download. No extra compiling — both arch binaries are already built; create-release-app.sh now takes an arch arg (lipo for universal, copy for the slim builds), and a new 'Stage, sign, and DMG all arches' workflow step loops over the three. The three DMGs upload as one artifact (macos-dmgs) which publish-release downloads and attaches. Notarization (inactive, no cert configured) extended to loop all three when a cert is added.
…ft on device)

The 3-arch macOS run failed at hdiutil with 'No space left on device' — two release arches (~4 GB of target/) plus the macos-latest image fill the disk. create-release-app.sh + codesign succeeded (the binaries are self-contained); only DMG creation ran out of room. Delete the bulky per-arch deps/build artifacts after the build; sccache re-serves them at ~100% on the next build.
…util retry)

After freeing ~40 GB of target/ (the codegen-units=256 tax across two arches), Spotlight re-indexing the deletion raced hdiutil -> 'Resource busy'. Disable Spotlight indexing job-wide (also speeds the build by not indexing the 40 GB of object files), and make create-dmg.sh retry hdiutil up to 5x with a detach between attempts — the standard fix for the transient 'Resource busy'.
@hmziqrs
hmziqrs merged commit d0b9797 into freeoxide:master Jun 29, 2026
@hmziqagent
hmziqagent deleted the feat/linux-infra branch June 29, 2026 07:23
hmziqagent added a commit to hmziqagent/gpui-starter that referenced this pull request Jul 1, 2026
The notification hardening from feat/linux-infra (23542e3, d4dcabe) introduced
3 macOS-lane-only clippy errors plus fmt drift that the Linux-only dev box
cannot see — these paths only fail to compile under target_os="macos", where
the Linux cfg blocks vanish. PR freeoxide#2 was merged while its CI was red, and this
branch inherited those failures, blocking PR freeoxide#3 even though its own change
(the glob-shadow fix) is correct.

Clippy fixes (cfg-scoped, no #[allow] band-aids):
- notify_rust.rs: gate the DESKTOP_ENTRY_ID import to Linux. Its only use,
  Hint::DesktopEntry, is D-Bus-only, so the unconditional import was unused on
  macOS/Windows.
- notifications/mod.rs: gate the NotificationImportance pub(crate) re-export to
  Linux. It is consumed only by the Linux-only urgency mapping, so the
  unconditional re-export was unused on macOS/Windows.
- backend_service.rs: gate select_primary_backend()'s (None, None) tail to
  non-macOS/non-Windows. On macOS/Windows control always returns from the cfg
  block above, so the tail was unreachable on those targets.

Also `cargo fmt` the tree (notifications api/types, storage/mod.rs, and the
updater/virtual_list test modules).

Verified locally: `cargo fmt --check` clean; `cargo clippy -- -D warnings` clean
on Linux (compiles in 39s). macOS clippy remains CI-authoritative — Apple
targets cannot be compiled on this Linux box. A thorough sweep of src/ found no
other macOS-only issues hiding behind the 3 clippy aborted on.
hmziqrs added a commit that referenced this pull request Jul 21, 2026
…migration

Integrates the 20 remote commits (PR #2 feat/linux-infra, PR #3 CI/test fixes:
platform layer, clipboard, compositor, IPC, palette, ai_chat, config validation,
hardened notifications, release/DMG/tarball tooling, CI) with the local 12 commits
(gpui-query crates.io migration, HTTP Lab / query_devtools removal).

Conflicts resolved:
- justfile: kept both the local gpui-query-local/cratesio/status recipes and the
  remote release-operation recipes (disjoint, no collisions).
- Cargo.lock: regenerated from the merged Cargo.toml (local gpui-form path deps +
  remote's added deps). gpui-component kept at local pin rev e416af7 (v0.5.2).
- src/ui/markdown.rs: added table/table_cell fields to TextViewStyle (added in
  gpui-component v0.5.2; remote's markdown.rs predated them) — defaulted to match
  the older behavior it was written against.

No remote commits discarded. cargo check passes (0 errors).
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.

2 participants