Repository navigation
feat(linux): Linux platform foundation, Qt6 windowing, and packaging (Part 1/6) - #34
Conversation
|
Hi @thtbee This is the largest, one-off chunk to establish a clean cross-platform baseline. Please give it a review and hit me with your feedback... Cheers |
thtbee
left a comment
There was a problem hiding this comment.
Thanks for splitting it up, this is much easier to go through. I compared the shared Rust files with main token by token, and the Windows code is unchanged apart from the cfg attributes.
Before it can go in:
- On Linux,
desktop/vcam/src/shm.rsopens/dev/shm/nectarlink_shm_<name>with theOpenOptionsdefaults, so the file is 0644 after the usual umask and readable by every user on the PC, and the name is the same for everyone. Another user could read the live camera frames, or create that name first (as a file or a symlink) and have our process write into it orset_lenit. Please create it 0600 withO_NOFOLLOW(OpenOptionsExt::modeandcustom_flags), check after opening that it's ours, and put the user in the name or use$XDG_RUNTIME_DIR. compile_translations()indesktop/app/build.rsruns on every platform, so Windows builds now compile the .ts files and copy .qm files intotarget/<profile>, outsideOUT_DIR. On Windowsscripts/package.ps1already does this and only ships finished languages, so please limit it to Linux.spikes/s1-qt-rust/build.rsadds-fuse-ld=bfdand a link path into.qt6-sysroot, and.gitignoregets/.qt6-sysroot/. That looks like a local setup and shouldn't be in the repo.- This and #24 (macOS) conflict in 16 files. I'd like to merge #24 first, since it has had two rounds and is close, and then have this rebase onto it. #24 wraps the Windows-only parts in
#[cfg(windows)] mod impwith one#[cfg(not(windows))]stub module, so macOS and Linux share the stubs until Linux replaces them in parts 2 to 6, and the Windows code stays in one block instead of an attribute on every item. Could you move to that layout when you rebase?
Smaller: stubs that return Err("stub") would reach the UI like that; "not supported on Linux yet" reads better. setup::remove returns Outcome::Done without removing anything and current_recording_stem always returns 2026-01-01 00:00, which is fine as placeholders if parts 4 and 6 replace them. linux/elevated.rs declares geteuid by hand while libc is already a dependency. The CI job installs ffmpeg and openh264 dev packages that part 1 doesn't seem to use yet.
|
Hello @thtbee Thanks for taking the time to look into that. Your suggestion inverts this situation, and probably the code of the next 5 PRs gets it straight for #24. Same or very similar for the CI. It is currently based on the complete set of these 6 stacked PRs and will be much likely the same after all steps have been taken into consideration. I'm going to run a deeper analysis against the other, follow-up branches and get back to you on this. Again thanks, and no worries, we're going to untangle this. ✌️ Cheers |
…(Part 1) Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
bcc2cae to
5fd3f59
Compare
|
Hi @thtbee First three remarks have been addressed, and I hope resolved as intended. As for "the PR race" 😸 , this one has been aligned with #24 to keep it as simple and pain-free as possible to merge the code bases. Shared cross-platform files match PR #24 's exact structure, and parts 2-6 progressively layer Linux capabilities onto that structure. Cheers |
Both ports' CI jobs, link libraries and platform modules side by side; vcam keeps this branch's shm, which serves macOS too, instead of thtbee#24's stubs.
thtbee
left a comment
There was a problem hiding this comment.
Checked the new version: the shared memory is per user, 0600 and opened with O_NOFOLLOW with the owner checked, translations build on Linux only, the sysroot setup is gone, and the shared files use the same layout as #24. I merged main (with #24) into the branch: both ports' CI jobs, link libraries and module lines side by side, and vcam keeps your shm, which macOS now uses too instead of #24's stubs. CI is green on all three platforms. Thanks for reworking it.
Two small things for later parts: on Linux, a watched process always reports exit code 0 (notify-when), though the CLI can't know it there, so none would be more honest; and the /proc fallback in linux/net.rs includes /proc/net/arp, which changes all the time and would report network changes every few seconds. Also, when part 3 makes Linux windows frameless, CaptionButtons.qml needs Linux back in its visible check, since #24 shows the buttons on Windows only.
Summary
First slice of splitting the Linux desktop port (#12) into 6 focused, independently reviewable PRs as requested in #12 (review).
Every change outside
desktop/app/src/linux/anddesktop/packaging/linux/is strictly gated behind#[cfg(windows)]/#[cfg(target_os = "linux")](#ifdef _WIN32in C++) so existing Windows and shared code paths remain untouched.What's in Part 1 (
linux-1-build)windowscrate dependency indesktop/app/Cargo.tomlanddesktop/vcam/Cargo.toml; add Linux dependencies (libc,fuser).desktop/app/build.rsandspikes/s1-qt-rust/build.rs(CARGO_CFG_TARGET_OS == "windows")..github/workflows/ci.ymlto build and test the full workspace (--workspace) on Linux with Qt 6.12 installed viajurplel/install-qt-action@v4.desktop/app/cpp/native_window.cpp,desktop/app/cpp/app_helpers.cpp, andspikes/s1-qt-rust/cpp/*with#ifdef _WIN32and provide Linux equivalents (QGuiApplication::screens()primary refresh rate,QClipboardimage fallback,/proc/self/statmRSS reading).desktop/app/src/linux/):linux/mod.rssystem probes (machine_guid,os_version,os_build_number,is_laptop,power_saver,system_dark,reduce_motion,work_area,secure_random),linux/elevated.rs(geteuid/pkexec),linux/icon.rs(embedded PNG writer),linux/net.rs(AF_NETLINKroute address watcher), and compile-ready module stubs for the remaining submodules filled in Parts 2–6.shm_open/mmapshared-memory frame backing indesktop/vcam/src/shm.rs.core/nectarlink-cli):linux_watchprocess watcher (pidfd_open+/proc/<pid>/stat) fornectarlink-cli notify-whenandDesktopDirIPC transport on Linux (flocklock detection +instance.sockwakeup).desktop/packaging/linux/):.deb, AppImage, and portable.tar.gzpackaging scripts,.desktoplauncher, and AppStream metadata (org.nectarlink.desktop.metainfo.xml).Series Roadmap
linux-1-build) — Build, CI, Qt6 windowing,linux/mod.rsfoundation, CLIlinux_watch, and packaging (this PR)linux-2-basics) — Clipboard, Freedesktop notifications (toast.rs,pc_notifications.rs), tray & hotkeys, autostart, shell, shortcuts, single-instance, widget, WoL, BLE beacon, and doctor checkslinux-3-input) — Input injection (uinput/ Wayland / X11), deck actions, frameless Wayland/X11 window move/resize filter, and window capturelinux-4-media) — Audio (wpctl/pactl), low-latency PCM output, PC loopback audio stream, MPRIS (media_sessions.rs,smtc.rs), OpenH264/FFmpeg H.264 & MP4, phone/PC screen mirroring, v4l2loopback virtual camera, PipeWire/PulseAudio virtual microphone, Bluetooth HFP, and voice recording conversionlinux-5-storage) — FUSE3 virtual filesystem (fuser) and file-manager sidebar bookmarks (gtk-3.0/bookmarks,user-places.xbel)linux-6-updater) — Linux HTTP client (curl), self-updater (.deb/.AppImage/.tar.gz), and setup uninstaller