Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1188,20 +1188,23 @@ jobs:
if-no-files-found: error

- name: Upload shared Rust query package
if: ${{ contains(join(fromJson(needs.affected.outputs.job_targets)['rust-sdk-package'], ','), 'oliphaunt-query:') }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: oliphaunt-query-sdk-package-artifacts
path: target/sdk-artifacts/oliphaunt-query
if-no-files-found: error

- name: Upload native Rust bindings package
if: ${{ contains(join(fromJson(needs.affected.outputs.job_targets)['rust-sdk-package'], ','), 'liboliphaunt-native-bindings:') }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: liboliphaunt-native-bindings-sdk-package-artifacts
path: target/sdk-artifacts/liboliphaunt-native-bindings
if-no-files-found: error

- name: Upload broker source package
if: ${{ contains(join(fromJson(needs.affected.outputs.job_targets)['rust-sdk-package'], ','), 'oliphaunt-broker:') }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: oliphaunt-broker-sdk-package-artifacts
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/database-resources/icu/cargo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_icu.rs"));
Expand Down
2 changes: 1 addition & 1 deletion src/database-resources/seeds/package-carriers.mts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export function packageSeedCarriers(argv = [], { assetDir, outputDir, sourceDir
mkdirSync(path.join(stage, 'src'));
writeFileSync(
path.join(stage, 'src/lib.rs'),
`#![deny(unsafe_code)]\npub fn seed_archive() -> &'static [u8] { include_bytes!("../seed.tar.zst") }\npub fn seed_manifest() -> &'static str { include_str!("../manifest.json") }\n${identity.profile === 'icu' ? 'pub use oliphaunt_icu as icu;\n' : ''}`,
`#![doc = include_str!("../README.md")]\n#![deny(unsafe_code)]\npub fn seed_archive() -> &'static [u8] { include_bytes!("../seed.tar.zst") }\npub fn seed_manifest() -> &'static str { include_str!("../manifest.json") }\n${identity.profile === 'icu' ? 'pub use oliphaunt_icu as icu;\n' : ''}`,
);
writeFileSync(
path.join(stage, 'Cargo.toml'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ The default \`native\` feature selects the matching native artifact leaf.${
);
writeFileSync(
path.join(sourceDir, 'src/lib.rs'),
`#![deny(unsafe_op_in_unsafe_fn)]
`#![doc = include_str!("../README.md")]
#![deny(unsafe_op_in_unsafe_fn)]

${unsupportedNativeGuard}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,8 @@ Applications do not depend on this crate directly.
);
writeFileSync(
path.join(crateDir, 'src/lib.rs'),
`pub const PRODUCT: &str = "${product}";
`#![doc = include_str!("../README.md")]
pub const PRODUCT: &str = "${product}";
pub const KIND: &str = "extension-part";
pub const MEMBERS: &[&str] = &[${members.map((member) => JSON.stringify(member)).join(', ')}];
pub const RELEASE_TARGET: &str = "${target}";
Expand Down Expand Up @@ -2784,7 +2785,8 @@ sha2 = "0.10"
);
writeFileSync(
path.join(crateDir, 'src/lib.rs'),
`pub const PRODUCT: &str = "${product}";
`#![doc = include_str!("../README.md")]
pub const PRODUCT: &str = "${product}";
pub const KIND: &str = "extension";
pub const MEMBERS: &[&str] = &[${members.map((member) => JSON.stringify(member)).join(', ')}];
pub const RELEASE_TARGET: &str = "${target}";
Expand Down
1 change: 1 addition & 0 deletions src/native/broker/crates/linux-arm64-gnu/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
pub const PRODUCT: &str = "oliphaunt-broker";
pub const KIND: &str = "broker-helper";
pub const RELEASE_TARGET: &str = "linux-arm64-gnu";
Expand Down
1 change: 1 addition & 0 deletions src/native/broker/crates/linux-x64-gnu/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
pub const PRODUCT: &str = "oliphaunt-broker";
pub const KIND: &str = "broker-helper";
pub const RELEASE_TARGET: &str = "linux-x64-gnu";
Expand Down
1 change: 1 addition & 0 deletions src/native/broker/crates/macos-arm64/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
pub const PRODUCT: &str = "oliphaunt-broker";
pub const KIND: &str = "broker-helper";
pub const RELEASE_TARGET: &str = "macos-arm64";
Expand Down
1 change: 1 addition & 0 deletions src/native/broker/crates/windows-x64-msvc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
pub const PRODUCT: &str = "oliphaunt-broker";
pub const KIND: &str = "broker-helper";
pub const RELEASE_TARGET: &str = "windows-x64-msvc";
Expand Down
3 changes: 2 additions & 1 deletion src/native/broker/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ tasks:
CARGO_TARGET_DIR: "target"
inputs:
- "@group(cargo-workspace)"
- "@group(code)"
- "{src,tests}/**/*"
- "{Cargo.toml,README.md}"
options:
cache: true
runFromWorkspaceRoot: true
Expand Down
1 change: 1 addition & 0 deletions src/native/broker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
//! Broker transport shared by the broker executable and native SDK client.
pub mod ipc;
pub mod mobile;
Expand Down
1 change: 1 addition & 0 deletions src/native/postgres-tools/crates/tools/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

mod arguments;
Expand Down
2 changes: 2 additions & 0 deletions src/native/runtime/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ tasks:
- requires-rust
command: "bash src/native/runtime/tools/test-packaging.sh"
inputs:
- /src/native/postgres-tools/crates/tools/**/*
- /src/native/postgres-tools/tools/package-cargo-artifacts.mts
- /tools/packaging/windows-vc-runtime-policy.json
- /src/extensions/tools/extension-upstream-licenses.mts
- /src/extensions/contracts/*.mts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ bash tools/dev/bun.sh test ./src/native/runtime/tools/package-liboliphaunt-cargo
CARGO_HOME="$root/installed-consumer/cargo-home" \
CARGO_TARGET_DIR="$root/installed-consumer/target" \
cargo check --offline --manifest-path "$root/installed-consumer/Cargo.toml"
CARGO_HOME="$root/installed-consumer/cargo-home" \
CARGO_TARGET_DIR="$root/installed-consumer/target" \
cargo doc --offline --no-deps --manifest-path "$root/installed-consumer/Cargo.toml" \
-p liboliphaunt-native-linux-x64-gnu -p oliphaunt-tools
grep -q 'Cargo artifact crate for' "$root/installed-consumer/target/doc/liboliphaunt_native_linux_x64_gnu/index.html"
grep -q 'Optional endpoint-oriented runner' "$root/installed-consumer/target/doc/oliphaunt_tools/index.html"
if rustc --crate-name oliphaunt_tools --crate-type lib --edition 2024 \
--emit metadata -o "$root/unsupported.rmeta" "$root/forced-unsupported-tools.rs" \
> "$root/unsupported.log" 2>&1; then
Expand Down
2 changes: 1 addition & 1 deletion src/native/rust-bindings/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ tasks:
cacheStrategy: hash
tags: ["quality", "unit", "requires-rust"]
command: "cargo test --locked"
inputs: ["@group(code)", "testdata/**/*", "/Cargo.lock", "/Cargo.toml"]
inputs: ["@group(code)", "README.md", "testdata/**/*", "/Cargo.lock", "/Cargo.toml"]
package:
tags: ["release", "artifact-package", "ci-rust-sdk-package"]
script: |
Expand Down
1 change: 1 addition & 0 deletions src/native/rust-bindings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_op_in_unsafe_fn)]
//! Shared native liboliphaunt execution and resource ownership.
mod build_resources;
Expand Down
2 changes: 1 addition & 1 deletion src/native/sdks/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The [quickstart](https://oliphaunt.dev/docs/sdk/rust) covers prerequisites and t

The crate includes its matching desktop runtime resources.

```rust
```rust,no_run
use oliphaunt::Oliphaunt;

fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
3 changes: 2 additions & 1 deletion src/native/sdks/rust/crates/oliphaunt-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ bundle Oliphaunt runtime artifacts.

Applications add it as a build dependency and call it from `build.rs`:

```rust
```rust,no_run
# #[allow(clippy::needless_doctest_main)] // build.rs requires a main function.
fn main() {
oliphaunt_build::configure();
}
Expand Down
1 change: 1 addition & 0 deletions src/native/sdks/rust/crates/oliphaunt-build/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
//! Cargo artifact integration for SDKs and custom deployments.
//!
//! The SDK uses `embed_resolved_artifacts()` internally. Ordinary applications
Expand Down
4 changes: 3 additions & 1 deletion src/native/sdks/rust/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ tasks:
- "@group(rust-test-config)"
- project: "shared-test-fixtures"
group: "fixtures"
- "@group(code)"
- "{src,tests,tools}/**/*"
- "{Cargo.toml,build.rs,README.md}"
- "crates/oliphaunt-build/**/*"
options:
cache: true
runFromWorkspaceRoot: true
Expand Down
5 changes: 1 addition & 4 deletions src/native/sdks/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_op_in_unsafe_fn)]
#![forbid(missing_docs)]
//! Native-first Rust SDK surface for embedded Oliphaunt.
//!
//! This crate is deliberately native-only. It does not expose a WASIX engine
//! and it does not depend on the current `oliphaunt-wasix` runtime layout.

#[cfg(feature = "desktop")]
mod broker;
Expand Down
2 changes: 1 addition & 1 deletion src/query/rust/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tasks:
cacheStrategy: hash
tags: ["quality", "unit", "requires-rust"]
command: "cargo test --locked"
inputs: ["@group(sources)", "/Cargo.lock", "/Cargo.toml"]
inputs: ["@group(sources)", "README.md", "/Cargo.lock", "/Cargo.toml"]

package:
tags: ["release", "artifact-package", "ci-rust-sdk-package"]
Expand Down
1 change: 1 addition & 0 deletions src/query/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
// Runtime-neutral PostgreSQL query protocol core shared by the Rust SDKs.
//
// This module deliberately has no dependencies outside `std`. It owns the
Expand Down
1 change: 1 addition & 0 deletions src/wasix/pgwire-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ tokio = { version = "1", features = ["sync"], optional = true }
tracing = { version = "0.1", optional = true }

[dev-dependencies]
futures-util = { version = "0.3", default-features = false, features = ["std"] }
serde_json = "1"
sqlx = { version = "0.8", default-features = false, features = ["postgres", "runtime-tokio"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }
Expand Down
2 changes: 1 addition & 1 deletion src/wasix/pgwire-server/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tasks:
cacheStrategy: hash
command: "cargo test --locked"
tags: ["quality", "unit", "requires-rust"]
inputs: ["@group(sources)", "/Cargo.toml", "/Cargo.lock"]
inputs: ["@group(sources)", "README.md", "/Cargo.toml", "/Cargo.lock"]
test-integration:
command: "cargo test --locked -- --ignored --test-threads=1"
tags: ["runtime", "integration", "requires-rust", "ci-liboliphaunt-wasix-aot"]
Expand Down
1 change: 1 addition & 0 deletions src/wasix/pgwire-server/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
//! PostgreSQL wire server with a separately selectable WASIX backend.

/// Runtime-independent PostgreSQL connection framing.
Expand Down
45 changes: 45 additions & 0 deletions src/wasix/pgwire-server/tests/client_compat.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![cfg(feature = "wasix")]

use anyhow::{Context, Result};
use futures_util::TryStreamExt;
use oliphaunt_pgwire_server::AsyncOliphauntServer;
use sqlx::{Connection, Row};
use tokio_postgres::NoTls;
Expand Down Expand Up @@ -40,6 +41,50 @@ async fn tokio_postgres_parameters_and_error_recovery_work() -> Result<()> {
Ok(())
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
#[ignore = "requires prepared WASIX runtime"]
async fn tokio_postgres_recovers_from_plpgsql_error_after_copy() -> Result<()> {
let server = AsyncOliphauntServer::builder().start().await?;
let (client, connection) = tokio_postgres::connect(server.connection_string(), NoTls).await?;
let connection = tokio::spawn(connection);
client
.batch_execute(
"CREATE TABLE items(id integer PRIMARY KEY); \
INSERT INTO items VALUES (1), (2); \
CREATE FUNCTION fail() RETURNS integer LANGUAGE plpgsql AS $$ \
BEGIN INSERT INTO items VALUES (3); RAISE EXCEPTION 'expected'; END $$",
)
.await?;

for _ in 0..3 {
let copied = client
.copy_out("COPY (SELECT id FROM items ORDER BY id) TO STDOUT")
.await?
.try_collect::<Vec<_>>()
.await?;
assert_eq!(copied.concat(), b"1\n2\n");

let error = client
.query_one("SELECT fail()", &[])
.await
.expect_err("PL/pgSQL error after COPY must preserve the connection");
assert_eq!(error.code().map(|code| code.code()), Some("P0001"));
assert_eq!(
client
.query_one("SELECT count(*)::int4 FROM items", &[])
.await?
.get::<_, i32>(0),
2,
"the failed statement must roll back its insert"
);
}

drop(client);
connection.await??;
server.close().await?;
Ok(())
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
#[ignore = "requires prepared WASIX runtime"]
async fn sqlx_uses_the_standard_postgres_connection_string() -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_aot.rs"));
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_aot.rs"));
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_aot.rs"));
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_aot.rs"));
1 change: 1 addition & 0 deletions src/wasix/postgres-tools/crates/tools/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_tools.rs"));
4 changes: 2 additions & 2 deletions src/wasix/postgres-tools/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ tasks:
test-consumer:
tags: ["integration", "consumer", "ci-wasix-ts-sdk-package"]
command: "bash tools/ci/with-projects.sh --exec bash src/wasix/postgres-tools/ts/tests/consumer.sh"
deps: ["oliphaunt-query-ts:build", "oliphaunt-wasix-tools-ts:package", {target: "oliphaunt-wasix-ts:package", cacheStrategy: ignored}, "oliphaunt-wasix-ts:build", "wasix-browser-host:build", "oliphaunt-wasix-napi:build-release-assets", "postgres-tools-wasix:package-portable", "postgres-tools-wasix:package-aot"]
deps: ["oliphaunt-query-ts:build", "extension-artifacts-wasix:compiler-output", "oliphaunt-wasix-tools-ts:package", {target: "oliphaunt-wasix-ts:package", cacheStrategy: ignored}, "oliphaunt-wasix-ts:build", "wasix-browser-host:build", "oliphaunt-wasix-napi:build-release-assets", "postgres-tools-wasix:package-portable", "postgres-tools-wasix:package-aot"]
inputs: ["ts/tests/**/*", "/src/wasix/sdks/ts/tools/integration/packed-node-fixture.mts", "/src/wasix/sdks/ts/tools/pgwire-client.mts", "/src/test-fixtures/postgres/**/*", "tools/*.mts"]
options: {cache: false, runFromWorkspaceRoot: true}
test-browser:
tags: ["integration", "browser", "ci-wasix-ts-sdk-package"]
command: "bash tools/ci/with-projects.sh --exec bash src/wasix/sdks/ts/tools/integration/smoke-browser.sh --package-only --tools"
deps: ["oliphaunt-query-ts:build", "oliphaunt-wasix-tools-ts:package", {target: "oliphaunt-wasix-ts:package", cacheStrategy: ignored}, "oliphaunt-wasix-ts:build", "wasix-browser-host:build", "postgres-tools-wasix:package-portable"]
deps: ["oliphaunt-query-ts:build", "extension-artifacts-wasix:compiler-output", "database-resources:package-wasix", "database-resources:package-icu", "oliphaunt-wasix-tools-ts:package", {target: "oliphaunt-wasix-ts:package", cacheStrategy: ignored}, "oliphaunt-wasix-ts:build", "wasix-browser-host:build", "postgres-tools-wasix:package-portable"]
inputs: ["ts/tests/**/*", "/src/wasix/sdks/ts/tools/integration/{packed-node-fixture.mts,smoke-browser.*}", "/src/test-fixtures/postgres/**/*", "tools/*.mts"]
options: {cache: false, runFromWorkspaceRoot: true}
format-check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Use the same relocatable wasm linker shape as the released WASIX lane when
assembling the backend core archive. Leave the final dynamic-main link to the
product build helper so its generated side-module export closure stays the one
authoritative policy instead of wasixcc's unconditional export-all default.

This partial link lowers the backend's ThinLTO bitcode, so enable Wasm EH and
SJLJ here as well as at the final link. Otherwise the backend's inlined
sigsetjmp sites retain an unsupported setjmp import. Limit inlining during
this link to avoid multiplying SJLJ catch-state spills across large functions;
keep the normal frontend and final-link optimization settings.
---
src/backend/Makefile | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
Expand Down Expand Up @@ -35,7 +41,7 @@ index 9292f77031..89c356d090 100644
+ rm -f $(top_builddir)/libpgmain.a $(LIBPG) $(top_builddir)/libpgcore.o $(LIBPGCORE)
+ $(AR) rcs $(top_builddir)/libpgmain.a $(PGMAIN)
+ $(AR) rcs $(LIBPG) $(PGBACKEND)
+ $(WASM_LD) --relocatable -o $(top_builddir)/libpgcore.o --whole-archive $(PGCORE) --no-whole-archive
+ $(WASM_LD) --relocatable -mllvm -inline-threshold=0 -mllvm --wasm-enable-eh -mllvm --wasm-enable-sjlj -mllvm --wasm-use-legacy-eh=false -mllvm --exception-model=wasm -o $(top_builddir)/libpgcore.o --whole-archive $(PGCORE) --no-whole-archive
+ $(AR) rcs $(LIBPGCORE) $(top_builddir)/libpgcore.o

postgres: oliphaunt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ Subject: [PATCH] oliphaunt-wasix: inline sigsetjmp
The released WASIX exception-handling sysroot exposes sigsetjmp as a normal
function. That is not sufficient for WebAssembly SJLJ: the compiler must see
setjmp at each call site so that it emits the exception handler in the module
whose frame is being protected. A PostgreSQL side module otherwise calls the
main executable's sigsetjmp, returns from its handler frame, and later turns a
perfectly catchable PostgreSQL ERROR into an uncaught WebAssembly exception.
whose frame is being protected. Core and side-module callers otherwise return
from the wrapper's handler frame before siglongjmp, turning a perfectly
catchable PostgreSQL ERROR into an uncaught WebAssembly exception.

Mark PostgreSQL's shared-library and PGXS module compilations explicitly, then
define the POSIX spelling in the WASIX port header in terms of the
compiler-recognized setjmp call for those modules only. The pinned WASIX
compiler-recognized setjmp call for the single-user core and those modules.
The pinned WASIX
implementation currently does not preserve a signal mask in sigsetjmp either,
so discarding savesigs retains its existing semantics while making
PG_TRY/PG_CATCH correct in every PostgreSQL side module.
PG_TRY/PG_CATCH correct in the core and every PostgreSQL side module.
---
src/Makefile.shlib | 1 +
src/include/port/wasix-dl.h | 16 +++++++++++++++-
Expand Down Expand Up @@ -44,12 +45,12 @@ index ba0d68bb70..aac596375e 100644
#include <setjmp.h>
+#endif
+
+#if defined(__wasm_exception_handling__) && defined(OLIPHAUNT_WASM_SIDE_MODULE)
+#if defined(__wasm_exception_handling__) && (defined(OLIPHAUNT_WASM_SINGLE_USER) || defined(OLIPHAUNT_WASM_SIDE_MODULE))
+/*
+ * WebAssembly SJLJ requires setjmp to be visible at the protected call site.
+ * The released WASIX EH sysroot implements sigsetjmp as an out-of-line
+ * wrapper, whose exception handler has already returned by the time a side
+ * module calls siglongjmp. Its implementation ignores savesigs, so this
+ * wrapper, whose exception handler has already returned by the time the
+ * caller invokes siglongjmp. Its implementation ignores savesigs, so this
+ * call-site expansion preserves the same signal-mask semantics.
+ */
+#undef sigsetjmp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code)]

include!(concat!(env!("OUT_DIR"), "/generated_aot.rs"));
Loading
Loading