pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

Parallel `cargo pgrx package` errors

Open owenthereal opened this issue 1 year ago • 4 comments

I'm trying to run multiple pgrx builds against different Postgres versions in parallel with the following (For example for both pg 14 & pg 15):

cargo pgrx init --pg${PG_VERSION} ${PG_CONFIG}
cargo pgrx package --pg-config ${PG_CONFIG} --out-dir ${DESTDIR}

And I got errors like Error: Postgres pg15 is not managed by pgrx. If I run pgrx build once at a time for a pg version, things work fine.

Related: https://github.com/pgxman/pgxman/pull/216 Build logs: https://github.com/pgxman/buildkit/actions/runs/10356208551/job/28665586672

owenthereal avatar Aug 12 '24 17:08 owenthereal

You might want to give each job its own $PGRX_HOME as well.

Otherwise, do the init job first, you can specify multiple --pg${PG_VERSION=${PG_CONFIG} paths.

eeeebbbbrrrr avatar Aug 12 '24 17:08 eeeebbbbrrrr

I should have explained that if each job shares the same $PGRX_HOME, then they share the same config.toml file, which is created new by each call to cargo pgrx init ....

eeeebbbbrrrr avatar Aug 12 '24 17:08 eeeebbbbrrrr

Ah, cool, I didn't know config.toml can be shared for multiple jobs. Thanks for clarifying. Yeah, it would be nice to document this behaviour to avoid multiple parallel jobs sharing the same $PGRX_HOME.

owenthereal avatar Aug 12 '24 17:08 owenthereal

We need to document, diagnose, or change cargo-pgrx to support this without exploding.

workingjubilee avatar Aug 14 '24 20:08 workingjubilee