Skip to content

Commit 5c94119

Browse files
authored
Move SWITCH_ZONE_BASEBOARD_FILE to sled-agent-types (#7669)
This allows us to remove the dependency on sled-agent in zone-setup, which is pulled in for a single type definition. Without this change a debug build currently relies on libnvme.so, while the compiler is able to elide this library on a release build: ``` Finished `dev` profile [unoptimized + debuginfo] target(s) in 4m 14s Error: Found library issues with the following: nexus UNEXPECTED dependency on libsqlite3.so.0 omicron-dev UNEXPECTED dependency on libsqlite3.so.0 zone-setup NEEDS libnvme.so.1 but is not allowed If depending on a new library was intended please add it to xtask.toml ``` And after this change we no longer depend on it in debug/release builds: ``` Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 10s Error: Found library issues with the following: nexus UNEXPECTED dependency on libsqlite3.so.0 omicron-dev UNEXPECTED dependency on libsqlite3.so.0 If depending on a new library was intended please add it to xtask.toml ```
1 parent 8098f18 commit 5c94119

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sled-agent/src/services.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ use omicron_ddm_admin_client::{Client as DdmAdminClient, DdmError};
9898
use omicron_uuid_kinds::OmicronZoneUuid;
9999
use rand::prelude::SliceRandom;
100100
use sled_agent_types::{
101+
sled::SWITCH_ZONE_BASEBOARD_FILE,
101102
time_sync::TimeSync,
102103
zone_bundle::{ZoneBundleCause, ZoneBundleMetadata},
103104
};
@@ -138,8 +139,6 @@ const CLICKHOUSE_KEEPER_BINARY: &str =
138139
"/opt/oxide/clickhouse_keeper/clickhouse";
139140
const CLICKHOUSE_BINARY: &str = "/opt/oxide/clickhouse/clickhouse";
140141

141-
pub const SWITCH_ZONE_BASEBOARD_FILE: &str = "/opt/oxide/baseboard.json";
142-
143142
#[derive(thiserror::Error, Debug, slog_error_chain::SlogInlineError)]
144143
pub enum Error {
145144
#[error("Failed to initialize CockroachDb: {err}")]

sled-agent/types/src/sled.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ use serde::{Deserialize, Serialize};
1717
use sha3::{Digest, Sha3_256};
1818
use uuid::Uuid;
1919

20+
pub const SWITCH_ZONE_BASEBOARD_FILE: &str = "/opt/oxide/baseboard.json";
21+
2022
/// A representation of a Baseboard ID as used in the inventory subsystem
2123
/// This type is essentially the same as a `Baseboard` except it doesn't have a
2224
/// revision or HW type (Gimlet, PC, Unknown).

zone-setup/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ omicron-common.workspace = true
1717
omicron-workspace-hack.workspace = true
1818
oxnet.workspace = true
1919
serde_json.workspace = true
20+
sled-agent-types.workspace = true
2021
sled-hardware-types.workspace = true
2122
slog.workspace = true
2223
tokio.workspace = true
2324
uzers.workspace = true
2425
zone.workspace = true
25-
omicron-sled-agent.workspace = true

zone-setup/src/bin/zone-setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use illumos_utils::ExecutionError;
1818
use omicron_common::backoff::{retry_notify, retry_policy_local, BackoffError};
1919
use omicron_common::cmd::fatal;
2020
use omicron_common::cmd::CmdError;
21-
use omicron_sled_agent::services::SWITCH_ZONE_BASEBOARD_FILE;
2221
use oxnet::Ipv6Net;
22+
use sled_agent_types::sled::SWITCH_ZONE_BASEBOARD_FILE;
2323
use sled_hardware_types::underlay::BOOTSTRAP_PREFIX;
2424
use slog::{info, Logger};
2525
use std::fmt::Write as _;

0 commit comments

Comments
 (0)