Skip to content

Commit 82b5f7f

Browse files
committed
Update instructions for dev to follow pgx. Add newly generated files with latest branch. Back to functional against current pgx development.
1 parent ce7c0a9 commit 82b5f7f

File tree

7 files changed

+84
-16
lines changed

7 files changed

+84
-16
lines changed

.cargo/config

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
[build]
2-
# Postgres symbols won't ve available until runtime
3-
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]
1+
# Auto-generated by pgx. You may edit this, or delete it to have a new one created.
2+
3+
[target.x86_64-unknown-linux-gnu]
4+
linker = "./.cargo/pgx-linker-script.sh"
5+
6+
[target.aarch64-unknown-linux-gnu]
7+
linker = "./.cargo/pgx-linker-script.sh"
8+
9+
[target.x86_64-apple-darwin]
10+
linker = "./.cargo/pgx-linker-script.sh"
11+
12+
[target.aarch64-apple-darwin]
13+
linker = "./.cargo/pgx-linker-script.sh"

.cargo/linker-script.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! /usr/bin/env bash
2+
# Auto-generated by pgx. You may edit this, or delete it to have a new one created.
3+
4+
if [[ $CARGO_BIN_NAME == "sql-generator" ]]; then
5+
gcc -Wl,-undefined,dynamic_lookup,-dynamic-list=$CARGO_MANIFEST_DIR/.cargo/pgx-dynamic-list.txt $@
6+
else
7+
gcc -Wl,-undefined,dynamic_lookup $@
8+
fi

.cargo/pgx-dynamic-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ __pgx_internals_*; };

.cargo/pgx-linker-script.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! /usr/bin/env bash
2+
# Auto-generated by pgx. You may edit this, or delete it to have a new one created.
3+
4+
if [[ $CARGO_BIN_NAME == "sql-generator" ]]; then
5+
gcc -Wl,-undefined,dynamic_lookup,-dynamic-list=$CARGO_MANIFEST_DIR/.cargo/pgx-dynamic-list.txt $@
6+
else
7+
gcc -Wl,-undefined,dynamic_lookup $@
8+
fi

ADVANCED-INSTALL.md

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,13 @@ curl https://sh.rustup.rs -sSf | sh -s -- -y
3232
source $HOME/.cargo/env
3333
```
3434

35-
Install `cargo-pgx` regularly.
35+
Install `cargo-pgx` regularly (see dev steps below for non-standard install).
3636

3737

3838
```bash
3939
cargo install cargo-pgx
4040
```
4141

42-
ALTERNATIVE for development -- Install specific branch from Pgx repo:
43-
44-
```bash
45-
cargo install --force --git "https://github.com/zombodb/pgx" \
46-
--branch "oh-no-type-resolution" \
47-
"cargo-pgx"
48-
```
49-
5042

5143
Install `cargo-deb` used for packaging binaries.
5244

@@ -80,7 +72,7 @@ changes the last two digits of the port!
8072

8173

8274
```bash
83-
cargo pgx run pg12
75+
cargo pgx run pg13
8476
```
8577

8678
Example output.
@@ -135,3 +127,52 @@ dot -Goverlap=prism -Gspline=ortho -Tjpg extension.dot > extension.jpg
135127
```
136128

137129
![pgx dependencies for pgdd v0.4.0-dev](pgdd--0.4.0-dev.jpg)
130+
131+
132+
## Non-standard dev
133+
134+
When working against Pgx installed from a non-tagged branch, install pgx using:
135+
136+
```bash
137+
cargo install --force --git "https://github.com/zombodb/pgx" \
138+
--branch "oh-no-type-resolution" \
139+
"cargo-pgx"
140+
```
141+
142+
Changes to `Cargo.toml` required in `[lib]` and `[dependencies]` sections.
143+
144+
145+
```toml
146+
[lib]
147+
# rlib added to build against repo instead of crate (I think)
148+
crate-type = ["cdylib", "rlib"]
149+
#crate-type = ["cdylib"]
150+
```
151+
152+
153+
```toml
154+
[dependencies]
155+
156+
pgx = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
157+
pgx-macros = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
158+
#pgx = "0.1.21"
159+
#pgx-macros = "0.1.21"
160+
161+
# Won't be needed in final version (hopefully!)
162+
pgx-utils = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
163+
164+
[dev-dependencies]
165+
pgx-tests = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
166+
#pgx-tests = "0.1.21"
167+
```
168+
169+
170+
171+
The following command can be used to force pgx to overwrite the configs it needs to
172+
for various dev related changes.
173+
174+
175+
```bash
176+
cargo pgx schema -f
177+
```
178+

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ pg_test = []
2121

2222
pgx = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
2323
pgx-macros = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
24-
#pgx = "0.1.21"
25-
#pgx-macros = "0.1.21"
24+
#pgx = "0.1.22"
25+
#pgx-macros = "0.1.22"
2626

2727
# Won't be needed in final version (hopefully!)
2828
pgx-utils = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
2929

3030
[dev-dependencies]
3131
pgx-tests = { git = "https://github.com/zombodb/pgx", branch = "oh-no-type-resolution" }
32-
#pgx-tests = "0.1.21"
32+
#pgx-tests = "0.1.22"
3333

3434

3535
[profile.dev]

pgdd--0.4.0-dev.jpg

-10.7 KB
Loading

0 commit comments

Comments
 (0)