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
10 changes: 5 additions & 5 deletions packages/core/tests/duckdb-package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { existsSync } from "node:fs";
import coreutils from "@rivet-dev/agent-os-coreutils";
import duckdb from "../../../registry/software/duckdb/dist/index.js";
import httpGet from "../../../registry/software/http-get/dist/index.js";
import { AgentOs } from "../src/index.js";
import { AgentOs } from "../dist/index.js";

const hasDuckdbPackage = existsSync(`${duckdb.commandDir}/duckdb`);
const hasHttpGetPackage = existsSync(`${httpGet.commandDir}/http_get`);
Expand Down Expand Up @@ -36,12 +36,12 @@ describe.skipIf(!hasDuckdbPackage || !hasHttpGetPackage || !hasCoreutilsPackage)
let result = await vm.exec(
`duckdb -csv /tmp/app.duckdb -c "CREATE TABLE items(id INTEGER, value INTEGER); INSERT INTO items VALUES (1, 10), (2, 20); UPDATE items SET value = value + 1 WHERE id = 2;"`,
);
expect(result.exitCode).toBe(0);
expect(result.exitCode, result.stderr || result.stdout).toBe(0);

result = await vm.exec(
`duckdb -csv /tmp/app.duckdb -c "SELECT id, value FROM items ORDER BY id;"`,
);
expect(result.exitCode).toBe(0);
expect(result.exitCode, result.stderr || result.stdout).toBe(0);
expect(result.stdout.trim()).toBe("id,value\n1,10\n2,21");
expect(await vm.exists("/tmp/app.duckdb")).toBe(true);
});
Expand Down Expand Up @@ -69,12 +69,12 @@ describe.skipIf(!hasDuckdbPackage || !hasHttpGetPackage || !hasCoreutilsPackage)
let result = await vm.exec(
`http_get ${address.port} /remote.csv /tmp/remote.csv`,
);
expect(result.exitCode).toBe(0);
expect(result.exitCode, result.stderr || result.stdout).toBe(0);

result = await vm.exec(
`duckdb -csv -c "SELECT SUM(value) AS total FROM read_csv_auto('/tmp/remote.csv');"`,
);
expect(result.exitCode).toBe(0);
expect(result.exitCode, result.stderr || result.stdout).toBe(0);
expect(result.stdout.trim()).toBe("total\n8");
} finally {
await closeServer(server);
Expand Down
6 changes: 1 addition & 5 deletions registry/native/c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -514,15 +514,11 @@ $(NATIVE_DIR)/unzip: programs/unzip.c $(ZLIB_SRCS) $(MINIZIP_UNZIP_SRCS)
$(NATIVE_CC) $(NATIVE_CFLAGS) $(ZIP_INCLUDES) -o $@ programs/unzip.c $(ZLIB_SRCS) $(MINIZIP_UNZIP_SRCS) -lz

# curl_test: links libcurl (HTTP/HTTPS build for WASM via host_net + host_tls)
# Curl still expects stable local/peer socket-name queries after connect, so
# keep its WASI compatibility shim but route curl's own references onto private
# wrapper symbols to avoid colliding with our patched sysroot exports.
CURL_SRCS := $(wildcard libs/curl/lib/*.c) $(wildcard libs/curl/lib/vauth/*.c) \
$(wildcard libs/curl/lib/vtls/*.c) $(wildcard libs/curl/lib/vquic/*.c) \
$(wildcard libs/curl/lib/vssh/*.c)
CURL_INCLUDES := -Ilibs/curl/include -Ilibs/curl/lib -include libs/curl/lib/curl_setup.h -include libs/curl/lib/curl_printf.h
CURL_LIB_DEFS := -DHAVE_CONFIG_H -DBUILDING_LIBCURL -D_WASI_EMULATED_SIGNAL -DHAVE_BASENAME -DHAVE_LIBGEN_H \
-Dgetsockname=curl_wasi_getsockname -Dgetpeername=curl_wasi_getpeername
CURL_LIB_DEFS := -DHAVE_CONFIG_H -DBUILDING_LIBCURL -D_WASI_EMULATED_SIGNAL -DHAVE_BASENAME -DHAVE_LIBGEN_H

$(BUILD_DIR)/curl: scripts/build-curl-upstream.sh $(CURL_UPSTREAM_OVERLAY_FILES) $(WASI_SDK_DIR)/bin/clang
@mkdir -p $(BUILD_DIR)
Expand Down
6 changes: 3 additions & 3 deletions registry/tests/wasmvm/duckdb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,14 @@ describe.skipIf(!hasWasmDuckDB)('duckdb command', { timeout: 120_000 }, () => {
}

let result;
if (hasWasmCurl) {
if (hasWasmHttpGet) {
result = await kernel.exec(
`curl -fsS -o /tmp/remote.csv http://127.0.0.1:${address.port}/remote.csv`
`http_get ${address.port} /remote.csv /tmp/remote.csv`
);
expect(result.exitCode).toBe(0);
} else {
result = await kernel.exec(
`http_get ${address.port} /remote.csv /tmp/remote.csv`
`curl -fsS -o /tmp/remote.csv http://127.0.0.1:${address.port}/remote.csv`
);
expect(result.exitCode).toBe(0);
}
Expand Down
Loading