diff --git a/Cargo.lock b/Cargo.lock index 193a2e16b2..60b509d2b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2881,7 +2881,6 @@ dependencies = [ "cfg-if", "chrono", "clap", - "cli-support", "copypasta", "glob", "heck", diff --git a/components/support/nimbus-cli/Cargo.toml b/components/support/nimbus-cli/Cargo.toml index 205342bd9b..23f806b4c1 100644 --- a/components/support/nimbus-cli/Cargo.toml +++ b/components/support/nimbus-cli/Cargo.toml @@ -15,7 +15,6 @@ clap = {version = "4.2", default-features = false, features = ["std", "derive", anyhow = "1.0.44" remote_settings = { path = "../../remote_settings" } nimbus-fml = { path = "../nimbus-fml", features = ["client-lib"] } -cli-support = { path = "../../../examples/cli-support" } serde_json = "1" serde = { version = "1.0", features = ["derive"] } thiserror = "2" diff --git a/components/support/nimbus-cli/src/sources/experiment_list.rs b/components/support/nimbus-cli/src/sources/experiment_list.rs index e1d52c2481..f1ae4d762d 100644 --- a/components/support/nimbus-cli/src/sources/experiment_list.rs +++ b/components/support/nimbus-cli/src/sources/experiment_list.rs @@ -219,17 +219,35 @@ impl TryFrom<&ExperimentListSource> for Value { endpoint, is_preview, } => { - use cli_support::remote_settings_service; - use remote_settings::RemoteSettingsServer; + use remote_settings::{ + RemoteSettingsConfig2, RemoteSettingsServer, RemoteSettingsService, + }; let collection_name = if *is_preview { "nimbus-preview".to_string() } else { "nimbus-mobile-experiments".to_string() }; + // taken from cli-support, since depending on it means it needs to link NSS + let cargo_output = std::process::Command::new(env!("CARGO")) + .arg("locate-project") + .arg("--workspace") + .arg("--message-format=plain") + .output() + .unwrap() + .stdout; + let cargo_toml_path = Path::new(std::str::from_utf8(&cargo_output).unwrap().trim()); + let workspace_dir = cargo_toml_path.parent().unwrap().to_path_buf(); + let rs_dir = workspace_dir.join("./cli-data/remote-settings"); let server = RemoteSettingsServer::Custom { url: endpoint.clone(), }; - let rs_service = remote_settings_service(Some(server)); + let config = RemoteSettingsConfig2 { + server: Some(server), + ..Default::default() + }; + let rs_service = + RemoteSettingsService::new(rs_dir.to_string_lossy().to_string(), config); + let client = rs_service.make_client(collection_name); let response = client.get_records(true); serde_json::to_value(response)?