Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 1 addition & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::fs;

Check warning on line 1 in alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs

View workflow job for this annotation

GitHub Actions / check-linux-latest

warning: unused import: `std::fs` --> alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs:1:5 | 1 | use std::fs; | ^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
use std::path::Path;
use std::process::Command;

use alvr_common::anyhow::bail;

Check warning on line 5 in alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs

View workflow job for this annotation

GitHub Actions / check-linux-latest

warning: unused import: `alvr_common::anyhow::bail` --> alvr/dashboard/src/steamvr_launcher/linux_steamvr.rs:5:5 | 5 | use alvr_common::anyhow::bail; | ^^^^^^^^^^^^^^^^^^^^^^^^^
use alvr_common::{debug, error, info, warn};
use sysinfo::Process;

Expand All @@ -17,43 +17,6 @@
process.kill_with(sysinfo::Signal::Term);
}

pub fn maybe_wrap_vrcompositor_launcher() -> alvr_common::anyhow::Result<()> {
let steamvr_bin_dir = alvr_server_io::steamvr_root_dir()?
.join("bin")
.join("linux64");
let steamvr_vrserver_path = steamvr_bin_dir.join("vrserver");
debug!(
"File path used to check for linux files: {}",
steamvr_vrserver_path.display().to_string()
);
match steamvr_vrserver_path.try_exists() {
Ok(exists) => {
if !exists {
bail!(
"SteamVR Linux files missing, aborting startup, please re-check compatibility tools for SteamVR, verify integrity of files for SteamVR and make sure you're not using Flatpak Steam with non-Flatpak ALVR."
);
}
}
Err(e) => {
return Err(e.into());
}
};

let launcher_path = steamvr_bin_dir.join("vrcompositor");
// In case of SteamVR update, vrcompositor will be restored
if fs::read_link(&launcher_path).is_ok() {
fs::remove_file(&launcher_path)?; // recreate the link
} else {
fs::rename(&launcher_path, steamvr_bin_dir.join("vrcompositor.real"))?;
}

std::os::unix::fs::symlink(
crate::get_filesystem_layout().vrcompositor_wrapper(),
&launcher_path,
)?;

Ok(())
}
#[derive(PartialEq)]
enum DeviceInfo {
Nvidia,
Expand Down
9 changes: 0 additions & 9 deletions alvr/dashboard/src/steamvr_launcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ impl Launcher {
warn!("Failed to unblock ALVR driver: {:?}", err);
}

#[cfg(target_os = "linux")]
{
let vrcompositor_wrap_result = linux_steamvr::maybe_wrap_vrcompositor_launcher();
alvr_common::show_err(linux_steamvr::maybe_wrap_vrcompositor_launcher());
if vrcompositor_wrap_result.is_err() {
return;
}
}

if !is_steamvr_running() {
debug!("SteamVR is dead. Launching...");

Expand Down
34 changes: 0 additions & 34 deletions alvr/filesystem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ pub fn dashboard_fname() -> &'static str {
pub struct Layout {
// directory containing the dashboard executable
pub executables_dir: PathBuf,
// (linux only) directory where libalvr_vulkan_layer.so is saved
pub libraries_dir: PathBuf,
// parent directory of resources like the dashboard and presets folders
pub static_resources_dir: PathBuf,
// directory for storing configuration files (session.json)
Expand All @@ -95,16 +93,12 @@ pub struct Layout {
pub log_dir: PathBuf,
// directory to register in openVR driver path
pub openvr_driver_root_dir: PathBuf,
// (linux only) parent directory of the executable to wrap vrcompositor
pub vrcompositor_wrapper_dir: PathBuf,
// (linux only) parent directory of the firewall script
pub firewall_script_dir: PathBuf,
// (linux only) parent directory of the firewalld config
pub firewalld_config_dir: PathBuf,
// (linux only) parent directory of the ufw config
pub ufw_config_dir: PathBuf,
// (linux only) directory where the vulkan layer manifest is saved
pub vulkan_layer_manifest_dir: PathBuf,
pub launcher_root: Option<PathBuf>,
}

Expand All @@ -117,20 +111,13 @@ impl Layout {

// Get paths from environment or use FHS compliant paths
let executables_dir = or_path(option_env!("ALVR_EXECUTABLES_DIR"), "bin");
let libraries_dir = or_path(option_env!("ALVR_LIBRARIES_DIR"), "lib64");
let static_resources_dir =
or_path(option_env!("ALVR_STATIC_RESOURCES_DIR"), "share/alvr");
let openvr_driver_root_dir =
or_path(option_env!("ALVR_OPENVR_DRIVER_ROOT_DIR"), "lib64/alvr");
let vrcompositor_wrapper_dir =
or_path(option_env!("ALVR_VRCOMPOSITOR_WRAPPER_DIR"), "libexec/alvr");
let firewall_script_dir = or_path(option_env!("FIREWALL_SCRIPT_DIR"), "libexec/alvr");
let firewalld_config_dir = or_path(option_env!("FIREWALLD_CONFIG_DIR"), "libexec/alvr");
let ufw_config_dir = or_path(option_env!("UFW_CONFIG_DIR"), "libexec/alvr");
let vulkan_layer_manifest_dir = or_path(
option_env!("ALVR_VULKAN_LAYER_MANIFEST_DIR"),
"share/vulkan/explicit_layer.d",
);

let config_dir = option_env!("ALVR_CONFIG_DIR")
.map_or_else(|| dirs::config_dir().unwrap().join("alvr"), PathBuf::from);
Expand All @@ -139,16 +126,13 @@ impl Layout {

Self {
executables_dir,
libraries_dir,
static_resources_dir,
config_dir,
log_dir,
openvr_driver_root_dir,
vrcompositor_wrapper_dir,
firewall_script_dir,
firewalld_config_dir,
ufw_config_dir,
vulkan_layer_manifest_dir,
launcher_root: root
.parent()
.and_then(|p| p.parent())
Expand All @@ -164,11 +148,9 @@ impl Layout {
config_dir: root.to_owned(),
log_dir: root.to_owned(),
openvr_driver_root_dir: root.to_owned(),
vrcompositor_wrapper_dir: root.to_owned(),
firewall_script_dir: root.to_owned(),
firewalld_config_dir: root.to_owned(),
ufw_config_dir: root.to_owned(),
vulkan_layer_manifest_dir: root.to_owned(),
launcher_root: root.parent().and_then(|p| p.parent()).map(|p| p.to_owned()),
}
}
Expand Down Expand Up @@ -252,18 +234,6 @@ impl Layout {
self.openvr_driver_root_dir.join("driver.vrdrivermanifest")
}

pub fn vrcompositor_wrapper(&self) -> PathBuf {
self.vrcompositor_wrapper_dir.join("vrcompositor-wrapper")
}

pub fn drm_lease_shim(&self) -> PathBuf {
self.vrcompositor_wrapper_dir.join("alvr_drm_lease_shim.so")
}

pub fn vulkan_layer(&self) -> PathBuf {
self.libraries_dir.join(dynlib_fname("alvr_vulkan_layer"))
}

pub fn firewall_script(&self) -> PathBuf {
self.firewall_script_dir.join("alvr_fw_config.sh")
}
Expand All @@ -276,10 +246,6 @@ impl Layout {
self.ufw_config_dir.join("ufw-alvr")
}

pub fn vulkan_layer_manifest(&self) -> PathBuf {
self.vulkan_layer_manifest_dir.join("alvr_x86_64.json")
}

pub fn launcher_exe(&self) -> Option<PathBuf> {
self.launcher_root
.as_ref()
Expand Down
3 changes: 2 additions & 1 deletion alvr/server_openvr/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ fn main() {
let mut build = cc::Build::new();
build
.cpp(true)
.std("c++17")
.std("c++20")
.flag_if_supported("-fdiagnostics-color=always")
.files(source_files_paths)
.include(alvr_filesystem::workspace_dir().join("openvr/headers"))
.include("cpp");
Expand Down
Loading
Loading