Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to Rust 1.78.0 / bump OPTE to 0.29.250 #5722

Merged
merged 9 commits into from
May 23, 2024
Merged
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
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/a4x2-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#:
#: name = "a4x2-deploy"
#: variety = "basic"
#: target = "lab-2.0-opte-0.27"
#: target = "lab-2.0-opte-0.29"
#: output_rules = [
#: "/out/falcon/*.log",
#: "/out/falcon/*.err",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/a4x2-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "a4x2-prepare"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = [
#: "=/out/cargo-bay-ce.tgz",
#: "=/out/cargo-bay-cr1.tgz",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/build-and-test-helios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "build-and-test (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = [
#: "%/work/*",
#: "%/var/tmp/omicron_tmp/*",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/build-and-test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "build-and-test (ubuntu-22.04)"
#: variety = "basic"
#: target = "ubuntu-22.04"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = [
#: "%/work/*",
#: "%/var/tmp/omicron_tmp/*",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "clippy (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = []

# Run clippy on illumos (not just other systems) because a bunch of our code
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/omicron-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "omicron-common (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = []

# Verify that omicron-common builds successfully when used as a dependency
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "helios / package"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = [
#: "=/work/package.tar.gz",
#: ]
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/tuf-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "helios / build TUF repo"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.77.2"
#: rust_toolchain = "1.78.0"
#: output_rules = [
#: "=/work/manifest.toml",
#: "=/work/repo.zip",
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ omicron-sled-agent = { path = "sled-agent" }
omicron-test-utils = { path = "test-utils" }
omicron-zone-package = "0.11.0"
oxide-client = { path = "clients/oxide-client" }
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "4cc823b50d3e4a629cdfaab2b3d3382514174ba9", features = [ "api", "std" ] }
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "194a8d1d6443f78d59702a25849607dba33db732", features = [ "api", "std" ] }
once_cell = "1.19.0"
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
openapiv3 = "2.0.0"
# must match samael's crate!
openssl = "0.10"
openssl-sys = "0.9"
opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "4cc823b50d3e4a629cdfaab2b3d3382514174ba9" }
opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "194a8d1d6443f78d59702a25849607dba33db732" }
oso = "0.27"
owo-colors = "4.0.0"
oximeter = { path = "oximeter/oximeter" }
Expand Down
4 changes: 2 additions & 2 deletions certificates/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ mod tests {
// Valid certs: either no key usage values, or valid ones.
for ext_key_usage in &valid_ext_key_usage {
let mut params = CertificateParams::new(vec![HOST.to_string()]);
params.extended_key_usages = ext_key_usage.clone();
params.extended_key_usages.clone_from(ext_key_usage);

assert!(
validate_cert_with_params(params, &[HOST]).is_ok(),
Expand All @@ -431,7 +431,7 @@ mod tests {

for ext_key_usage in &invalid_ext_key_usage {
let mut params = CertificateParams::new(vec![HOST.to_string()]);
params.extended_key_usages = ext_key_usage.clone();
params.extended_key_usages.clone_from(ext_key_usage);

assert!(
matches!(
Expand Down
19 changes: 0 additions & 19 deletions dev-tools/omdb/src/bin/omdb/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,16 +1273,6 @@ async fn cmd_db_disk_physical(

// SERVICES

#[derive(Tabled)]
#[tabled(rename_all = "SCREAMING_SNAKE_CASE")]
struct ServiceInstanceRow {
#[tabled(rename = "SERVICE")]
kind: String,
instance_id: Uuid,
addr: String,
sled_serial: String,
}

// Snapshots
fn format_snapshot(state: &SnapshotState) -> impl Display {
match state {
Expand Down Expand Up @@ -1438,15 +1428,6 @@ async fn cmd_db_snapshot_info(

// SLEDS

#[derive(Tabled)]
#[tabled(rename_all = "SCREAMING_SNAKE_CASE")]
struct ServiceInstanceSledRow {
#[tabled(rename = "SERVICE")]
kind: String,
instance_id: Uuid,
addr: String,
}

#[derive(Tabled)]
#[tabled(rename_all = "SCREAMING_SNAKE_CASE")]
struct SledRow {
Expand Down
10 changes: 0 additions & 10 deletions dev-tools/omdb/src/bin/omdb/mgs/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@ trait Attributes: DynClone {
fn y_axis_label(&self) -> String;
fn axis_value(&self, val: f64) -> String;
fn legend_value(&self, val: f64) -> String;

fn increase(&mut self, _ndx: usize) -> Option<u8> {
None
}

fn decrease(&mut self, _ndx: usize) -> Option<u8> {
None
}

fn clear(&mut self) {}
}

dyn_clone::clone_trait_object!(Attributes);
Expand Down
4 changes: 1 addition & 3 deletions dev-tools/omdb/src/bin/omdb/mgs/sensors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,10 @@ fn sp_info_csv<R: std::io::Read>(
}

if let Some(sensor) = Sensor::from_string(&record[1], &record[2]) {
if sensors.get(&sensor).is_some() {
if !sensors.insert(sensor.clone()) {
break;
}

sensors.insert(sensor.clone());

for (ndx, sp) in sps.iter().enumerate() {
if let Some(sp) = sp {
let value = match record[ndx + len].parse::<f32>() {
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-model/src/omicron_zone_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl OmicronZone {
let (first_port, last_port) = snat_cfg.port_range_raw();
ntp_ntp_servers = Some(ntp_servers.clone());
ntp_dns_servers = Some(dns_servers.clone());
ntp_ntp_domain = domain.clone();
ntp_ntp_domain.clone_from(domain);
snat_ip = Some(IpNetwork::from(snat_cfg.ip));
snat_first_port = Some(SqlU16::from(first_port));
snat_last_port = Some(SqlU16::from(last_port));
Expand Down Expand Up @@ -162,7 +162,7 @@ impl OmicronZone {
} => {
ntp_ntp_servers = Some(ntp_servers.clone());
ntp_dns_servers = Some(dns_servers.clone());
ntp_ntp_domain = domain.clone();
ntp_ntp_domain.clone_from(domain);
(ZoneType::InternalNtp, address, None)
}
OmicronZoneType::Nexus {
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-queries/src/db/datastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,8 @@ mod test {
// This is a little goofy, but it catches a bug that has
// happened before. The returned columns share names (like
// "id"), so we need to process them in-order.
assert!(regions.get(&dataset.id()).is_none());
assert!(disk_datasets.get(&region.id()).is_none());
assert!(!regions.contains(&dataset.id()));
assert!(!disk_datasets.contains(&region.id()));

// Dataset must not be eligible for provisioning.
if let Some(kind) =
Expand Down
35 changes: 7 additions & 28 deletions nexus/db-queries/src/db/explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

//! Utility allowing Diesel to EXPLAIN queries.

// These utilities can be useful during development, so we don't want to
// `#[cfg(test)]` the module, but it's likely they won't be used outside of
// tests.
#![cfg_attr(not(test), allow(dead_code))]

use super::pool::DbConnection;
use async_bb8_diesel::AsyncRunQueryDsl;
use async_trait::async_trait;
Expand All @@ -17,33 +22,6 @@ use diesel::result::Error as DieselError;
/// Q: The Query we're explaining.
///
/// EXPLAIN: <https://www.cockroachlabs.com/docs/stable/explain.html>
pub trait Explainable<Q> {
/// Syncronously issues an explain statement.
fn explain(
self,
conn: &mut DbConnection,
) -> Result<String, diesel::result::Error>;
}

impl<Q> Explainable<Q> for Q
where
Q: QueryFragment<Pg>
+ QueryId
+ RunQueryDsl<DbConnection>
+ Sized
+ 'static,
{
fn explain(
self,
conn: &mut DbConnection,
) -> Result<String, diesel::result::Error> {
Ok(ExplainStatement { query: self }
.get_results::<String>(conn)?
.join("\n"))
}
}

/// An async variant of [`Explainable`].
#[async_trait]
pub trait ExplainableAsync<Q> {
/// Asynchronously issues an explain statement.
Expand Down Expand Up @@ -185,7 +163,8 @@ mod test {
logctx.cleanup_successful();
}

// Tests that ".explain()" can tell us when we're doing full table scans.
// Tests that ".explain_async()" can tell us when we're doing full table
// scans.
#[tokio::test]
async fn test_explain_full_table_scan() {
let logctx = dev::test_setup_log("test_explain_full_table_scan");
Expand Down
12 changes: 0 additions & 12 deletions nexus/db-queries/src/db/raw_query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ enum TrustedStrVariants {
ValidatedExplicitly(String),
}

trait SqlQueryBinds {
fn add_bind(self, bind_counter: &BindParamCounter) -> Self;
}

impl<'a, Query> SqlQueryBinds
for diesel::query_builder::BoxedSqlQuery<'a, Pg, Query>
{
fn add_bind(self, bind_counter: &BindParamCounter) -> Self {
self.sql("$").sql(bind_counter.next().to_string())
}
}

type BoxedQuery = diesel::query_builder::BoxedSqlQuery<
'static,
Pg,
Expand Down
3 changes: 2 additions & 1 deletion nexus/src/app/background/sync_switch_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@ impl BackgroundTask for SwitchPortSettingsManager {

// Same thing as above, check to see if we've already built the announce set,
// if so we'll skip this step
if bgp_announce_prefixes.get(&bgp_config.bgp_announce_set_id).is_none() {
#[allow(clippy::map_entry)]
if !bgp_announce_prefixes.contains_key(&bgp_config.bgp_announce_set_id) {
let announcements = match self
.datastore
.bgp_announce_list(
Expand Down
9 changes: 3 additions & 6 deletions nexus/src/app/sagas/snapshot_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1572,12 +1572,9 @@ fn create_snapshot_from_disk(

if let Some(socket_map) = socket_map {
for target in &mut opts.target {
*target = socket_map
.get(target)
.ok_or_else(|| {
anyhow!("target {} not found in map!", target)
})?
.clone();
target.clone_from(socket_map.get(target).ok_or_else(
|| anyhow!("target {} not found in map!", target),
)?);
}
}

Expand Down
2 changes: 1 addition & 1 deletion oximeter/db/src/oxql/ast/table_ops/group_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ mod tests {
)
.unwrap();
ts0.points.start_times = None;
ts0.points.timestamps = timestamps.clone();
ts0.points.timestamps.clone_from(&timestamps);
*ts0.points.values_mut(0).unwrap() = ValueArray::Double(vec![
Some(1.0),
if matches!(
Expand Down
4 changes: 2 additions & 2 deletions oximeter/db/src/oxql/ast/table_ops/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ mod tests {
MetricType::Gauge,
)
.unwrap();
timeseries.points.timestamps = timestamps.clone();
timeseries.points.timestamps.clone_from(&timestamps);
timeseries.points.values[0].values.as_integer_mut().unwrap().extend([
Some(1),
Some(2),
Expand All @@ -166,7 +166,7 @@ mod tests {
MetricType::Gauge,
)
.unwrap();
timeseries.points.timestamps = timestamps.clone();
timeseries.points.timestamps.clone_from(&timestamps);
timeseries.points.values[0].values.as_integer_mut().unwrap().extend([
Some(4),
Some(5),
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# We choose a specific toolchain (rather than "stable") for repeatability. The
# intent is to keep this up-to-date with recently-released stable Rust.
channel = "1.77.2"
channel = "1.78.0"
profile = "default"
Loading
Loading