clockworklabs / clockworklabs/SpacetimeDB

Add spacetime test command

Open
#2,788 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Add the "test" command to the spacetime cli.

This will perform a similar functionality to "cargo test" but actually work.

Right now "cargo test" throws the following error: fatal error LNK1120: 14 unresolved externals

$ cargo test
   Compiling spacetime-module v0.1.0 (F:\GitHub\godot_projects\void-online\rust-server)
error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\krazy\\AppData\\Local\\Temp\\rustc7Fd6v1\\symbols.o" "<97 object files omitted>" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libtest-*,libgetopts-*,libunicode_width-*,librustc_std_workspace_std-*}.rlib" "F:\\GitHub\\godot_projects\\void-online\\rust-server\\target\\debug\\deps/{libglam-3538ff5b82038ad1.rlib,libspacetimedb-49c1e83d2e8ee148.rlib,libspacetimedb_bindings_sys-cf59fd0a43b82965.rlib,librand-c46f6070f62b8020.rlib,librand_chacha-89e611242b96e3aa.rlib,libppv_lite86-0dff4c0751d26dcf.rlib,librand_core-42f34039d6fc91c5.rlib,libgetrandom-cb57b37f129936ef.rlib,liblog-17408f5d9644b296.rlib,libspacetimedb_lib-c0e8d1c842a87799.rlib,libblake3-cf32899386ee5c93.rlib,libconstant_time_eq-e39a0c3eb4af0819.rlib,libarrayref-77a3d0679392128e.rlib,libspacetimedb_data_structures-d14000a3f717d0c8.rlib,libahash-a52103bd8ef066fc.rlib,libonce_cell-42eb3a05926beb91.rlib,libcfg_if-885ced7a34e6dac7.rlib,libzerocopy-d472eddbe14685b6.rlib,libhashbrown-b7597ad76ab97931.rlib,libfoldhash-79743f2d134e806d.rlib,libequivalent-c413381703bf56a9.rlib,liballocator_api2-6f68ad76f7512859.rlib,libspacetimedb_sats-21cb458089590d3f.rlib,libhex-79f4f762133271c1.rlib,libarrayvec-8f54636ecafebae2.rlib,libbytes-d18dcb52e317328a.rlib,libdecorum-0c05f9356f88bd5a.rlib,libapprox-acc31f69f12364e5.rlib,libthiserror-d6147bfb1eee2c27.rlib,libchrono-500d154af15e3a63.rlib,libnum_traits-3d5e2650982b2ed6.rlib,libsha3-415435dcd8915fbb.rlib,libkeccak-abf8aac9581643b0.rlib,libdigest-6f293216641a3612.rlib,libblock_buffer-01141a6f923fae44.rlib,libcrypto_common-72995388cfb40927.rlib,libgeneric_array-cc837247b98c854c.rlib,libtypenum-31997a7b4497383a.rlib,libspacetimedb_primitives-8a5339f31a42608c.rlib,libnohash_hasher-6ac15dbbaffe32da.rlib,libbitflags-c32e2495da88f8bb.rlib,libitertools-726772eb4200847d.rlib,libeither-730681c13ca9a2fd.rlib,libsmallvec-89fd974fa262f55f.rlib,libbytemuck-da3f7e8091f431ec.rlib,libethnum-2d17927af1190e14.rlib,libserde-58654e8959d18b75.rlib,libsecond_stack-282b09b5bfbe9e82.rlib,libanyhow-7d7dd0ce4993f3cf.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "kernel32.lib" "bcrypt.lib" "advapi32.lib" "kernel32.lib" "kernel32.lib" "advapi32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\atlmfc\\lib\\x64" "/LIBPATH:F:\\GitHub\\godot_projects\\void-online\\rust-server\\target\\debug\\build\\blake3-c7dfffefa57a2ed2\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\atlmfc\\lib\\x64" "/LIBPATH:F:\\GitHub\\godot_projects\\void-online\\rust-server\\target\\debug\\build\\blake3-c7dfffefa57a2ed2\\out" "/OUT:F:\\GitHub\\godot_projects\\void-online\\rust-server\\target\\debug\\deps\\spacetime_module-7c4833ec4b075e44.exe" "/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libstd.natvis"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: spacetime_module-7c4833ec4b075e44.1f3kv3sn2hxxp31uqg0tee55f.rcgu.o : error LNK2019: unresolved external symbol datastore_insert_bsatn referenced in function _ZN24spacetimedb_bindings_sys22datastore_insert_bsatn17hc6c097cf9217ef8dE␍
          spacetime_module-7c4833ec4b075e44.2mxlqeqbkn895rlasqq7ji2m9.rcgu.o : error LNK2019: unresolved external symbol index_id_from_name referenced in function _ZN24spacetimedb_bindings_sys18index_id_from_name28_$u7b$$u7b$closure$u7d$$u7d$17hf5ff08f9fd8a613cE␍  
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol console_timer_start referenced in function _ZN11spacetimedb13log_stopwatch12LogStopwatch3new17ha5296c7fce11f29fE␍
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol console_timer_end referenced in function _ZN82_$LT$spacetimedb..log_stopwatch..LogStopwatch$u20$as$u20$core..ops..drop..Drop$GT$4drop17h25526596c6a7a83cE␍
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol bytes_source_read referenced in function _ZN11spacetimedb2rt22read_bytes_source_into17h1b61209919aebdc5E␍
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol bytes_sink_write referenced in function _ZN11spacetimedb2rt13write_to_sink17hb0bcd6159fca7a17E␍       
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol console_log referenced in function _ZN24spacetimedb_bindings_sys11console_log17h908a1959b6283040E␍    
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol table_id_from_name referenced in function _ZN24spacetimedb_bindings_sys18table_id_from_name28_$u7b$$u7b$closure$u7d$$u7d$17h902f1dfb0b3a0458E␍
          libspacetimedb-49c1e83d2e8ee148.rlib(spacetimedb-49c1e83d2e8ee148.spacetimedb.af6d99a19a87bfa1-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol identity referenced in function _ZN24spacetimedb_bindings_sys8identity17h20e3bdfe9c5614e2E␍
          libspacetimedb_bindings_sys-cf59fd0a43b82965.rlib(spacetimedb_bindings_sys-cf59fd0a43b82965.spacetimedb_bindings_sys.cf4bb3cde0c4bc14-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol datastore_table_scan_bsatn referenced in function _ZN24spacetimedb_bindings_sys26datastore_table_scan_bsatn28_$u7b$$u7b$closure$u7d$$u7d$17h4be95b5a6b832cf7E␍
          libspacetimedb_bindings_sys-cf59fd0a43b82965.rlib(spacetimedb_bindings_sys-cf59fd0a43b82965.spacetimedb_bindings_sys.cf4bb3cde0c4bc14-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol datastore_index_scan_range_bsatn referenced in function _ZN24spacetimedb_bindings_sys32datastore_index_scan_range_bsatn28_$u7b$$u7b$closure$u7d$$u7d$17h1d9e411c3bb9ee86E␍
          libspacetimedb_bindings_sys-cf59fd0a43b82965.rlib(spacetimedb_bindings_sys-cf59fd0a43b82965.spacetimedb_bindings_sys.cf4bb3cde0c4bc14-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol datastore_delete_by_index_scan_range_bsatn referenced in function _ZN24spacetimedb_bindings_sys42datastore_delete_by_index_scan_range_bsatn28_$u7b$$u7b$closure$u7d$$u7d$17h964a4b172a787a08E␍
          libspacetimedb_bindings_sys-cf59fd0a43b82965.rlib(spacetimedb_bindings_sys-cf59fd0a43b82965.spacetimedb_bindings_sys.cf4bb3cde0c4bc14-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol row_iter_bsatn_advance referenced in function _ZN24spacetimedb_bindings_sys7RowIter4read17hbed088c544d4360cE␍
          libspacetimedb_bindings_sys-cf59fd0a43b82965.rlib(spacetimedb_bindings_sys-cf59fd0a43b82965.spacetimedb_bindings_sys.cf4bb3cde0c4bc14-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol row_iter_bsatn_close referenced in function _ZN75_$LT$spacetimedb_bindings_sys..RowIter$u20$as$u20$core..ops..drop..Drop$GT$4drop17h124c0641af331586E␍
          F:\GitHub\godot_projects\void-online\rust-server\target\debug\deps\spacetime_module-7c4833ec4b075e44.exe : fatal error LNK1120: 14 unresolved externals␍


error: could not compile `spacetime-module` (lib test) due to 1 previous error

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Spacetime CLI command entry points and reviewing how existing commands invoke module operations. Reproduce the reported cargo test failure for spacetime-module, then define the test command's expected behavior and verify it can run module tests without the unresolved linker errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.