From 62b0fe82400050f0cd776d92944be94ebe01dee7 Mon Sep 17 00:00:00 2001 From: Leah Anderson Date: Sat, 5 Jul 2025 14:38:39 -0600 Subject: [PATCH 1/4] fix hexagon_launcher crashing (#8) --- Cargo.lock | 5 +++-- hexagon_launcher/Cargo.toml | 1 + hexagon_launcher/src/main.rs | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af413db..42dccbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1165,6 +1165,7 @@ dependencies = [ "clap", "color-eyre", "glam 0.25.0", + "libc", "manifest-dir-macros", "protostar", "serde", @@ -1365,9 +1366,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libredox" diff --git a/hexagon_launcher/Cargo.toml b/hexagon_launcher/Cargo.toml index c90b4bb..9098c25 100644 --- a/hexagon_launcher/Cargo.toml +++ b/hexagon_launcher/Cargo.toml @@ -15,3 +15,4 @@ tokio = { workspace = true } serde = { workspace = true } stardust-xr-fusion = { workspace = true } stardust-xr-molecules = { workspace = true } +libc = "0.2.174" diff --git a/hexagon_launcher/src/main.rs b/hexagon_launcher/src/main.rs index 160fe44..e616fc7 100644 --- a/hexagon_launcher/src/main.rs +++ b/hexagon_launcher/src/main.rs @@ -34,10 +34,12 @@ const ACTIVATION_DISTANCE: f32 = 0.05; const DEFAULT_HEX_COLOR: Rgba = rgba_linear!(0.211, 0.937, 0.588, 1.0); const BTN_SELECTED_COLOR: Rgba = rgba_linear!(0.0, 1.0, 0.0, 1.0); const BTN_COLOR: Rgba = rgba_linear!(1.0, 1.0, 0.0, 1.0); - #[tokio::main(flavor = "current_thread")] async fn main() -> Result<()> { - color_eyre::install().unwrap(); + unsafe { + libc::signal(libc::SIGPIPE, libc::SIG_DFL); + } + color_eyre::install().unwrap(); tracing_subscriber::fmt() .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) .pretty() -- 2.49.1 From cbd99c2cc796db2a5803b4f843ced8db0735e7aa Mon Sep 17 00:00:00 2001 From: AnnoyingRains Date: Sun, 31 Aug 2025 01:40:41 +1000 Subject: [PATCH 2/4] fix: nix --- flake.lock | 17 ++++++----------- flake.nix | 7 +++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 3fc6377..c25f415 100644 --- a/flake.lock +++ b/flake.lock @@ -1,17 +1,12 @@ { "nodes": { "crane": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, "locked": { - "lastModified": 1712681629, - "narHash": "sha256-bMDXn4AkTXLCpoZbII6pDGoSeSe9gI87jxPsHRXgu/E=", + "lastModified": 1755993354, + "narHash": "sha256-FCRRAzSaL/+umLIm3RU3O/+fJ2ssaPHseI2SSFL8yZU=", "owner": "ipetkov", "repo": "crane", - "rev": "220387ac8e99cbee0ca4c95b621c4bc782b6a235", + "rev": "25bd41b24426c7734278c2ff02e53258851db914", "type": "github" }, "original": { @@ -22,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1756386758, + "narHash": "sha256-1wxxznpW2CKvI9VdniaUnTT2Os6rdRJcRUf65ZK9OtE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "dfb2f12e899db4876308eba6d93455ab7da304cd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d2629c7..7d88a7e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,6 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; crane = { - inputs.nixpkgs.follows = "nixpkgs"; url = "github:ipetkov/crane"; }; }; @@ -13,9 +12,9 @@ forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); in { - packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in { - default = crane.lib.${system}.buildPackage { - pname = "protostar"; + packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; craneLib = crane.mkLib pkgs; in { + default = craneLib.buildPackage { + pname = "hexagon-launcher"; version = "0.1.0"; src = ./.; -- 2.49.1 From e60463081eb5136ee03caecd1f40301407763812 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 30 Aug 2025 18:09:23 +0200 Subject: [PATCH 3/4] Revert "fix hexagon_launcher crashing (#8)" This reverts commit 62b0fe82400050f0cd776d92944be94ebe01dee7. This fix only stopped hexagon_launcher from exiting properly upon receiving a fatal error --- Cargo.lock | 5 ++--- hexagon_launcher/Cargo.toml | 1 - hexagon_launcher/src/main.rs | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42dccbb..af413db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1165,7 +1165,6 @@ dependencies = [ "clap", "color-eyre", "glam 0.25.0", - "libc", "manifest-dir-macros", "protostar", "serde", @@ -1366,9 +1365,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.174" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libredox" diff --git a/hexagon_launcher/Cargo.toml b/hexagon_launcher/Cargo.toml index 9098c25..c90b4bb 100644 --- a/hexagon_launcher/Cargo.toml +++ b/hexagon_launcher/Cargo.toml @@ -15,4 +15,3 @@ tokio = { workspace = true } serde = { workspace = true } stardust-xr-fusion = { workspace = true } stardust-xr-molecules = { workspace = true } -libc = "0.2.174" diff --git a/hexagon_launcher/src/main.rs b/hexagon_launcher/src/main.rs index e616fc7..160fe44 100644 --- a/hexagon_launcher/src/main.rs +++ b/hexagon_launcher/src/main.rs @@ -34,12 +34,10 @@ const ACTIVATION_DISTANCE: f32 = 0.05; const DEFAULT_HEX_COLOR: Rgba = rgba_linear!(0.211, 0.937, 0.588, 1.0); const BTN_SELECTED_COLOR: Rgba = rgba_linear!(0.0, 1.0, 0.0, 1.0); const BTN_COLOR: Rgba = rgba_linear!(1.0, 1.0, 0.0, 1.0); + #[tokio::main(flavor = "current_thread")] async fn main() -> Result<()> { - unsafe { - libc::signal(libc::SIGPIPE, libc::SIG_DFL); - } - color_eyre::install().unwrap(); + color_eyre::install().unwrap(); tracing_subscriber::fmt() .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) .pretty() -- 2.49.1 From 01ec90c699e99437aef39e498291cd622f32bd93 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 30 Aug 2025 18:15:47 +0200 Subject: [PATCH 4/4] fix(hexagon_launcher): use the proper resource init function Signed-off-by: Schmarni --- hexagon_launcher/src/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hexagon_launcher/src/main.rs b/hexagon_launcher/src/main.rs index 160fe44..f526959 100644 --- a/hexagon_launcher/src/main.rs +++ b/hexagon_launcher/src/main.rs @@ -5,24 +5,24 @@ use app::App; use color_eyre::eyre::Result; use glam::Quat; use hex::{HEX_CENTER, HEX_DIRECTION_VECTORS}; -use manifest_dir_macros::directory_relative_path; -use protostar::xdg::{get_desktop_files, parse_desktop_file, DesktopFile}; +use protostar::xdg::{DesktopFile, get_desktop_files, parse_desktop_file}; use serde::{Deserialize, Serialize}; use stardust_xr_fusion::{ + ClientHandle, client::Client, core::values::{ - color::{color_space::LinearRgb, rgba_linear, Rgba}, ResourceID, + color::{Rgba, color_space::LinearRgb, rgba_linear}, }, drawable::{MaterialParameter, Model, ModelPartAspect}, node::NodeError, + project_local_resources, root::{ClientState, FrameInfo, RootAspect, RootEvent}, spatial::{Spatial, SpatialAspect, Transform}, - ClientHandle, }; use stardust_xr_molecules::{ - button::{Button, ButtonSettings}, FrameSensitive, Grabbable, GrabbableSettings, PointerMode, UIElement, + button::{Button, ButtonSettings}, }; use std::{f32::consts::PI, sync::Arc, time::Duration}; @@ -43,12 +43,9 @@ async fn main() -> Result<()> { .pretty() .init(); let owned_client = Client::connect().await?; + owned_client.setup_resources(&[&project_local_resources!("../res")])?; let client = owned_client.handle(); let async_loop = owned_client.async_event_loop(); - client - .get_root() - .set_base_prefixes(&[directory_relative_path!("../res").to_string()]) - .unwrap(); let mut grid = AppHexGrid::new(&client).await; let mut owned_client = async_loop.stop().await.unwrap(); let event_loop = owned_client.sync_event_loop(|handle, _| { -- 2.49.1