Skip to content

Commit

Permalink
Merge branch 'main' into zone-networking-service
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv authored Jan 14, 2024
2 parents b9545be + a00fe94 commit 6109d43
Show file tree
Hide file tree
Showing 54 changed files with 1,534 additions and 658 deletions.
45 changes: 41 additions & 4 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,50 @@
[build]
rustdocflags = "--document-private-items"

# On illumos, use `-znocompstrtab` to reduce link time.
# On illumos, use `-znocompstrtab` to reduce link time. We also add the Oxide
# specific platform directory to the RPATH where additional libraries can be
# found such as libipcc.
#
# Note that these flags are overridden by a user's environment variable, so
# things critical to correctness probably don't belong here.
# Our reasoning for including `-R/usr/platform/oxide/lib/amd64` here:
# - Oxide specific features - This path contains Oxide specific libraries such
# as libipcc and will likely grow over time to include more functionality.
# - Avoid the rpaths crate - The rpaths crate was built to deal with runtime
# paths that are dynamic such as with libraries like libpq which can live in
# different locations based on OS. This path will only ever be found on
# illumos and will be tied directly to the Oxide platform.
# - Less developer burden - Having something like the ipcc crate emit
# `DEP_IPCC_LIBDIRS` means that we end up littering the repo with Cargo.toml
# and build.rs changes whenever ipcc shows up somewhere in the dependency
# tree. While initially exploring that path we ran into a significant number
# of tests failing due to not being able to find libipcc in the runtime path
# which can be confusing or surprising to someone doing work on omicron.
#
# We could also update Helios so that a symlink is created from
# /usr/platform/oxide/lib/amd64 into /usr/lib/64 but we opted to not take
# this route forward as it meant waiting for another round of updates on
# shared build machines and to buildomat itself.
#
# As documented at:
# https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags
#
# There are four mutually exclusive sources of extra flags. They are checked in
# order, with the first one being used:
# 1. `CARGO_ENCODED_RUSTFLAGS` environment variable.
# 2. `RUSTFLAGS` environment variable.
# 3. All matching target.<triple>.rustflags and target.<cfg>.rustflags config
# entries joined together.
# 4. build.rustflags config value.
#
# When overriding the defaults in this config by environment variable the user
# may need to manually pass the additional options found below.
#
# Note that other runtime paths should not be added here, but should instead
# reuse the infrastructure found in the `rpaths` crate which can be found in
# this repo. Those paths are usually platform specific and will vary based on a
# variety of things such as host OS.
[target.x86_64-unknown-illumos]
rustflags = [
"-C", "link-arg=-Wl,-znocompstrtab"
"-C", "link-arg=-Wl,-znocompstrtab,-R/usr/platform/oxide/lib/amd64"
]

# Set up `cargo xtask`.
Expand Down
8 changes: 7 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The required version should be bumped up if we need new features, performance
# improvements or bugfixes that are present in newer versions of nextest.
nextest-version = { required = "0.9.59", recommended = "0.9.64" }
nextest-version = { required = "0.9.64", recommended = "0.9.67" }

experimental = ["setup-scripts"]

Expand Down Expand Up @@ -32,3 +32,9 @@ clickhouse-cluster = { max-threads = 1 }
[[profile.default.overrides]]
filter = 'package(oximeter-db) and test(replicated)'
test-group = 'clickhouse-cluster'

[[profile.ci.overrides]]
filter = 'binary_id(omicron-nexus::test_all)'
# As of 2023-01-08, the slowest test in test_all takes 196s on a Ryzen 7950X.
# 900s is a good upper limit that adds a comfortable buffer.
slow-timeout = { period = '60s', terminate-after = 15 }
11 changes: 10 additions & 1 deletion .github/buildomat/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set -o errexit
set -o pipefail
set -o xtrace

target_os=$1

# NOTE: This version should be in sync with the recommended version in
# .config/nextest.toml. (Maybe build an automated way to pull the recommended
# version in the future.)
NEXTEST_VERSION='0.9.64'
NEXTEST_VERSION='0.9.67'

cargo --version
rustc --version
Expand Down Expand Up @@ -48,6 +50,13 @@ ptime -m bash ./tools/install_builder_prerequisites.sh -y
#
banner build
export RUSTFLAGS="-D warnings"
# When running on illumos we need to pass an additional runpath that is
# usually configured via ".cargo/config" but the `RUSTFLAGS` env variable
# takes precedence. This path contains oxide specific libraries such as
# libipcc.
if [[ $target_os == "illumos" ]]; then
RUSTFLAGS="-D warnings -C link-arg=-R/usr/platform/oxide/lib/amd64"
fi
export RUSTDOCFLAGS="-D warnings"
export TMPDIR=$TEST_TMPDIR
export RUST_BACKTRACE=1
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 @@ -5,7 +5,7 @@
#: target = "helios-2.0"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "/var/tmp/omicron_tmp/*",
#: "%/var/tmp/omicron_tmp/*",
#: "!/var/tmp/omicron_tmp/crdb-base*",
#: "!/var/tmp/omicron_tmp/rustc*",
#: ]
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 @@ -5,7 +5,7 @@
#: target = "ubuntu-22.04"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "/var/tmp/omicron_tmp/*",
#: "%/var/tmp/omicron_tmp/*",
#: "!/var/tmp/omicron_tmp/crdb-base*",
#: "!/var/tmp/omicron_tmp/rustc*",
#: ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hakari.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
toolchain: stable
- name: Install cargo-hakari
uses: taiki-e/install-action@c63cad0540fb5357c70e2481e3da40d7649add24 # v2
uses: taiki-e/install-action@681c09da0e1063a389bc0f4cfa913bfdfdaf0a4d # v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
- uses: Swatinem/rust-cache@a22603398250b864f7190077025cf752307154dc # v2.7.2
if: ${{ github.ref != 'refs/heads/main' }}
- name: Report cargo version
run: cargo --version
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
- uses: Swatinem/rust-cache@a22603398250b864f7190077025cf752307154dc # v2.7.2
if: ${{ github.ref != 'refs/heads/main' }}
- name: Report cargo version
run: cargo --version
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
- uses: Swatinem/rust-cache@a22603398250b864f7190077025cf752307154dc # v2.7.2
if: ${{ github.ref != 'refs/heads/main' }}
- name: Report cargo version
run: cargo --version
Expand Down
Loading

0 comments on commit 6109d43

Please sign in to comment.