Skip to content

Conversation

BradyBonnette
Copy link
Contributor

The new UI tests introduced in develop seem to be incompatible with musl environments such as Alpine. The current working theory is that there could be a bug in TryBuild that ignores/replaces certain rustc flags. In particular, it seems to be disregarding the "-Ctarget-feature=-crt-static" flags that are necessary for pgrx to build and be used in Alpine.

Also includes a couple minor updates, such as bumping the postgresql-alpine Docker version.

@BradyBonnette BradyBonnette requested a review from thomcc July 26, 2023 15:27
@BradyBonnette
Copy link
Contributor Author

Note that I have the "Will It Blend" tests enabled for now, just to be sure they work. Before this is merged into develop, Ill change them back to be ran as nightly again.

@thomcc
Copy link
Contributor

thomcc commented Jul 26, 2023

I think it's more that cargo doesn't respect it as a rustflag when cross compiling, and the workarounds (.cargo/config.toml/CARGO_TARGET_*_RUSTFLAGS) aren't respected/relevant. But we haven't looked into it enough for me to feel good filing a bug upstream about it.

@BradyBonnette
Copy link
Contributor Author

That's right. Locally I tried changing both .cargo/config.toml to include:

[target.'cfg(target_env="musl")']
rustflags = ["-Ctarget-feature=-crt-static"]

and that did not work. I also tried running the tests with something such as: CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Ctarget-feature=-crt-static" cargo test ui --no-default-features --features "pg14" -- --exact and that also did not work.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is fine.

@BradyBonnette BradyBonnette merged commit 9f663f8 into develop Jul 26, 2023
@BradyBonnette BradyBonnette deleted the brady/fix-ui-tests-for-musl branch July 26, 2023 19:41
@workingjubilee
Copy link
Member

Also to clarify for anyone who comes back and rereads this:

The main reason waiving these tests on a musl target is fine is because they don't add anything to rerun in different envs if they cause trouble for us in CI. The tests are fundamentally tests to guarantee attempts to invoke functions in certain ways fail, because we designed our API to prohibit it. We know the Rust toolchain isn't going to have so much platform-specific variance that these work on some targets and not others.

In a certain sense, if the tests themselves fail to compile at all on a specific target environment, uhm... mission accomplished???

We should reenable them someday when musl distros work as smoothly for Rust as glibc distros do, which is a process mostly happening upstream in Rust's compiler/std/libc bindings.

eeeebbbbrrrr added a commit that referenced this pull request Aug 1, 2023
This is the third beta in the pgrx v0.10.x series. It contains a number
of soundness fixes, better error handling, more testing, and other
general code cleanup.

## Soundness Issues

* `AnyNumeric` is no longer backed by Postgres-allocated memory by
@eeeebbbbrrrr in #1216

## CI and general Testing Support

* Testing help by @eeeebbbbrrrr in
#1203
* Type testability cleanup by @eeeebbbbrrrr in
#1204
* Type roundtrip tests by @eeeebbbbrrrr in
#1185
* Stop SpiClient soundness from regressing by @workingjubilee in
#1214
* Initial valgrind support by @thomcc in
#1218
* Add a env flag that can be set to skip `#[pg_test]`-generated tests.
by @thomcc in #1239
* Ignores UI tests for MUSL environments by @BradyBonnette in
#1235
* Changes GHA workflows to use new upgraded runners by @BradyBonnette in
#1225

## General Improvements

* Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF
in #1229
* Fix issue #1076: Properly handle dependency graph of `Result<T, _>` by
@eeeebbbbrrrr in #1241

## Improved Error Reporting

* Try to smartly propagate fs errors by @workingjubilee in
#1186
* Addresses cargo-pgrx error reporting by @BradyBonnette in
#1238
* Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by
@eeeebbbbrrrr in #1240

## Additional Postgres Headers

* Add operator and cache related api by @VoVAllen in
#1242
* Add foreign table headers by @workingjubilee in
#1226
* Add postmaster related api by @JelteF in
#1237

## Internal Code Organization

* Modularize pgrx::spi by @workingjubilee in
#1219
* Modularize the interior of pgrx-pg-sys by @workingjubilee in
#1227

## Postgres 16-motivated Changes

* Add a workaround for the pg16/homebrew/icu4c situation by @thomcc in
#1206

## General Project Stuff

* Add security policy by @johnrballard in
#1207

## New Contributors
* @johnrballard made their first contribution in
#1207
* @VoVAllen made their first contribution in
#1242

**Full Changelog**:
v0.10.0-beta.1...v0.10.0-beta.2
eeeebbbbrrrr added a commit that referenced this pull request Sep 5, 2023
This is the final release of v0.10.0. Thanks everyone for the beta
testing, pull requests, issues, and patience.

As always, install `cargo-pgrx` with `cargo install cargo-pgrx --locked`
and update your extension Cargo.toml files to use the `0.10.0` pgrx
dependencies.

This release includes support for Postgres 16RC1. Support for the
previous betas has been removed. As such, a fresh `cargo pgrx init` is
required.

## What's Changed Since v0.10.0-beta.4

* Fix `GetMemoryChunkContext` port by @workingjubilee in
#1273
* Better error messages when `pg_config` isn't found. by @eeeebbbbrrrr
in #1271
* Make `PostgresHash` also need `Eq` by @workingjubilee in
#1264
* Memoize git hash and extension metadata by @levkk in
#1274
* move to pg16rc1 by @eeeebbbbrrrr in
#1276
* Fix bgworker template up to 0.10.0-beta.4 by @workingjubilee in
#1270

## New Contributors
* @levkk made their first contribution in
#1274

**Changelog**:
v0.10.0-beta.4...v0.10.0

---

v0.10.0's full set of changes throughout the entire beta period are:

* Postgres 16beta1 Support by @eeeebbbbrrrr in
#1169
* Support building against macOS universal binaries by @clowder in
#1166
* list specific versions in feature gates by @eeeebbbbrrrr in
#1175
* Fix bug with converting a `pg_sys::Datum` into a `pgrx::Date` by
@eeeebbbbrrrr in #1177
* Fix Arrays with leading nulls by @eeeebbbbrrrr in
#1180
* Disable hello_versioned_so test by @workingjubilee in
#1192
* doc: fix link broken by @yihong0618 in
#1181
* fcinfo: fix incorrect length set in unsafe code by @Sasasu in
#1190
* update to pg16beta2 support by @eeeebbbbrrrr in
#1188
* Array-walking is aligned by @workingjubilee in
#1191
* Implement PGRXSharedMemory for Deque by @feikesteenbergen in
#1170
* Include security labels header by @daamien in
#1189
* Fixes macos-11 tests by @BradyBonnette in
#1197
* Pgcentralfoundation updates again by @eeeebbbbrrrr in
#1200
* Update version to 0.10.0-beta.0 by @eeeebbbbrrrr in
#1201
* Testing help by @eeeebbbbrrrr in
#1203
* Type testability cleanup by @eeeebbbbrrrr in
#1204
* Try to smartly propagate fs errors by @workingjubilee in
#1186
* Fix issue #1209 by @eeeebbbbrrrr in
#1210
* Type roundtrip tests by @eeeebbbbrrrr in
#1185
* Update version to 0.10.0-beta.1 by @eeeebbbbrrrr in
#1213
* Add a workaround for the pg16/homebrew/icu4c situation by @thomcc in
#1206
* Add security policy by @johnrballard in
#1207
* `AnyNumeric` is no longer backed by Postgres-allocated memory by
@eeeebbbbrrrr in #1216
* Modularize pgrx::spi by @workingjubilee in
#1219
* Stop SpiClient soundness from regressing by @workingjubilee in
#1214
* Add foreign table headers by @workingjubilee in
#1226
* Modularize the interior of pgrx-pg-sys by @workingjubilee in
#1227
* Initial valgrind support by @thomcc in
#1218
* Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF
in #1229
* Ignores UI tests for MUSL environments by @BradyBonnette in
#1235
* Add a env flag that can be set to skip `#[pg_test]`-generated tests.
by @thomcc in #1239
* Fix issue #1076: Properly handle dependency graph of `Result<T, _>` by
@eeeebbbbrrrr in #1241
* Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by
@eeeebbbbrrrr in #1240
* Add operator and cache related api by @VoVAllen in
#1242
* Addresses cargo-pgrx error reporting by @BradyBonnette in
#1238
* Update version to 0.10.0-beta.2 by @eeeebbbbrrrr in
#1244
* Bump cargo-metadata and clap-cargo by @thomcc in
#1246
* Derive Clone for Inet by @JelteF in
#1251
* Correct docs for datetime `From` impls by @workingjubilee in
#1253
* Only enable line tables for profile.dev by @thomcc in
#1249
* Remove references to master branch by @thomcc in
#1243
* Ensure bindgen gets all the `cppflags` it needs (on macOS, anyway) by
@thomcc in #1247
* update for pg16beta3 support by @eeeebbbbrrrr in
#1254
* Update version to 0.10.0-beta.3 by @eeeebbbbrrrr in
#1255
* Add proptest support by @workingjubilee in
#1258
* Misc reformatting and typo fixes by @workingjubilee in
#1260
* spi: simplify (optimize?) Datum preparation by @vrmiguel in
#1256
* Assume commutation when deriving PostgresEq by @workingjubilee in
#1261
* Demand Ord for PostgresOrd by @workingjubilee in
#1262
* Fix pgrx install causing postgresql coredump by @Sasasu in
#1263
* Update version to 0.10.0-beta.4 by @workingjubilee in
#1267

## New Contributors
* @clowder made their first contribution in
#1166
* @yihong0618 made their first contribution in
#1181
* @Sasasu made their first contribution in
#1190
* @daamien made their first contribution in
#1189
* @johnrballard made their first contribution in
#1207
* @VoVAllen made their first contribution in
#1242
* @vrmiguel made their first contribution in
#1256


**Full Changelog**:
v0.9.8...v0.10.0
usamoi pushed a commit to tensorchord/pgrx that referenced this pull request Mar 6, 2025
The new UI tests introduced in `develop` seem to be incompatible with
musl environments such as Alpine. The current working theory is that
there could be a bug in `TryBuild` that ignores/replaces certain rustc
flags. In particular, it seems to be disregarding the
`"-Ctarget-feature=-crt-static"` flags that are necessary for pgrx to
build and be used in Alpine.

Also includes a couple minor updates, such as bumping the
postgresql-alpine Docker version.
usamoi pushed a commit to tensorchord/pgrx that referenced this pull request Mar 6, 2025
This is the third beta in the pgrx v0.10.x series. It contains a number
of soundness fixes, better error handling, more testing, and other
general code cleanup.

## Soundness Issues

* `AnyNumeric` is no longer backed by Postgres-allocated memory by
@eeeebbbbrrrr in pgcentralfoundation#1216

## CI and general Testing Support

* Testing help by @eeeebbbbrrrr in
pgcentralfoundation#1203
* Type testability cleanup by @eeeebbbbrrrr in
pgcentralfoundation#1204
* Type roundtrip tests by @eeeebbbbrrrr in
pgcentralfoundation#1185
* Stop SpiClient soundness from regressing by @workingjubilee in
pgcentralfoundation#1214
* Initial valgrind support by @thomcc in
pgcentralfoundation#1218
* Add a env flag that can be set to skip `#[pg_test]`-generated tests.
by @thomcc in pgcentralfoundation#1239
* Ignores UI tests for MUSL environments by @BradyBonnette in
pgcentralfoundation#1235
* Changes GHA workflows to use new upgraded runners by @BradyBonnette in
pgcentralfoundation#1225

## General Improvements

* Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF
in pgcentralfoundation#1229
* Fix issue pgcentralfoundation#1076: Properly handle dependency graph of `Result<T, _>` by
@eeeebbbbrrrr in pgcentralfoundation#1241

## Improved Error Reporting

* Try to smartly propagate fs errors by @workingjubilee in
pgcentralfoundation#1186
* Addresses cargo-pgrx error reporting by @BradyBonnette in
pgcentralfoundation#1238
* Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by
@eeeebbbbrrrr in pgcentralfoundation#1240

## Additional Postgres Headers

* Add operator and cache related api by @VoVAllen in
pgcentralfoundation#1242
* Add foreign table headers by @workingjubilee in
pgcentralfoundation#1226
* Add postmaster related api by @JelteF in
pgcentralfoundation#1237

## Internal Code Organization

* Modularize pgrx::spi by @workingjubilee in
pgcentralfoundation#1219
* Modularize the interior of pgrx-pg-sys by @workingjubilee in
pgcentralfoundation#1227

## Postgres 16-motivated Changes

* Add a workaround for the pg16/homebrew/icu4c situation by @thomcc in
pgcentralfoundation#1206

## General Project Stuff

* Add security policy by @johnrballard in
pgcentralfoundation#1207

## New Contributors
* @johnrballard made their first contribution in
pgcentralfoundation#1207
* @VoVAllen made their first contribution in
pgcentralfoundation#1242

**Full Changelog**:
pgcentralfoundation/pgrx@v0.10.0-beta.1...v0.10.0-beta.2
usamoi pushed a commit to tensorchord/pgrx that referenced this pull request Mar 6, 2025
This is the final release of v0.10.0. Thanks everyone for the beta
testing, pull requests, issues, and patience.

As always, install `cargo-pgrx` with `cargo install cargo-pgrx --locked`
and update your extension Cargo.toml files to use the `0.10.0` pgrx
dependencies.

This release includes support for Postgres 16RC1. Support for the
previous betas has been removed. As such, a fresh `cargo pgrx init` is
required.

## What's Changed Since v0.10.0-beta.4

* Fix `GetMemoryChunkContext` port by @workingjubilee in
pgcentralfoundation#1273
* Better error messages when `pg_config` isn't found. by @eeeebbbbrrrr
in pgcentralfoundation#1271
* Make `PostgresHash` also need `Eq` by @workingjubilee in
pgcentralfoundation#1264
* Memoize git hash and extension metadata by @levkk in
pgcentralfoundation#1274
* move to pg16rc1 by @eeeebbbbrrrr in
pgcentralfoundation#1276
* Fix bgworker template up to 0.10.0-beta.4 by @workingjubilee in
pgcentralfoundation#1270

## New Contributors
* @levkk made their first contribution in
pgcentralfoundation#1274

**Changelog**:
pgcentralfoundation/pgrx@v0.10.0-beta.4...v0.10.0

---

v0.10.0's full set of changes throughout the entire beta period are:

* Postgres 16beta1 Support by @eeeebbbbrrrr in
pgcentralfoundation#1169
* Support building against macOS universal binaries by @clowder in
pgcentralfoundation#1166
* list specific versions in feature gates by @eeeebbbbrrrr in
pgcentralfoundation#1175
* Fix bug with converting a `pg_sys::Datum` into a `pgrx::Date` by
@eeeebbbbrrrr in pgcentralfoundation#1177
* Fix Arrays with leading nulls by @eeeebbbbrrrr in
pgcentralfoundation#1180
* Disable hello_versioned_so test by @workingjubilee in
pgcentralfoundation#1192
* doc: fix link broken by @yihong0618 in
pgcentralfoundation#1181
* fcinfo: fix incorrect length set in unsafe code by @Sasasu in
pgcentralfoundation#1190
* update to pg16beta2 support by @eeeebbbbrrrr in
pgcentralfoundation#1188
* Array-walking is aligned by @workingjubilee in
pgcentralfoundation#1191
* Implement PGRXSharedMemory for Deque by @feikesteenbergen in
pgcentralfoundation#1170
* Include security labels header by @daamien in
pgcentralfoundation#1189
* Fixes macos-11 tests by @BradyBonnette in
pgcentralfoundation#1197
* Pgcentralfoundation updates again by @eeeebbbbrrrr in
pgcentralfoundation#1200
* Update version to 0.10.0-beta.0 by @eeeebbbbrrrr in
pgcentralfoundation#1201
* Testing help by @eeeebbbbrrrr in
pgcentralfoundation#1203
* Type testability cleanup by @eeeebbbbrrrr in
pgcentralfoundation#1204
* Try to smartly propagate fs errors by @workingjubilee in
pgcentralfoundation#1186
* Fix issue pgcentralfoundation#1209 by @eeeebbbbrrrr in
pgcentralfoundation#1210
* Type roundtrip tests by @eeeebbbbrrrr in
pgcentralfoundation#1185
* Update version to 0.10.0-beta.1 by @eeeebbbbrrrr in
pgcentralfoundation#1213
* Add a workaround for the pg16/homebrew/icu4c situation by @thomcc in
pgcentralfoundation#1206
* Add security policy by @johnrballard in
pgcentralfoundation#1207
* `AnyNumeric` is no longer backed by Postgres-allocated memory by
@eeeebbbbrrrr in pgcentralfoundation#1216
* Modularize pgrx::spi by @workingjubilee in
pgcentralfoundation#1219
* Stop SpiClient soundness from regressing by @workingjubilee in
pgcentralfoundation#1214
* Add foreign table headers by @workingjubilee in
pgcentralfoundation#1226
* Modularize the interior of pgrx-pg-sys by @workingjubilee in
pgcentralfoundation#1227
* Initial valgrind support by @thomcc in
pgcentralfoundation#1218
* Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF
in pgcentralfoundation#1229
* Ignores UI tests for MUSL environments by @BradyBonnette in
pgcentralfoundation#1235
* Add a env flag that can be set to skip `#[pg_test]`-generated tests.
by @thomcc in pgcentralfoundation#1239
* Fix issue pgcentralfoundation#1076: Properly handle dependency graph of `Result<T, _>` by
@eeeebbbbrrrr in pgcentralfoundation#1241
* Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by
@eeeebbbbrrrr in pgcentralfoundation#1240
* Add operator and cache related api by @VoVAllen in
pgcentralfoundation#1242
* Addresses cargo-pgrx error reporting by @BradyBonnette in
pgcentralfoundation#1238
* Update version to 0.10.0-beta.2 by @eeeebbbbrrrr in
pgcentralfoundation#1244
* Bump cargo-metadata and clap-cargo by @thomcc in
pgcentralfoundation#1246
* Derive Clone for Inet by @JelteF in
pgcentralfoundation#1251
* Correct docs for datetime `From` impls by @workingjubilee in
pgcentralfoundation#1253
* Only enable line tables for profile.dev by @thomcc in
pgcentralfoundation#1249
* Remove references to master branch by @thomcc in
pgcentralfoundation#1243
* Ensure bindgen gets all the `cppflags` it needs (on macOS, anyway) by
@thomcc in pgcentralfoundation#1247
* update for pg16beta3 support by @eeeebbbbrrrr in
pgcentralfoundation#1254
* Update version to 0.10.0-beta.3 by @eeeebbbbrrrr in
pgcentralfoundation#1255
* Add proptest support by @workingjubilee in
pgcentralfoundation#1258
* Misc reformatting and typo fixes by @workingjubilee in
pgcentralfoundation#1260
* spi: simplify (optimize?) Datum preparation by @vrmiguel in
pgcentralfoundation#1256
* Assume commutation when deriving PostgresEq by @workingjubilee in
pgcentralfoundation#1261
* Demand Ord for PostgresOrd by @workingjubilee in
pgcentralfoundation#1262
* Fix pgrx install causing postgresql coredump by @Sasasu in
pgcentralfoundation#1263
* Update version to 0.10.0-beta.4 by @workingjubilee in
pgcentralfoundation#1267

## New Contributors
* @clowder made their first contribution in
pgcentralfoundation#1166
* @yihong0618 made their first contribution in
pgcentralfoundation#1181
* @Sasasu made their first contribution in
pgcentralfoundation#1190
* @daamien made their first contribution in
pgcentralfoundation#1189
* @johnrballard made their first contribution in
pgcentralfoundation#1207
* @VoVAllen made their first contribution in
pgcentralfoundation#1242
* @vrmiguel made their first contribution in
pgcentralfoundation#1256


**Full Changelog**:
pgcentralfoundation/pgrx@v0.9.8...v0.10.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants