Skip to content

Commit 4b2c229

Browse files
authored
Merge branch 'master' into bfops/use-new-internal-tests
2 parents e5e4152 + 70db721 commit 4b2c229

116 files changed

Lines changed: 2775 additions & 5137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 34 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ jobs:
102102
cd $env:USERPROFILE\emsdk
103103
.\emsdk install 4.0.21
104104
.\emsdk activate 4.0.21
105-
# Add emscripten to PATH for subsequent steps and subprocesses
106-
$emsdkPath = "$env:USERPROFILE\emsdk\upstream\emscripten"
107-
Add-Content -Path $env:GITHUB_PATH -Value $emsdkPath
108-
Write-Host "Added $emsdkPath to PATH"
109105
110106
- name: Install psql (Windows)
111107
if: runner.os == 'Windows'
@@ -342,24 +338,8 @@ jobs:
342338
- uses: dsherret/rust-toolchain-file@v1
343339
- name: Set default rust toolchain
344340
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
345-
- name: Set up Python env
346-
run: |
347-
test -d venv || python3 -m venv venv
348-
venv/bin/pip3 install argparse toml
349341
- name: Run checks
350-
run: |
351-
set -ueo pipefail
352-
FAILED=0
353-
ROOTS=(spacetimedb spacetimedb-sdk)
354-
CRATES=$(venv/bin/python3 tools/find-publish-list.py --recursive --directories --quiet "${ROOTS[@]}")
355-
for crate_dir in $CRATES; do
356-
if ! venv/bin/python3 tools/crate-publish-checks.py "${crate_dir}"; then
357-
FAILED=$(( $FAILED + 1 ))
358-
fi
359-
done
360-
if [ $FAILED -gt 0 ]; then
361-
exit 1
362-
fi
342+
run: cargo ci publish-checks
363343

364344
update:
365345
name: Test spacetimedb-update flow (${{ matrix.target }})
@@ -389,28 +369,10 @@ jobs:
389369
shell: bash
390370
run: sudo apt install -y libssl-dev
391371

392-
- name: Build spacetimedb-update
393-
run: cargo build --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update
394-
if: runner.os == 'Windows'
395-
396-
- name: Run self-install
397-
env:
398-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
399-
shell: bash
400-
run: |
401-
ROOT_DIR="$(mktemp -d)"
402-
# NOTE(bfops): We need the `github-token-auth` feature because we otherwise tend to get ratelimited when we try to fetch `/releases/latest`.
403-
# My best guess is that, on the GitHub runners, the "anonymous" ratelimit is shared by *all* users of that runner (I think this because it
404-
# happens very frequently on the `macos-runner`, but we haven't seen it on any others).
405-
cargo run --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update -- self-install --root-dir="${ROOT_DIR}" --yes
406-
"${ROOT_DIR}"/spacetime --root-dir="${ROOT_DIR}" help
407-
if: runner.os == 'Windows'
408-
409372
- name: Test spacetimedb-update
410373
env:
411374
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
412375
run: cargo ci update-flow --target=${{ matrix.target }} --github-token-auth
413-
if: runner.os != 'Windows'
414376

415377
unreal_engine_tests:
416378
name: Unreal Engine Tests
@@ -1179,13 +1141,12 @@ jobs:
11791141
restore-keys: |
11801142
${{ runner.os }}-pnpm-store-
11811143
1182-
- name: Install dependencies
1183-
working-directory: docs
1184-
run: pnpm install
1144+
- uses: dsherret/rust-toolchain-file@v1
1145+
- name: Set default rust toolchain
1146+
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
11851147

11861148
- name: Docusaurus build
1187-
working-directory: docs
1188-
run: pnpm build
1149+
run: cargo ci docs
11891150

11901151
typescript-test:
11911152
name: TypeScript - Tests
@@ -1217,14 +1178,6 @@ jobs:
12171178
restore-keys: |
12181179
${{ runner.os }}-pnpm-store-
12191180
1220-
- name: Build module library and SDK
1221-
working-directory: crates/bindings-typescript
1222-
run: pnpm build
1223-
1224-
- name: Run module library and SDK tests
1225-
working-directory: crates/bindings-typescript
1226-
run: pnpm test
1227-
12281181
# - name: Extract SpacetimeDB branch name from file
12291182
# id: extract-branch
12301183
# run: |
@@ -1264,76 +1217,38 @@ jobs:
12641217
save-if: false
12651218
prefix-key: v1
12661219

1267-
# This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
1268-
# ChatGPT suspects that this could be due to different build invocations using the same target dir,
1269-
# and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
1270-
# `cargo build --manifest-path` (which apparently build different dependency trees).
1271-
# However, we've been unable to fix it so... /shrug
1272-
- name: Check v8 outputs
1273-
run: |
1274-
find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
1275-
if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
1276-
echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1277-
cargo clean -p v8 || true
1278-
cargo build -p v8
1279-
fi
1280-
if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then
1281-
echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1282-
cargo clean --release -p v8 || true
1283-
cargo build --release -p v8
1284-
fi
1285-
1286-
- name: Install SpacetimeDB CLI from the local checkout
1287-
run: |
1288-
export CARGO_HOME="$HOME/.cargo"
1289-
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
1290-
cargo install --force --path crates/cli --locked --message-format=short
1291-
cargo install --force --path crates/standalone --locked --message-format=short
1292-
# Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
1293-
ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
1294-
# Clear any existing information
1295-
spacetime server clear -y
1296-
1297-
- name: Generate client bindings
1298-
working-directory: templates/chat-react-ts
1299-
run: |
1300-
pnpm generate
1301-
1302-
- name: Check for changes
1303-
working-directory: templates/chat-react-ts
1304-
run: |
1305-
"${GITHUB_WORKSPACE}"/tools/check-diff.sh src/module_bindings || {
1306-
echo "Error: Bindings are dirty. Please generate bindings again and commit them to this branch."
1307-
exit 1
1308-
}
1309-
1310-
# - name: Start SpacetimeDB
1220+
# # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
1221+
# # ChatGPT suspects that this could be due to different build invocations using the same target dir,
1222+
# # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
1223+
# # `cargo build --manifest-path` (which apparently build different dependency trees).
1224+
# # However, we've been unable to fix it so... /shrug
1225+
# - name: Check v8 outputs
13111226
# run: |
1312-
# spacetime start &
1313-
# disown
1314-
1315-
# - name: Publish module to SpacetimeDB
1316-
# working-directory: SpacetimeDB/templates/quickstart-chat-typescript/spacetimedb
1317-
# run: |
1318-
# spacetime logout && spacetime login --server-issued-login local
1319-
# spacetime publish -s local quickstart-chat -c -y
1227+
# find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
1228+
# if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
1229+
# echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1230+
# cargo clean -p v8 || true
1231+
# cargo build -p v8
1232+
# fi
1233+
# if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then
1234+
# echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1235+
# cargo clean --release -p v8 || true
1236+
# cargo build --release -p v8
1237+
# fi
13201238

1321-
# - name: Publish module to SpacetimeDB
1322-
# working-directory: SpacetimeDB/templates/quickstart-chat-typescript/spacetimedb
1239+
# - name: Install SpacetimeDB CLI from the local checkout
13231240
# run: |
1324-
# spacetime logs quickstart-chat
1325-
1326-
- name: Check that quickstart-chat builds
1327-
working-directory: templates/chat-react-ts
1328-
run: pnpm build
1329-
1330-
- name: Check that templates build
1331-
working-directory: templates/
1332-
run: pnpm -r --filter "./**" run build
1333-
1334-
- name: Check that subdirectories build
1335-
working-directory: crates/bindings-typescript
1336-
run: pnpm -r --filter "./**" run build
1241+
# export CARGO_HOME="$HOME/.cargo"
1242+
# echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
1243+
# cargo install --force --path crates/cli --locked --message-format=short
1244+
# cargo install --force --path crates/standalone --locked --message-format=short
1245+
# # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
1246+
# ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
1247+
# # Clear any existing information
1248+
# spacetime server clear -y
1249+
1250+
- name: Run TypeScript tests
1251+
run: cargo ci typescript-test
13371252

13381253
# - name: Run quickstart-chat tests
13391254
# working-directory: examples/quickstart-chat

Cargo.lock

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ arrayvec = "0.7.2"
156156
async-channel = "2.5"
157157
async-stream = "0.3.6"
158158
async-trait = "0.1.68"
159-
axum = { version = "0.8.4", features = ["tracing"] }
160-
axum-extra = { version = "0.10", features = ["typed-header"] }
159+
axum = { version = "0.7", features = ["tracing"] }
160+
axum-extra = { version = "0.9", features = ["typed-header"] }
161161
backtrace = "0.3.66"
162162
base64 = "0.21.2"
163163
bigdecimal = "0.4.7"

crates/bindings-cpp/include/spacetimedb/internal/runtime_registration.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#ifndef SPACETIMEDB_RUNTIME_REGISTRATION_H
22
#define SPACETIMEDB_RUNTIME_REGISTRATION_H
33

4-
#include <atomic>
54
#include <functional>
65
#include <optional>
76
#include <string>
8-
#include <type_traits>
9-
#include <utility>
107
#include <vector>
118
#include "../abi/opaque_types.h"
129
#include "autogen/Lifecycle.g.h"
@@ -36,18 +33,6 @@ std::vector<uint8_t> ConsumeBytes(BytesSource source);
3633
void SetMultiplePrimaryKeyError(const std::string& table_name);
3734
void SetConstraintRegistrationError(const std::string& code, const std::string& details);
3835

39-
template <typename F>
40-
__attribute__((noinline)) decltype(auto) __spacetimedb_begin_short_backtrace(F&& f) {
41-
if constexpr (std::is_void_v<std::invoke_result_t<F>>) {
42-
std::forward<F>(f)();
43-
std::atomic_signal_fence(std::memory_order_seq_cst);
44-
} else {
45-
decltype(auto) result = std::forward<F>(f)();
46-
std::atomic_signal_fence(std::memory_order_seq_cst);
47-
return result;
48-
}
49-
}
50-
5136
} // namespace Internal
5237
} // namespace SpacetimeDB
5338

0 commit comments

Comments
 (0)