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

build fails due to missing libpq (#213) #220

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 2 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 0 additions & 10 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
+
Expand Down Expand Up @@ -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]
Expand Down
20 changes: 11 additions & 9 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -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"