From 07aa561295895cca5ea2afcb5db9775f3bbd4c77 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:58:46 +0100 Subject: [PATCH] ohos: Remove unneeded dirs dependency in servo_config (#34166) `dirs` does not support OpenHarmony, and it also seems that there currently is no native API that `dirs` could use on OpenHarmony and the directory needs to be read from ArkTS. Signed-off-by: Jonathan Schwender --- components/config/Cargo.toml | 2 +- components/config/basedir.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index 8a0600f35e4..ea2feb49b5e 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -25,5 +25,5 @@ servo_url = { path = "../url" } style_config = { workspace = true } url = { workspace = true } -[target.'cfg(not(target_os = "android"))'.dependencies] +[target.'cfg(not(any(target_os = "android", target_env = "ohos")))'.dependencies] dirs = "5.0" diff --git a/components/config/basedir.rs b/components/config/basedir.rs index a7e5226dea9..2fa70408a34 100644 --- a/components/config/basedir.rs +++ b/components/config/basedir.rs @@ -12,7 +12,8 @@ use std::path::PathBuf; unix, not(target_os = "macos"), not(target_os = "ios"), - not(target_os = "android") + not(target_os = "android"), + not(target_env = "ohos") ))] pub fn default_config_dir() -> Option { let mut config_dir = ::dirs::config_dir().unwrap(); @@ -21,7 +22,7 @@ pub fn default_config_dir() -> Option { Some(config_dir) } -#[cfg(target_os = "android")] +#[cfg(any(target_os = "android", target_env = "ohos"))] pub fn default_config_dir() -> Option { None }