Skip to content

Commit

Permalink
fix: wasm_backtrace config bug (#814)
Browse files Browse the repository at this point in the history
- `$WASM_BACKTRACE_DETAILS` was enabled in `main` ghjk env which
affected embedded wasm module compilation to have backtrace enabled.
This broke typegate runs without the flag enabled due to mismatch.
- Fixes Cargo.lock not being used in Dockerfile.
- Prepare 0.4.8 release
  • Loading branch information
Yohe-Am authored Aug 16, 2024
1 parent bab4b41 commit 54b487d
Show file tree
Hide file tree
Showing 33 changed files with 172 additions and 193 deletions.
230 changes: 78 additions & 152 deletions .ghjk/lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exclude = [
"libs/pyrt_wit_wire",
]
[workspace.package]
version = "0.4.8-0"
version = "0.4.8"
edition = "2021"

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RUN . "$GHJK_ACTIVATE" \
COPY . .

RUN . "$GHJK_ACTIVATE" \
&& cargo build --profile $CARGO_PROFILE --package typegate \
&& cargo build --profile $CARGO_PROFILE --package typegate --locked \
&& ( \
[ $CARGO_PROFILE = 'release' ] \
&& cp target/release/typegate typegate-bin \
Expand Down
1 change: 1 addition & 0 deletions dev/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ libs/metagen/tests/
!typegate/import_map.json
!ghjk.ts
!Cargo.toml
!Cargo.lock
2 changes: 1 addition & 1 deletion dev/consts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
// SPDX-License-Identifier: Elastic-2.0

export const METATYPE_VERSION = "0.4.8-0";
export const METATYPE_VERSION = "0.4.8";
export const PUBLISHED_VERSION = "0.4.7";
export const GHJK_VERSION = "b702292";
export const GHJK_ACTION_VERSION = "318209a9d215f70716a4ac89dbeb9653a2deb8bc";
Expand Down
41 changes: 41 additions & 0 deletions dev/tasks-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,47 @@ const tasks: Record<string, DenoTaskDefArgs> = {
fn: ($) => $`cargo run -p typegate`,
},

"dev-gate3": {
desc: "Launch the typegate from a locally found meta bin.",
inherit: "dev-gate1",
fn: ($) => $`meta typegate`,
},

"dev-gate4": {
desc: "Launch the typegate from the locally built typegate image.",
inherit: "dev-gate1",
fn: ($) =>
$`docker run --rm -it
--network=host
-e TG_PORT=7891
-e PACKAGED=false
-e LOG_LEVEL=DEBUG
-e DEBUG=true
-e REDIS_URL=redis://:password@localhost:6379/0
-e TG_SECRET=a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw==
-e TG_ADMIN_PASSWORD=password
typegate:latest
`,
},

"dev-gate5": {
desc: "Launch the typegate from the latests published image.",
inherit: "dev-gate1",
fn: ($) =>
$`docker run --rm -it
--network=host
-p 7891:7891
-e TG_PORT=7891
-e PACKAGED=false
-e LOG_LEVEL=DEBUG
-e DEBUG=true
-e REDIS_URL=redis://:password@localhost:6379/0
-e TG_SECRET=a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw==
-e TG_ADMIN_PASSWORD=password
ghcr.io/metatypedev/typegate:latest
`,
},

"dev-website": {
desc: "Launch the website",
inherit: ["_ecma", "_python"],
Expand Down
16 changes: 11 additions & 5 deletions dev/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { projectDir } from "./utils.ts";

const wd = $.path(projectDir);

const profile: string = "debug";

async function listTestFiles(filesArg: string[]): Promise<string[]> {
if (filesArg.length > 0) {
const testFiles = [] as string[];
Expand Down Expand Up @@ -146,7 +148,7 @@ export async function testE2e(args: {
TIMER_MAX_TIMEOUT_MS: "30000",
// NOTE: ordering of the variables is important as we want the
// `meta` build to be resolved before any system meta builds
PATH: `${wd.join("target/debug").toString()}:${Deno.env.get("PATH")}`,
PATH: `${wd.join(`target/${profile}`).toString()}:${Deno.env.get("PATH")}`,
};

if (await wd.join(".venv").exists()) {
Expand All @@ -169,7 +171,7 @@ export async function testE2e(args: {
const prefix = "[dev/test.ts]";
$.logStep(`${prefix} Testing with ${threads} threads`);

const xtask = wd.join("target/debug/xtask");
const xtask = wd.join(`target/${profile}/xtask`);
const denoConfig = wd.join("typegate/deno.jsonc");

function createRun(testFile: string, streamed: boolean): Run {
Expand Down Expand Up @@ -205,10 +207,14 @@ export async function testE2e(args: {

const queue = [...filteredTestFiles];

const buildProfile = profile == "debug" ? "dev" : profile;

$.logStep(`${prefix} Building xtask and meta-cli...`);
await $`cargo build -p meta-cli -F typegate
&& mv target/debug/meta target/debug/meta-full
&& cargo build -p xtask -p meta-cli`.cwd(wd);
await $`cargo build -p meta-cli -F typegate --profile ${buildProfile}
&& mv target/${profile}/meta target/${profile}/meta-full
&& cargo build -p xtask -p meta-cli --profile ${buildProfile}`.cwd(
wd,
);

$.logStep(`Discovered ${queue.length} test files to run`);

Expand Down
2 changes: 1 addition & 1 deletion examples/templates/deno/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.4.8-0
image: ghcr.io/metatypedev/typegate:v0.4.8
restart: always
ports:
- "7890:7890"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/node/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.4.8-0
image: ghcr.io/metatypedev/typegate:v0.4.8
restart: always
ports:
- "7890:7890"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "MCLI_LOADER_CMD='npm x tsx' meta dev"
},
"dependencies": {
"@typegraph/sdk": "^0.4.8-0"
"@typegraph/sdk": "^0.4.8"
},
"devDependencies": {
"tsx": "^3.13.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/python/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.4.8-0
image: ghcr.io/metatypedev/typegate:v0.4.8
restart: always
ports:
- "7890:7890"
Expand Down
4 changes: 2 additions & 2 deletions examples/templates/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "example"
version = "0.4.8-0"
version = "0.4.8"
description = ""
authors = []

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
typegraph = "0.4.8-0"
typegraph = "0.4.8"

[build-system]
requires = ["poetry-core"]
Expand Down
1 change: 0 additions & 1 deletion ghjk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ env("main")
.install(installs.deno)
.vars({
RUST_LOG: "info,swc_ecma_codegen=off,tracing::span=off",
WASMTIME_BACKTRACE_DETAILS: "1",
TYPEGRAPH_VERSION: "0.0.3",
CLICOLOR_FORCE: "1",
})
Expand Down
2 changes: 1 addition & 1 deletion libs/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "common"
version = "0.4.8-0"
version = "0.4.8"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion libs/metagen/tests/mat_rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mat_rust"
edition = "2021"
version = "0.4.8-0"
version = "0.4.8"

[workspace]
members = ["gen"]
Expand Down
2 changes: 1 addition & 1 deletion libs/pyrt_wit_wire/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyrt_wit_wire"
version = "0.4.8-0"
version = "0.4.8"
description = "Wasm component implementing the PythonRuntime host using wit_wire protocol."
license = "Elastic-2.0"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion libs/xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xtask"
version = "0.4.8-0"
version = "0.4.8"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion meta-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "meta-cli"
version = "0.4.8-0"
version = "0.4.8"
edition = "2021"

description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are."
Expand Down
2 changes: 1 addition & 1 deletion meta-lsp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "VSCode extension for Metatype support",
"icon": "logo.png",
"author": "Metatype Team",
"version": "0.4.8-0",
"version": "0.4.8",
"repository": {
"type": "git",
"url": "https://github.com/metatypedev/metatype"
Expand Down
2 changes: 1 addition & 1 deletion meta-lsp/ts-language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "typegraph-ts-server",
"description": "TypeScript language server for TypeGraph",
"author": "Metatype Team",
"version": "0.4.8-0",
"version": "0.4.8",
"repository": {
"type": "git",
"url": "https://github.com/metatypedev/metatype"
Expand Down
2 changes: 1 addition & 1 deletion meta-lsp/vscode-metatype-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-metatype-support",
"description": "VSCode extension for Metatype support",
"author": "Metatype Team",
"version": "0.4.8-0",
"version": "0.4.8",
"repository": {
"type": "git",
"url": "https://github.com/metatypedev/metatype"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "metatype"
version = "0.4.8-0"
version = "0.4.8"
description = ""
authors = []

Expand Down
3 changes: 3 additions & 0 deletions typegate/engine/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

let engine = wasmtime::Engine::new(
wasmtime::Config::new()
.wasm_backtrace(true)
// embedded wasm images have backtrace enabled
.wasm_backtrace_details(wasmtime::WasmBacktraceDetails::Enable)
.cache_config_load_default()
.map_err(|err| format!("error reading system's wasmtime cache config: {err}"))?
.target(&target)
Expand Down
3 changes: 3 additions & 0 deletions typegate/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ impl OpDepInjector {
let engine = wasmtime::Engine::new(
wasmtime::Config::new()
.async_support(true)
.wasm_backtrace(true)
// embedded wasm images have backtrace enabled
.wasm_backtrace_details(wasmtime::WasmBacktraceDetails::Enable)
.cache_config_load_default()
.context("error reading system's wasmtime cache config")
.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion typegate/src/runtimes/wit_wire/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getLogger } from "../../log.ts";

const logger = getLogger(import.meta);

const METATYPE_VERSION = "0.4.8-0";
const METATYPE_VERSION = "0.4.8";

export class WitWireMessenger {
static async init(
Expand Down
4 changes: 2 additions & 2 deletions typegate/tests/metagen/__snapshots__/metagen_test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl Router {
}
pub fn init(&self, args: InitArgs) -> Result<InitResponse, InitError> {
static MT_VERSION: &str = "0.4.8-0";
static MT_VERSION: &str = "0.4.8";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
Expand Down Expand Up @@ -1106,7 +1106,7 @@ impl Router {
}
pub fn init(&self, args: InitArgs) -> Result<InitResponse, InitError> {
static MT_VERSION: &str = "0.4.8-0";
static MT_VERSION: &str = "0.4.8";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
Expand Down
2 changes: 1 addition & 1 deletion typegate/tests/runtimes/wasm_reflected/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust"
version = "0.4.8-0"
version = "0.4.8"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion typegraph/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typegraph_core"
version = "0.4.8-0"
version = "0.4.8"
edition = "2021"

[lib]
Expand Down
Loading

0 comments on commit 54b487d

Please sign in to comment.