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 aa39ae93207..8b3b6c541ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1655,8 +1655,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=oxide#580b9da96e8d67c99975e55f360e36dc4272fdec" dependencies = [ "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 7f106ae73ea..9ce25c0e427 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,3 +32,12 @@ panic = "abort" #dropshot = { path = "../dropshot/dropshot" } #[patch."https://github.com/oxidecomputer/steno"] #steno = { path = "../steno" } + +# +# We maintain a fork of pq-sys to address +# https://github.com/sgrif/pq-sys/issues/36. If the fix for that (PR#37) lands +# upstream, we can remove our fork. +# +[patch.crates-io.pq-sys] +git = 'https://github.com/oxidecomputer/pq-sys' +branch = "oxide" diff --git a/README.adoc b/README.adoc index 359f4214023..0cf80261f02 100644 --- a/README.adoc +++ b/README.adoc @@ -69,8 +69,6 @@ We use Diesel's PostgreSQL support to connect to CockroachDB (which is wire-comp * Mac: `brew install postgresql` 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 at build time below. -- . CockroachDB v20.2.5. + @@ -106,14 +104,6 @@ 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` in your environment so that built 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)" ----- -+ 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. -+ -NOTE: You may be able to skip this step if your libpq is in a directory that's already part of the runtime linker's default search path, which may be the case if you've installed libpq using the system package manager. This step is necessarily on Helios because the package manager does not put libpq on the default ld.so search path. . Start CockroachDB using `omicron-dev db-run`: + [source,text] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ce5ebcaeb73..6427f62a0c5 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,17 +1,19 @@ -# We use nightly to enable the "asm" feature for dtrace probes. +# We use nightly for two reasons: # -# 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 +# 1. To enable the "asm" feature for dtrace probes. +# 2. To make use of our workaround for issue sgrif/pq-sys#36. This relies on a +# Cargo feature that will not be available on stable until 1.56. # -# Short-term: Once that bug is fixed, we should feel free -# to update to migrate to a more recent nightly. +# When both of those are part of stable Rust, we should update this file to +# point to "stable" instead. +# +# We use "nightly-2021-09-03" specifically because we know it's new enough for +# the Cargo feature required for the sgrif/pq-sys#36 workaround. Newer +# nightlies should be fine as well. # -# 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"