pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.7k stars 249 forks source link

Can't get `cargo pgrx init` to compile Postgres on more than one core #1916

Closed jawj closed 1 month ago

jawj commented 1 month ago

I'm setting up an Ubuntu 24.04 VM (using https://multipass.run on an M3 Pro MacBook Pro) to compile and test a pgrx extension.

I set the VM up with 4 cores, 4GB RAM and 20GB disk.

When I run cargo pgrx init --pg16 download, Postgres compilation is stuck on one core, and it doesn't help to specify --jobs 4. That makes it very slow, of course.

Subsequently, cargo pgrx install is able to max out all 4 cores.

Any ideas what could be the problem here?

This is everything that's run on a fresh VM:

sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential pkg-config libssl-dev libreadline-dev zlib1g-dev libicu-dev libclang-dev

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"

cargo install --locked cargo-pgrx@0.12.5
cargo pgrx init --pg16 download
SteveLauC commented 1 month ago

From the source code, the value configured in --jobs will be passed to Client::new(limit), looks like this jobslot library is used to limit the number of uppermost make command that could be executed at the same time, and if so, I guess it is not related to make -j

SteveLauC commented 1 month ago

Related to #1903

jawj commented 1 month ago

OK, closing as a dupe of #1903.