diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5d546cc8bfe..5bea32826c3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -73,10 +73,8 @@ jobs: fail-fast: false matrix: os: [ ubuntu-18.04, macos-10.15 ] - # NOTE: Although we'd like to use stable, we cannot with a newer version - # of Propolis as a dependency (which only builds with nightly). - # toolchain: [ nightly-2021-04-24, stable ] - toolchain: [ nightly-2021-04-24 ] + # See rust-toolchain for why we're using nightly here. + toolchain: [ nightly-2021-09-03 ] steps: # actions/checkout@v2 - uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b diff --git a/Cargo.lock b/Cargo.lock index 2cab2ab5c34..f1df6bf49e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -990,13 +990,13 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" version = "0.2.101" -source = "git+https://github.com/rust-lang/libc.git?rev=796459785#796459785e5190a02fdf7c223fc8aa91d04306f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21" [[package]] name = "libc" version = "0.2.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21" +source = "git+https://github.com/rust-lang/libc.git?rev=796459785#796459785e5190a02fdf7c223fc8aa91d04306f7" [[package]] name = "linked-hash-map" @@ -1237,6 +1237,8 @@ dependencies = [ "http", "hyper", "omicron-common", + "omicron-rpaths", + "pq-sys", "serde", "serde_json", "slog", @@ -1267,7 +1269,9 @@ dependencies = [ "ipnet", "libc 0.2.101 (registry+https://github.com/rust-lang/crates.io-index)", "macaddr", + "omicron-rpaths", "postgres-protocol", + "pq-sys", "propolis-server", "rayon", "reqwest", @@ -1316,10 +1320,12 @@ dependencies = [ "macaddr", "newtype_derive", "omicron-common", + "omicron-rpaths", "omicron-sled-agent", "openapi-lint", "openapiv3", "oximeter", + "pq-sys", "schemars", "serde", "serde_json", @@ -1335,6 +1341,10 @@ dependencies = [ "uuid", ] +[[package]] +name = "omicron-rpaths" +version = "0.1.0" + [[package]] name = "omicron-sled-agent" version = "0.1.0" @@ -1350,6 +1360,8 @@ dependencies = [ "ipnet", "mockall", "omicron-common", + "omicron-rpaths", + "pq-sys", "propolis-client", "schemars", "serde", @@ -1447,7 +1459,9 @@ dependencies = [ "hyper", "num-traits", "omicron-common", + "omicron-rpaths", "oximeter-macro-impl", + "pq-sys", "reqwest", "schemars", "serde", @@ -1661,8 +1675,7 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "pq-sys" version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac25eee5a0582f45a67e837e350d784e7003bd29a5f460796772061ca49ffda" +source = "git+https://github.com/oxidecomputer/pq-sys?branch=omicron#b1194c190f4d4a103c2280908cd1e97628c5c1cb" dependencies = [ "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 7f106ae73ea..6655719d4ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "omicron-bootstrap-agent", "omicron-common", "omicron-nexus", + "omicron-rpaths", "omicron-sled-agent", "oximeter/oximeter", "oximeter/oximeter-macro-impl", @@ -12,6 +13,7 @@ default-members = [ "omicron-bootstrap-agent", "omicron-common", "omicron-nexus", + "omicron-rpaths", "omicron-sled-agent", "oximeter/oximeter", "oximeter/oximeter-macro-impl", @@ -32,3 +34,11 @@ panic = "abort" #dropshot = { path = "../dropshot/dropshot" } #[patch."https://github.com/oxidecomputer/steno"] #steno = { path = "../steno" } + +# +# We maintain a fork of pq-sys to address upstream issues. See the +# README.md.oxide in the "oxide" branch of our fork for details. +# +[patch.crates-io.pq-sys] +git = 'https://github.com/oxidecomputer/pq-sys' +branch = "omicron" diff --git a/README.adoc b/README.adoc index 97f541d82af..8d6c63bd4a4 100644 --- a/README.adoc +++ b/README.adoc @@ -70,7 +70,7 @@ We use Diesel's PostgreSQL support to connect to CockroachDB (which is wire-comp After doing this, you should have the `pg_config` command on your PATH. For example, on Helios, you'd want `/opt/ooce/bin` on your PATH. -See the note about setting RUSTFLAGS and RUSTDOCFLAGS at build time below. +See the note about setting RUSTDOCFLAGS at build time below. -- . CockroachDB v20.2.5. + @@ -106,11 +106,10 @@ the database files will be deleted when you stop the program. The easiest way to start the required databases is to use the built-in `omicron-dev` tool. This tool assumes that the `cockroach` and `clickhouse` executables are on your PATH, and match the versions above. -. Set `RUSTFLAGS` and `RUSTDOCFLAGS` in your environment so that built binaries will be able to find your local copy of libpq. A typical example might look like this: +. Work around https://github.com/rust-lang/cargo/issues/9895[rust-lang/cargo#9895]: set `RUSTDOCFLAGS` in your environment so that built test binaries will be able to find your local copy of libpq. A typical example might look like this: + ---- -$ export RUSTFLAGS="-Clink-args=-R$(pg_config --libdir)" -$ export RUSTDOCFLAGS="$RUSTFLAGS" +$ export RUSTDOCFLAGS="-Clink-args=-R$(pg_config --libdir)" ---- + Note that this might be wrong in some configurations or if you're using environment variables to control how the `pq-sys` crate finds libpq. See https://github.com/oxidecomputer/omicron/issues/213[#213] for details. + diff --git a/omicron-bootstrap-agent/Cargo.toml b/omicron-bootstrap-agent/Cargo.toml index 30c1d2d34e3..29a7d46185c 100644 --- a/omicron-bootstrap-agent/Cargo.toml +++ b/omicron-bootstrap-agent/Cargo.toml @@ -3,9 +3,14 @@ name = "omicron-bootstrap-agent" version = "0.1.0" edition = "2018" +[build-dependencies.omicron-rpaths] +path = "../omicron-rpaths" + [dependencies] http = "0.2.0" hyper = "0.14" +# See omicron-rpaths for more about the "pq-sys" dependency. +pq-sys = "*" serde_json = "1.0" smf = "0.2" structopt = "0.3" diff --git a/omicron-bootstrap-agent/build.rs b/omicron-bootstrap-agent/build.rs new file mode 100644 index 00000000000..52d961bd9fa --- /dev/null +++ b/omicron-bootstrap-agent/build.rs @@ -0,0 +1,6 @@ +// See omicron-rpaths for documentation. +// NOTE: This file MUST be kept in sync with the other build.rs files in this +// repository. +fn main() { + omicron_rpaths::configure_default_omicron_rpaths(); +} diff --git a/omicron-common/Cargo.toml b/omicron-common/Cargo.toml index 68aa7574f31..2fdc02ae0f5 100644 --- a/omicron-common/Cargo.toml +++ b/omicron-common/Cargo.toml @@ -3,6 +3,9 @@ name = "omicron-common" version = "0.1.0" edition = "2018" +[build-dependencies.omicron-rpaths] +path = "../omicron-rpaths" + [dependencies] anyhow = "1.0" async-trait = "0.1.51" @@ -14,6 +17,8 @@ hyper = "0.14" libc = "0.2.98" propolis-server = { git = "https://github.com/oxidecomputer/propolis", rev = "bc0661e" } postgres-protocol = "0.6.1" +# See omicron-rpaths for more about the "pq-sys" dependency. +pq-sys = "*" rayon = "1.5" reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] } ring = "0.16" diff --git a/omicron-common/build.rs b/omicron-common/build.rs new file mode 100644 index 00000000000..52d961bd9fa --- /dev/null +++ b/omicron-common/build.rs @@ -0,0 +1,6 @@ +// See omicron-rpaths for documentation. +// NOTE: This file MUST be kept in sync with the other build.rs files in this +// repository. +fn main() { + omicron_rpaths::configure_default_omicron_rpaths(); +} diff --git a/omicron-nexus/Cargo.toml b/omicron-nexus/Cargo.toml index 59dbfbf123c..4e4314e1755 100644 --- a/omicron-nexus/Cargo.toml +++ b/omicron-nexus/Cargo.toml @@ -3,6 +3,9 @@ name = "omicron-nexus" version = "0.1.0" edition = "2018" +[build-dependencies.omicron-rpaths] +path = "../omicron-rpaths" + [dependencies] anyhow = "1.0" async-trait = "0.1.51" @@ -18,6 +21,8 @@ lazy_static = "1.4.0" libc = "0.2.98" macaddr = { version = "1.0.1", features = [ "serde_std" ]} newtype_derive = "0.1.6" +# See omicron-rpaths for more about the "pq-sys" dependency. +pq-sys = "*" serde_json = "1.0" serde_with = "1.9.4" structopt = "0.3" diff --git a/omicron-nexus/build.rs b/omicron-nexus/build.rs new file mode 100644 index 00000000000..52d961bd9fa --- /dev/null +++ b/omicron-nexus/build.rs @@ -0,0 +1,6 @@ +// See omicron-rpaths for documentation. +// NOTE: This file MUST be kept in sync with the other build.rs files in this +// repository. +fn main() { + omicron_rpaths::configure_default_omicron_rpaths(); +} diff --git a/omicron-rpaths/Cargo.toml b/omicron-rpaths/Cargo.toml new file mode 100644 index 00000000000..5461ec399bc --- /dev/null +++ b/omicron-rpaths/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "omicron-rpaths" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/omicron-rpaths/src/lib.rs b/omicron-rpaths/src/lib.rs new file mode 100644 index 00000000000..6f0b65e5a10 --- /dev/null +++ b/omicron-rpaths/src/lib.rs @@ -0,0 +1,260 @@ +/*! + * Build-time crate for configuring RPATHs for Omicron binaries + * + * ## The least you need to know + * + * This build-time crate is used by several top-level Omicron crates to set + * RPATH so that libpq can be found at runtime. This is necessary because these + * crates depend on "diesel", which depends on "pq-sys", which links in "libpq". + * But Cargo/Rust have no built-in way to set the RPATH so that libpq can + * actually be found at runtime. (See below.) So we've developed the pattern + * here instead. It works like this: + * + * 1. Any crate that depends on pq-sys, directly or not, needs to follow these + * instructions. Generally, we depend on pq-sys _indirectly_, by virtue of + * depending on Diesel. + * 2. Affected crates (e.g., omicron-nexus) have a build.rs that just calls + * `omicron_rpath::configure_default_omicron_rpaths()`. + * 3. These crates must also add a dependency on "pq-sys", usually version "*". + * (This dependency is unfortunate but necessary in order for us to get the + * metadata emitted by pq-sys that tells it where it found libpq. Since we + * don't directly use pq-sys in the crate, we don't care what version it is. + * We specify "*" so that when Cargo dedups our dependency with the one in + * Diesel, we pick up whatever would be picked up anyway, and we'll get its + * metadata.) + * 4. At the top level of Omicron (in the workspace Cargo.toml), we use a + * patched version of pq-sys that emits metadata that's used by + * `configure_default_omicron_rpaths()`. + * + * This crate is factored (over-engineered, really) so that we can extend this + * pattern to other native libraries in the future. + * + * ## More details + * + * On Unix-like systems, executable binaries and shared libraries can have + * shared library dependencies. When a binary is loaded (whether it's an + * executable or a shared library), the runtime linker (ld.so) locates these + * dependencies using a combination of environment variables, system + * configuration, and RPATH entries embedded in the binary itself. While this + * process is well-defined, using it correctly can be deceptively tricky and + * it's often a source of considerable frustration. + * + * As of this writing, Cargo has no first-class way to configure the RPATH for + * binaries that it builds. This is covered by [rust-lang/cargo#5077][1]. This + * comes up most often for people trying to expose a native library to Rust, as + * via [*-sys packages][2]. Typically a Rust program that uses one of these + * packages will wind up with no RPATH entries. This will work if, at runtime, + * the library happens to be in one of the runtime linker's default search paths + * (e.g., /usr/lib). This is commonly the case if the library came from the + * system package manager. But in general, the library might be in some other + * path, and you would need to specify LD_LIBRARY_PATH every time you run the + * program in order for the linker to find the library. Using LD_LIBRARY_PATH + * like this is discouraged because it affects more than just the program you're + * running -- it affects everything that inherits the variable. You're supposed + * to include RPATH entries in the binary instead. + * + * As of 1.56, Cargo supports the "cargo:rustc-link-arg" instruction for use by + * [Build Scripts][3] to pass arbitrary options to the linker. We use that here + * to tell the linker to include the correct RPATH entry for our one native + * dependency that's affected by this (libpq, exposed via the pq-sys package). + * + * A subtle but critical point here is that the RPATH is knowable only by the + * system that's building the top-level executable binary. This mechanism can't + * go into the *-sys package that wraps the native library because that package + * cannot know where the library will be found at runtime. Only whoever (or + * whatever) is building the software knows that. Further, Cargo provides no + * mechanism for a package to emit linker arguments used when building its + * dependents. For more discussion on this, see [rust-lang/cargo#9554][4]. + * + * So we need to emit the linker argument here. How do we know what value to + * use? We take the approach used by most build systems: we use the path where + * the library was found on the build machine. But how do we know where that + * was? *-sys packages have non-trivial mechanisms for locating the desired + * library. We don't want to duplicate those here. Instead, we make use of + * metadata emitted by those build scripts, which shows up as "DEP_*" + * environment variables for us. + * + * **Important note:** In order for us to have metadata for these dependencies, + * we must *directly* depend on them. This may mean adding an otherwise unused + * dependency from the top-level package to the *-sys package. + * + * (In the limit, it may be wrong for us to use the same path that was used to + * locate the library on the build machine. We might want to bundle all of + * these libraries and use something like `$ORIGIN/../lib`. We could generalize + * the mechanism here to pass whatever path we want, possibly specified by some + * other environment variable like OMICRON_BUILD_RPATH.) + * + * [1]: https://github.com/rust-lang/cargo/issues/5077 + * [2]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages + * [3]: https://doc.rust-lang.org/cargo/reference/build-scripts.html + * [4]: https://github.com/rust-lang/cargo/issues/9554 + */ + +use std::ffi::OsStr; +use std::ffi::OsString; + +/** + * Tells Cargo to pass linker arguments that specify the right RPATH for Omicron + * binaries + */ +/* + * This currently assumes that all Omicron binaries link to the same set of + * native libraries. As a result, we use a fixed list of libraries. In the + * future, if they depend on different combinations, we can accept different + * arguments here that specify exactly which ones are expected to be found. + */ +pub fn configure_default_omicron_rpaths() { + let mut rpaths = Vec::new(); + + for env_var_name in RPATH_ENV_VARS { + let env_var_name = OsString::from(&env_var_name); + configure_rpaths_from_env_var(&mut rpaths, &env_var_name); + } + + /* None of this behavior is needed on MacOS. */ + #[cfg(any(target_os = "illumos", target_os = "linux"))] + for r in rpaths { + println!("{}", emit_rpath(&r)); + } +} + +/** + * Environment variables that contain RPATHs we want to use in our built + * binaries + * + * These environment variables are set by Cargo based on metadata emitted by our + * dependencies' build scripts. Since a particular dependency could use + * multiple libraries in different paths, each of these environment variables + * may itself look like a path, not just a directory. That is, these are + * colon-separated lists of directories. + * + * Currently, we only do this for libpq ("pq-sys" package), but this pattern + * could be generalized for other native libraries. + */ +static RPATH_ENV_VARS: &'static [&'static str] = &["DEP_PQ_LIBDIRS"]; + +/** + * Tells Cargo to pass linker arguments that specify RPATHs from the environment + * variable `env_var_name` + * + * Panics if the environment variable is not set or contains non-UTF8 data. + * This might be surprising, since environment variables are optional in most + * build-time mechanisms. We opt for strictness here because in fact we _do_ + * expect these to always be set, and if they're not, it's most likely that + * somebody has forgotten to include a required dependency. We want to tell + * them that rather than silently produce unrunnable binaries. + */ +fn configure_rpaths_from_env_var( + rpaths: &mut Vec, + env_var_name: &OsStr, +) { + /* + * If you see this message, that means that the build script for some + * Omicron crate is trying to configure RPATHs for a native library, but the + * environment variable that's supposed to contain the RPATH information for + * that library is unset. That most likely means that the crate you're + * building is lacking a direct dependency on the '*-sys' crate, or else + * that the '*-sys' crate's build script failed to set this metadata. + */ + let env_var_value = std::env::var_os(env_var_name).unwrap_or_else(|| { + panic!( + "omicron-rpaths: expected {:?} to be set in the environment, but \ + found it unset. (Is the current crate missing a dependency on \ + a *-sys crate?)", + env_var_name, + ) + }); + + configure_rpaths_from_path(rpaths, &env_var_value).unwrap_or_else( + |error| panic!("omicron-rpaths: env var {:?}: {}", env_var_name, error), + ); +} + +/** + * Given a colon-separated list of paths in `env_var_value`, append to `rpaths` + * the same list of paths. + */ +fn configure_rpaths_from_path( + rpaths: &mut Vec, + env_var_value: &OsStr, +) -> Result<(), String> { + for path in std::env::split_paths(env_var_value) { + let path_str = path.to_str().ok_or_else(|| "contains non-UTF8 data")?; + rpaths.push(path_str.to_owned()); + } + + Ok(()) +} + +/** + * Emits the Cargo instruction for a given RPATH. This is only separated out to + * make different parts of this module easier to test. + */ +fn emit_rpath(path_str: &str) -> String { + format!("cargo:rustc-link-arg=-Wl,-R{}", path_str) +} + +#[cfg(test)] +mod tests { + use std::ffi::OsStr; + use std::ffi::OsString; + use std::os::unix::ffi::OsStrExt; + + #[test] + #[should_panic = "omicron-rpaths: expected \"SHOULD_NOT_EXIST\" \ + to be set in the environment, but found it unset"] + fn test_configure_rpaths_from_bad_envvar() { + use super::configure_rpaths_from_env_var; + + let mut v = Vec::new(); + configure_rpaths_from_env_var( + &mut v, + &OsString::from("SHOULD_NOT_EXIST"), + ); + } + + #[test] + fn test_configure_from_path() { + use super::configure_rpaths_from_path; + + let mut v = Vec::new(); + + configure_rpaths_from_path( + &mut v, + &OsString::from("/opt/local/lib:/usr/local/lib"), + ) + .unwrap(); + assert_eq!(v, vec!["/opt/local/lib", "/usr/local/lib"]); + + configure_rpaths_from_path(&mut v, &OsString::from("foo")).unwrap(); + assert_eq!(v, vec!["/opt/local/lib", "/usr/local/lib", "foo"]); + + configure_rpaths_from_path(&mut v, &OsString::from("/my/special/lib")) + .unwrap(); + assert_eq!( + v, + vec!["/opt/local/lib", "/usr/local/lib", "foo", "/my/special/lib"] + ); + + let error = configure_rpaths_from_path( + &mut v, + &OsStr::from_bytes(b"/foo/b\x80ar"), + ) + .unwrap_err(); + assert_eq!(error, "contains non-UTF8 data"); + } + + #[test] + fn test_emit_rpath() { + use super::emit_rpath; + + assert_eq!( + "cargo:rustc-link-arg=-Wl,-R/foo/bar", + emit_rpath("/foo/bar").as_str() + ); + assert_eq!( + "cargo:rustc-link-arg=-Wl,-R$ORIGIN/../lib", + emit_rpath("$ORIGIN/../lib").as_str() + ); + } +} diff --git a/omicron-sled-agent/Cargo.toml b/omicron-sled-agent/Cargo.toml index d870170ddf7..6f1d20b0d9e 100644 --- a/omicron-sled-agent/Cargo.toml +++ b/omicron-sled-agent/Cargo.toml @@ -3,6 +3,9 @@ name = "omicron-sled-agent" version = "0.1.0" edition = "2018" +[build-dependencies.omicron-rpaths] +path = "../omicron-rpaths" + [dependencies] async-trait = "0.1.51" cfg-if = "1.0" @@ -13,6 +16,8 @@ http = "0.2.0" hyper = "0.14" ipnet = "2.3" omicron-common = { path = "../omicron-common" } +# See omicron-rpaths for more about the "pq-sys" dependency. +pq-sys = "*" propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "bc0661e" } schemars = { version = "0.8", features = [ "chrono", "uuid" ] } serde = { version = "1.0", features = [ "derive" ] } diff --git a/omicron-sled-agent/build.rs b/omicron-sled-agent/build.rs new file mode 100644 index 00000000000..52d961bd9fa --- /dev/null +++ b/omicron-sled-agent/build.rs @@ -0,0 +1,6 @@ +// See omicron-rpaths for documentation. +// NOTE: This file MUST be kept in sync with the other build.rs files in this +// repository. +fn main() { + omicron_rpaths::configure_default_omicron_rpaths(); +} diff --git a/oximeter/oximeter/Cargo.toml b/oximeter/oximeter/Cargo.toml index 2cd45aabdbe..890d3efcfd7 100644 --- a/oximeter/oximeter/Cargo.toml +++ b/oximeter/oximeter/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" authors = ["Benjamin Naecker "] edition = "2018" +[build-dependencies.omicron-rpaths] +path = "../../omicron-rpaths" + [dependencies] anyhow = "1.0" bytes = { version = "1.0.1", features = [ "serde" ] } @@ -13,6 +16,8 @@ num-traits = "0.2.14" hyper = "0.14.10" oximeter-macro-impl = { path = "../oximeter-macro-impl" } omicron-common = { path = "../../omicron-common" } +# See build.rs for more about the "pq-sys" dependency. +pq-sys = "*" reqwest = { version = "0.11.4", features = [ "json" ] } schemars = { version = "0.8.3", features = [ "uuid", "bytes", "chrono" ] } serde = { version = "1", features = [ "derive" ] } diff --git a/oximeter/oximeter/build.rs b/oximeter/oximeter/build.rs new file mode 100644 index 00000000000..52d961bd9fa --- /dev/null +++ b/oximeter/oximeter/build.rs @@ -0,0 +1,6 @@ +// See omicron-rpaths for documentation. +// NOTE: This file MUST be kept in sync with the other build.rs files in this +// repository. +fn main() { + omicron_rpaths::configure_default_omicron_rpaths(); +} diff --git a/oximeter/oximeter/src/oximeter_server.rs b/oximeter/oximeter/src/oximeter_server.rs index 3c62639ccb8..425897b5877 100644 --- a/oximeter/oximeter/src/oximeter_server.rs +++ b/oximeter/oximeter/src/oximeter_server.rs @@ -145,8 +145,10 @@ async fn collection_task( struct CollectionTask { // Channel used to send messages from the agent to the actual task. The task owns the other // side. + #[allow(dead_code)] pub inbox: mpsc::Sender, // Handle to the actual tokio task running the collection loop. + #[allow(dead_code)] pub task: JoinHandle<()>, } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ce5ebcaeb73..c9957e45b15 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,17 +1,16 @@ -# We use nightly to enable the "asm" feature for dtrace probes. # -# Additionally, we specify this specific verion of nightly to -# workaround known bugs for illumos on more recent versions. -# Context: https://github.com/rust-lang/rust/pull/85772 +# We use nightly for a few unstable features: # -# Short-term: Once that bug is fixed, we should feel free -# to update to migrate to a more recent nightly. +# 1. the "asm" unstable Rust feature, used within Propolis for dtrace probes +# 2. the "extra-link-arg" unstable Cargo feature, used in omicron-rpaths. This +# will be stable in 1.56. +# +# We specify a specific, known-good nightly to avoid regular breakage. +# Once the above features stabilize, we should switch back to "stable". # -# Long-term: Once the ASM feature is stabilized, we should -# consider using stable instead of nightly. [toolchain] # NOTE: This toolchain is also specified within .github/workflows/rust.yml # If you update it here, update that file too. -channel = "nightly-2021-04-24" +channel = "nightly-2021-09-03" profile = "default"