Skip to content

Commit 2ceba5e

Browse files
Add a gh-action and buildomat jobs to cargo check on no-default-features and feature-powerset
Includes: - fixes around feature-flagging, particularly in oxql, as well as uuid-kinds, sled-storage
1 parent a043275 commit 2ceba5e

File tree

16 files changed

+96
-109
lines changed

16 files changed

+96
-109
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# CI scripts:
99
# - .github/buildomat/build-and-test.sh
1010
# - .github/buildomat/jobs/clippy.sh
11+
# - .github/buildomat/jobs/check-features.sh
1112
# - .github/workflows/rust.yml
1213
#
1314
[build]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
#:
3+
#: name = "check-features (helios)"
4+
#: variety = "basic"
5+
#: target = "helios-2.0"
6+
#: rust_toolchain = true
7+
#: output_rules = []
8+
9+
# Run cargo check on illumos with feature-specifics like `no-default-features`.
10+
11+
set -o errexit
12+
set -o pipefail
13+
set -o xtrace
14+
15+
cargo --version
16+
rustc --version
17+
18+
#
19+
# Set up our PATH for use with this workspace.
20+
#
21+
source ./env.sh
22+
23+
banner prerequisites
24+
ptime -m bash ./tools/install_builder_prerequisites.sh -y
25+
26+
banner check
27+
export CARGO_INCREMENTAL=0
28+
ptime -m cargo check --workspace --bins --tests --no-default-features
29+
RUSTDOCFLAGS="--document-private-items -D warnings" ptime -m cargo doc --workspace --no-deps --no-default-features
30+
31+
#
32+
# `cargo-hack` check feature-powerset
33+
#
34+
banner hack
35+
cargo hack check --workspace --feature-powerset --no-dev-deps --exclude-features image-trampoline,image-standard

.github/buildomat/jobs/clippy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# (that we want to check) is conditionally-compiled on illumos only.
1111
#
1212
# Note that `cargo clippy` includes `cargo check, so this ends up checking all
13-
# of our code.
13+
# of our (default) code.
1414

1515
set -o errexit
1616
set -o pipefail

.github/workflows/rust.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: cargo run --bin omicron-package -- -t default check
5454

5555
# Note that `cargo clippy` includes `cargo check, so this ends up checking all
56-
# of our code.
56+
# of our (default) code.
5757
clippy-lint:
5858
runs-on: ubuntu-22.04
5959
env:
@@ -82,6 +82,38 @@ jobs:
8282
- name: Run Clippy Lints
8383
run: cargo xtask clippy
8484

85+
check-features:
86+
runs-on: ubuntu-22.04
87+
env:
88+
CARGO_INCREMENTAL: 0
89+
steps:
90+
# This repo is unstable and unnecessary: https://github.com/microsoft/linux-package-repositories/issues/34
91+
- name: Disable packages.microsoft.com repo
92+
run: sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
93+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
94+
with:
95+
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
96+
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
97+
if: ${{ github.ref != 'refs/heads/main' }}
98+
- name: Report cargo version
99+
run: cargo --version
100+
- name: Update PATH
101+
run: source "./env.sh"; echo "PATH=$PATH" >> "$GITHUB_ENV"
102+
- name: Print PATH
103+
run: echo $PATH
104+
- name: Print GITHUB_ENV
105+
run: cat "$GITHUB_ENV"
106+
- name: Install Pre-Requisites
107+
run: ./tools/install_builder_prerequisites.sh -y
108+
- name: Run Cargo Check (No Default Features)
109+
run: cargo check --workspace --bins --tests --no-default-features
110+
- name: Install cargo-binstall
111+
uses: taiki-e/install-action@cargo-binstall
112+
- name: Install cargo-hack
113+
run: cargo binstall cargo-hack --locked
114+
- name: Run Cargo Hack Check (Feature-Powerset, No-Dev-Deps)
115+
run: cargo hack check --workspace --feature-powerset --no-dev-deps --exclude-features image-trampoline,image-standard
116+
85117
# This is just a test build of docs. Publicly available docs are built via
86118
# the separate "rustdocs" repo.
87119
build-docs:

Cargo.lock

Lines changed: 0 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nexus/Cargo.toml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ num-integer.workspace = true
5151
once_cell.workspace = true
5252
openssl.workspace = true
5353
oximeter-client.workspace = true
54-
oximeter-db.workspace = true
54+
oximeter-db = { workspace = true, default-features = false, features = [ "oxql" ] }
5555
oxnet.workspace = true
5656
parse-display.workspace = true
5757
paste.workspace = true
@@ -108,42 +108,6 @@ update-common.workspace = true
108108
omicron-workspace-hack.workspace = true
109109
omicron-uuid-kinds.workspace = true
110110

111-
[dev-dependencies]
112-
async-bb8-diesel.workspace = true
113-
camino-tempfile.workspace = true
114-
criterion.workspace = true
115-
diesel.workspace = true
116-
dns-server.workspace = true
117-
expectorate.workspace = true
118-
hyper-rustls.workspace = true
119-
gateway-messages.workspace = true
120-
gateway-test-utils.workspace = true
121-
hubtools.workspace = true
122-
nexus-db-queries = { workspace = true, features = ["testing"] }
123-
nexus-test-utils-macros.workspace = true
124-
nexus-test-utils.workspace = true
125-
omicron-sled-agent.workspace = true
126-
omicron-test-utils.workspace = true
127-
openapi-lint.workspace = true
128-
openapiv3.workspace = true
129-
oxide-client.workspace = true
130-
oximeter-collector.workspace = true
131-
pem.workspace = true
132-
petgraph.workspace = true
133-
pretty_assertions.workspace = true
134-
rcgen.workspace = true
135-
regex.workspace = true
136-
similar-asserts.workspace = true
137-
sp-sim.workspace = true
138-
rustls.workspace = true
139-
subprocess.workspace = true
140-
term.workspace = true
141-
trust-dns-resolver.workspace = true
142-
tufaceous.workspace = true
143-
tufaceous-lib.workspace = true
144-
httptest.workspace = true
145-
strum.workspace = true
146-
147111
[[bench]]
148112
name = "setup_benchmark"
149113
harness = false

oximeter/db/Cargo.toml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ clap.workspace = true
1919
dropshot.workspace = true
2020
futures.workspace = true
2121
highway.workspace = true
22+
num.workspace = true
2223
omicron-common.workspace = true
2324
omicron-workspace-hack.workspace = true
2425
oximeter.workspace = true
@@ -45,10 +46,6 @@ optional = true
4546
workspace = true
4647
optional = true
4748

48-
[dependencies.num]
49-
workspace = true
50-
optional = true
51-
5249
[dependencies.peg]
5350
workspace = true
5451
optional = true
@@ -85,16 +82,6 @@ optional = true
8582
workspace = true
8683
features = [ "rt-multi-thread", "macros" ]
8784

88-
[dev-dependencies]
89-
expectorate.workspace = true
90-
indexmap.workspace = true
91-
itertools.workspace = true
92-
omicron-test-utils.workspace = true
93-
slog-dtrace.workspace = true
94-
sqlparser.workspace = true
95-
strum.workspace = true
96-
tempfile.workspace = true
97-
9885
[features]
9986
default = [ "oxql", "sql" ]
10087
sql = [
@@ -105,9 +92,11 @@ sql = [
10592
"dep:sqlparser",
10693
"dep:tabled"
10794
]
95+
oxdb = [
96+
"dep:tabled"
97+
]
10898
oxql = [
10999
"dep:crossterm",
110-
"dep:num",
111100
"dep:peg",
112101
"dep:reedline",
113102
"dep:tabled",
@@ -116,3 +105,4 @@ oxql = [
116105
[[bin]]
117106
name = "oxdb"
118107
doc = false
108+
required-features = ["oxdb"]

oximeter/db/src/bin/oxdb/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ enum Subcommand {
148148
},
149149

150150
/// Enter the Oximeter Query Language shell for interactive querying.
151+
#[cfg(feature = "oxql")]
151152
Oxql {
152153
#[clap(flatten)]
153154
opts: oximeter_db::shells::oxql::ShellOptions,
@@ -350,6 +351,7 @@ async fn main() -> anyhow::Result<()> {
350351
oximeter_db::shells::sql::shell(args.address, args.port, log, opts)
351352
.await?
352353
}
354+
#[cfg(feature = "oxql")]
353355
Subcommand::Oxql { opts } => {
354356
oximeter_db::shells::oxql::shell(args.address, args.port, log, opts)
355357
.await?

oximeter/db/src/client/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Copyright 2024 Oxide Computer Company
88

99
pub(crate) mod dbwrite;
10+
#[cfg(any(feature = "oxql", test))]
1011
pub(crate) mod oxql;
1112
pub(crate) mod query_summary;
1213
#[cfg(any(feature = "sql", test))]

0 commit comments

Comments
 (0)