Skip to content

Commit

Permalink
Add how-to for installing on macOS (#1515)
Browse files Browse the repository at this point in the history
The errors emitted during build for the pkg-config problem, in
particular, can be a bit cryptic and misleading (pointing to icu4c
instead), so suggest people use brew to install the relevant packages.
Fixes #1434

---------

Co-authored-by: NotGyro <[email protected]>
  • Loading branch information
workingjubilee and NotGyro authored Feb 3, 2024
1 parent 153cee6 commit 61e3730
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ and `double`. This may not be "unsound" in itself, as it is "merely" illogical,
but it may undermine otherwise-reasonable safety assumptions of PGRX extensions.
We do not plan to add support without considerable ongoing technical and financial contributions.

<details>
<summary>How to: GCC 7 on CentOS 7</summary>
<details style="border: 1px solid; padding: 0.25em 0.5em 0;">
<summary><i>How to:</i> <b>GCC 7 on CentOS 7</b></summary>

It is not recommended to use CentOS 7 for PGRX development, even if it works.

Expand All @@ -104,6 +104,18 @@ scl enable devtoolset-7 bash
```
</details>

<details style="border: 1px solid; padding: 0.25em 0.5em 0;">
<summary><i>How to:</i> <b>Homebrew on macOS</b></summary>

As macOS provides no package manager, it is recommended to use https://brew.sh for C dependencies.

In particular, you will probably need these if you don't have them already:

```zsh
brew install git icu4c pkg-config
```
</details>

## Getting Started


Expand Down
4 changes: 4 additions & 0 deletions cargo-pgrx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ $ cargo install --locked cargo-pgrx

As new versions of `pgrx` are released, you'll want to make sure you run this command again to update it. You should also reinstall `cargo-pgrx` whenever you update `rustc` so that the same compiler is used to build `cargo-pgrx` and your Postgres extensions. You can force `cargo` to reinstall an existing crate by passing `--force`.

Note that some of the features of PGRX involve compiling C code, including `cargo pgrx init`, and
as such you will also need a toolchain for doing so and potentially must provide various libraries.
Normally, Rust requires a C toolchain anyways, but it does not require e.g. pkg-config.

## Usage

```console
Expand Down

0 comments on commit 61e3730

Please sign in to comment.