Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
537 commits
Select commit Hold shift + click to select a range
b9fd5cd
Renamed RegistryValue to Value
Yuri6037 Apr 24, 2025
deedf0a
Added WIP named registry key system
Yuri6037 Apr 24, 2025
29966fb
Large refactor of registry system and added initial version of named …
Yuri6037 Apr 24, 2025
2af2d1b
Removed comments
Yuri6037 Apr 24, 2025
ba0d4f2
Added security to panic when a named key is already registered
Yuri6037 Apr 24, 2025
d2a85bf
Fixed HUGE crash in context tool
Yuri6037 Apr 24, 2025
76d5127
Fixed various bugs with named Key/RawKey and use new RawKey API in de…
Yuri6037 Apr 24, 2025
9bc9e83
Merge branch 'develop' of github.com:BlockProject3D/tools.lua into de…
Yuri6037 Apr 25, 2025
96a899b
Redesign and simplified named registry key system
Yuri6037 Apr 25, 2025
008ca71
Added Clone, Eq and PartialEq implementation to Key
Yuri6037 Apr 25, 2025
b2d3e44
Refactored and simplified current userdata implementation
Yuri6037 Apr 25, 2025
56bfb0c
Format Rust code using rustfmt
github-actions[bot] Apr 25, 2025
0b8f3b0
Fixed memory leak in Vm
Yuri6037 Apr 25, 2025
c7f0888
Merge remote-tracking branch 'origin/develop' into develop
Yuri6037 Apr 25, 2025
c818661
Added new GetTable and SetTable traits to greatly simplify get/set of…
Yuri6037 Apr 26, 2025
788b7a2
Removed TODO from main lib file
Yuri6037 Apr 26, 2025
3bb49f1
Gated most tools behind feature flags to allow supporting dynamic mod…
Yuri6037 Apr 26, 2025
ad49b40
Begin implement module system
Yuri6037 Apr 26, 2025
8f1edb9
Use new bp3d_debug library version
Yuri6037 May 7, 2025
3ec2771
Tweaked dependencies configuration
Yuri6037 May 8, 2025
70523cf
Begin implement decl_lua_plugin codegen macro
Yuri6037 May 9, 2025
2c2c727
Format Rust code using rustfmt
github-actions[bot] May 9, 2025
1d084cc
Fixed bug where the library may link dynamically when the static lib …
Yuri6037 May 9, 2025
ddb73be
Fixed build error due to missing feature
Yuri6037 May 9, 2025
a37f965
Added initial versions of decl_lua_plugin and decl_lua_lib macros
Yuri6037 May 10, 2025
71eeb25
Re-design plugin system to use C compatible symbols in order to simpl…
Yuri6037 May 11, 2025
942f721
Added support for generating list of dependencies
Yuri6037 May 16, 2025
2da2182
Added version of time crate to module definitions
Yuri6037 May 16, 2025
d55756c
Added new to_integer and to_number functions to any
Yuri6037 May 21, 2025
1449361
Refactor: moved Function to a new types module
Yuri6037 May 21, 2025
85a925b
Refactor: rename ffi::Integer/Number to ffi::RawInteger/RawNumber
Yuri6037 May 21, 2025
feea51f
Added Integer and Number to types
Yuri6037 May 21, 2025
069668d
Fixed build error in testbin
Yuri6037 May 21, 2025
4e3d1fe
Added @rpath to install_name
Yuri6037 May 26, 2025
f904ed7
Use a new error type for UTF8 errors needed for the module system
Yuri6037 Jun 7, 2025
e52ae04
Largely simplified module system now that the base is provided by bp3…
Yuri6037 Jun 7, 2025
6c6869e
Added initial version of module loader
Yuri6037 Jun 7, 2025
4c0e858
Fixed more bugs in userdata macros
Yuri6037 Jun 7, 2025
bba97c1
Fixed possible name conflict in time lib
Yuri6037 Jun 7, 2025
81ad340
Added module manager binding to lua
Yuri6037 Jun 7, 2025
d110e41
Added initial test for new module manager
Yuri6037 Jun 7, 2025
4702b1b
Added more debug info to build script under Linux
Yuri6037 Jun 7, 2025
e44844b
Fixed bug in build script under Linux
Yuri6037 Jun 7, 2025
2985e2d
Updated version of bp3d-lua
Yuri6037 Jun 7, 2025
a65ae11
Fixed broken test
Yuri6037 Jun 7, 2025
8721aca
Updated version for testbin
Yuri6037 Jun 7, 2025
1c4d029
Fixed build error under windows
Yuri6037 Jun 8, 2025
fcfc265
Format Rust code using rustfmt
github-actions[bot] Jun 8, 2025
ee0492c
Fixed bug in lj_disable_jit patch
Yuri6037 Jun 8, 2025
e1f0181
Added new lua_ext_ccatch_error patch
Yuri6037 Jun 8, 2025
831f972
Use new lua_ext_ccatch_error in VM interrupt system
Yuri6037 Jun 8, 2025
aae9b7a
Added support for new ERRCCATCH error type
Yuri6037 Jun 8, 2025
b03ce29
Added new JitOptions binding
Yuri6037 Jun 8, 2025
cd64787
Fixed bugs in JitOptions and added tests
Yuri6037 Jun 8, 2025
24cb89a
Updated crate version
Yuri6037 Jun 8, 2025
b41dc95
Merge branch 'develop' of github.com:BlockProject3D/tools.lua into de…
Yuri6037 Jun 8, 2025
986ef47
Fixed build error under X86/X64
Yuri6037 Jun 8, 2025
bf219b8
Fixed broken test (again)
Yuri6037 Jun 8, 2025
e1eb871
Fixed broken import under windows
Yuri6037 Jun 8, 2025
51d65cd
Added support for aarch64 windows and fixed link error under windows
Yuri6037 Jun 8, 2025
b8277c1
Format Rust code using rustfmt
github-actions[bot] Jun 8, 2025
a0ce80b
Fixed possible error in JitOptions
Yuri6037 Jun 8, 2025
3786f2d
Fixed most clippy warnings
Yuri6037 Jun 8, 2025
d264cee
Merge remote-tracking branch 'origin/develop' into develop
Yuri6037 Jun 8, 2025
ac8e522
Removed unused imports
Yuri6037 Jun 9, 2025
5b469a0
Removed unusable registry::named::Key and improved doc for set
Yuri6037 Jun 9, 2025
0f0bdcc
Added safety flag to avoid binding a lua hook if the Vm has already t…
Yuri6037 Jun 9, 2025
95936cd
Added is_uncatachable flag to vm Error
Yuri6037 Jun 9, 2025
86ba45e
Added initial version of shell IPC protocol
Yuri6037 Jun 15, 2025
bd55543
Fixed missing main message in IPC proto
Yuri6037 Jun 15, 2025
fe5f50e
Added support for running lua files
Yuri6037 Jun 15, 2025
60c2fb3
Added initial version of core shell
Yuri6037 Jun 15, 2025
6dcee11
Added support for setting rpath in built shell core binary
Yuri6037 Jun 23, 2025
59a1397
Updated bp3d-net
Yuri6037 Jun 28, 2025
1a214ca
Fixed log send
Yuri6037 Jun 30, 2025
c43e202
Added shell proto and core
Yuri6037 Jul 6, 2025
9459058
Added get_metatable to both Table and AnyUserData
Yuri6037 Jul 6, 2025
1ae736b
Added FromParam impl for bool
Yuri6037 Jul 6, 2025
303922d
Rewrite shell command/response system
Yuri6037 Jul 15, 2025
a07ef0d
Re-write lua thread binding design
Yuri6037 Jul 17, 2025
4684705
Added new LuaThread helper tool
Yuri6037 Jul 17, 2025
6157214
Fundamental re-write of IntoLua/IntoParam machanism
Yuri6037 Jul 19, 2025
e20085a
Updated cargo versions
Yuri6037 Jul 19, 2025
5c4b0c0
Re-design IntoParam to return i32 in order to support lua_yield
Yuri6037 Jul 19, 2025
d93f60a
Added support for extracting results from Thread::resume function
Yuri6037 Jul 20, 2025
08c952e
Added support for yielding values from rust
Yuri6037 Jul 21, 2025
6f1f250
Removed unneeded TODO
Yuri6037 Jul 21, 2025
f338ac4
Added initial version of scheduler
Yuri6037 Jul 22, 2025
9db3a43
Fixed possible bug with Instant userdata object
Yuri6037 Jul 23, 2025
2b60bc9
Added type definition files for base lua libs
Yuri6037 Jul 26, 2025
1ee3948
Added re-write raw pointer handling and added support for more type-s…
Yuri6037 Jul 27, 2025
7e14363
Added more lua_ext functions to support fast boolean check and named …
Yuri6037 Aug 3, 2025
69940d2
Use new lua_ext_checkboolean
Yuri6037 Aug 3, 2025
9a98452
Added support for named key registry accross modules
Yuri6037 Aug 3, 2025
f2b46ff
Added coercible boolean type
Yuri6037 Aug 3, 2025
6e1ec42
Fixed random crashes in check_register_key_unique
Yuri6037 Aug 3, 2025
a449634
Added asserts to avoid possible UB when accessing the named key registry
Yuri6037 Aug 3, 2025
2bb65bb
Added new InterruptibleRootVm in preparation of future attempt to mak…
Yuri6037 Aug 5, 2025
8fae475
Added new LuaRef type to replace hacky RawPtr/RawPtrRef combination a…
Yuri6037 Aug 5, 2025
fa56319
Added support for set function to LuaRef
Yuri6037 Aug 6, 2025
21dc4f8
Fixed more issues with named key registry
Yuri6037 Aug 6, 2025
b648b40
Added initial version of RootVm send feature
Yuri6037 Aug 6, 2025
c1b31ca
Removed now completed TODOs
Yuri6037 Aug 6, 2025
dafacaa
Updated version of bp3d-lua and updated version of mlua in performanc…
Yuri6037 Aug 6, 2025
6b954a2
Added Send requirement to userdata types if the send feature is enabl…
Yuri6037 Aug 7, 2025
4c33054
Added Send requirment when the send feature is enabled to RClosure
Yuri6037 Aug 7, 2025
42942e7
Added new UnsafeRootVm and 2 versions of RootVm: SendRootVm and UnSen…
Yuri6037 Aug 7, 2025
2071a47
Added closure Arc which is compatible with both Send RootVm and !Send…
Yuri6037 Aug 7, 2025
e6ad6c3
Updated lua base lib to use new Arc closure type rather than Rc to al…
Yuri6037 Aug 7, 2025
74a2b3c
Use UnSendRootVm in test_vm_threads to avoid use of atomics
Yuri6037 Aug 7, 2025
e2c98b6
Updated shell to new simplified Shared shortcut
Yuri6037 Aug 7, 2025
64b9c2f
Added test for destructor safety
Yuri6037 Aug 7, 2025
39602d0
Improved LuaRef registry system to work with reference types and adde…
Yuri6037 Aug 8, 2025
3119bac
Added safety checks to most complex types which cannot be easily tran…
Yuri6037 Aug 8, 2025
4ce6282
Added new set_function API to thread Value and renamed Yielded to Sus…
Yuri6037 Aug 8, 2025
17dced6
Updated shell scheduler to renamed Suspended state
Yuri6037 Aug 8, 2025
19aea39
Rename value::Value to value::Thread
Yuri6037 Aug 9, 2025
810a994
Added support to generate patch list dynamically at build-time
Yuri6037 Aug 9, 2025
053ae3e
Refactored test_vm_libs to avoid depending on crate version.
Yuri6037 Aug 9, 2025
2754609
Added initial set of safety tests
Yuri6037 Aug 9, 2025
6d27b1b
Rename AnyValue to Any
Yuri6037 Aug 9, 2025
5a4734b
Fixed possible type safety issue
Yuri6037 Aug 9, 2025
583feca
Added Unknown type to represent an unknown reference on the lua stack…
Yuri6037 Aug 9, 2025
0bf9d79
Fixed warning
Yuri6037 Aug 9, 2025
3140479
Use new Unknown type in iterator to avoid filtering types
Yuri6037 Aug 9, 2025
99822a0
Replaced Vec<u8> by Box<[u8]> for byte strings and added initial supp…
Yuri6037 Aug 10, 2025
e531678
Fixed possible soundness bug with number of arguments returned by Fro…
Yuri6037 Aug 10, 2025
59b88c4
Added support for calling arbitrary methods dynamically
Yuri6037 Aug 10, 2025
ab23972
Improved Display implementation of AnyUserData to try calling __tostr…
Yuri6037 Aug 10, 2025
e896983
Added tests for both call_method and new better Display implementation
Yuri6037 Aug 10, 2025
2d16c13
Refactored IntoLua implementation for function and userdata to new ch…
Yuri6037 Aug 10, 2025
6cad919
Fixed warnings in build.rs
Yuri6037 Aug 10, 2025
7ff5ec5
Removed util-function feature as now LuaFunction is required by AnyUs…
Yuri6037 Aug 10, 2025
8f9be5b
Large refactor: rename most value utilities
Yuri6037 Aug 10, 2025
ad8e32d
Added new check_value_top utility to avoid some duplications
Yuri6037 Aug 10, 2025
4a06d84
Implemented codegen for IntoParam in function of IntoLua to avoid cod…
Yuri6037 Aug 10, 2025
6d3c101
Added new impl_registry_value macro to generate most of the registry …
Yuri6037 Aug 10, 2025
f26f81b
Added more log information
Yuri6037 Aug 12, 2025
b90749b
Added support to add static fields and functions to userdata metatable
Yuri6037 Aug 12, 2025
4daebff
Fixed possible crash in Unknown value type
Yuri6037 Aug 12, 2025
db32689
Added new add_userdata function to Namespace
Yuri6037 Aug 12, 2025
cb145c9
Rename from_lua_unchecked to from_raw
Yuri6037 Aug 12, 2025
77f502b
Fixed new static field feature and added associated test
Yuri6037 Aug 12, 2025
08390fc
Fixed OffsetDateTime.new test and added new userdata test
Yuri6037 Aug 12, 2025
3080c18
Added more docs to avoid UB when using special return types to pass t…
Yuri6037 Aug 12, 2025
c0e6185
Added support for adding custom logic to __index metamethod on userdata
Yuri6037 Aug 12, 2025
860922d
Refactored and improved userdata static member system
Yuri6037 Aug 12, 2025
5c8e1ca
Updated type definitions for bp3d.os.time
Yuri6037 Aug 12, 2025
351d09b
Added initial version of new DebugRegistry
Yuri6037 Aug 12, 2025
fd2bf1a
Added initial version of debug library
Yuri6037 Aug 12, 2025
c3b9e23
Added type definitions for debug lib
Yuri6037 Aug 12, 2025
1bc9c9a
Fixed various bugs in Named registry key
Yuri6037 Aug 12, 2025
9c98578
Added test for new debug lib
Yuri6037 Aug 12, 2025
2824b51
Added new ImmutableTable type to avoid possible UB when mutating User…
Yuri6037 Aug 13, 2025
259b911
Added support for dumpMetaTable and dumpStaticTable to debug lib
Yuri6037 Aug 13, 2025
7812254
Updated type definitions
Yuri6037 Aug 13, 2025
8fbcc5d
Updated autocomplete shell library
Yuri6037 Aug 13, 2025
c85fb0d
Fixed possible bug in dump_static_table when no static table exists f…
Yuri6037 Aug 13, 2025
224a0ff
Added debug library to shell core
Yuri6037 Aug 13, 2025
f610df7
Added new marker trait ImmutableValue to prevent accessing mutable va…
Yuri6037 Aug 13, 2025
0e06339
Added support for new interactive mode
Yuri6037 Aug 13, 2025
bca81eb
Fixed bug with spawn_interruptible
Yuri6037 Aug 13, 2025
6076c84
Cleaned up comment
Yuri6037 Aug 14, 2025
bad1ec2
Added support for exiting the Lua shell from lua code
Yuri6037 Aug 15, 2025
cdfe558
Added new requestExit function to Lua definition file
Yuri6037 Aug 15, 2025
7364359
Added initial support to prematurely exit interactive shell applicati…
Yuri6037 Aug 16, 2025
f20d8be
Fixed safety tests with new compiler version
Yuri6037 Aug 16, 2025
dcf58c8
Fixed elided lifetimes deprecation warnings
Yuri6037 Aug 17, 2025
b5e8045
Added 1 additional userdata safety test
Yuri6037 Aug 17, 2025
88e50d8
Use new shell module of bp3d-os in bp3d-lua-shell
Yuri6037 Aug 18, 2025
669ceb1
Fixed generation bug in codegen
Yuri6037 Aug 18, 2025
c789d95
Fixed bp3d-lua bugs with named key registry across modules
Yuri6037 Aug 19, 2025
b845366
Fixed bug with userdata case rename feature
Yuri6037 Aug 19, 2025
64662bd
Fixed warnings when root-vm feature is disabled
Yuri6037 Aug 19, 2025
aa37c1d
Added support for cdata and 64 bits integers to Lua VM
Yuri6037 Aug 23, 2025
e523b59
Use 32 bits unsigned in bp3d.util.table.count
Yuri6037 Aug 23, 2025
03c87a1
Added support for 64 bits integers and usize/isize to APIs
Yuri6037 Aug 23, 2025
8e0daa5
Added initial set of tests for u64 and i64
Yuri6037 Aug 23, 2025
6e9a068
Introduced new FULL_TYPE constant on all userdata types to mitigate a…
Yuri6037 Aug 24, 2025
9d1d56d
Added unsafe to UserDataType in case of manual implementation
Yuri6037 Aug 24, 2025
75991bd
Fixed bug with debug registry and latest userdata refactor as well as…
Yuri6037 Aug 24, 2025
5dab70b
Use u32 rather than u64 for performance
Yuri6037 Aug 24, 2025
59d5966
Added support for 64 bits integers to Any type
Yuri6037 Aug 26, 2025
8daafed
Added back ImmutableType to i64 and u64
Yuri6037 Aug 27, 2025
68bf3e8
Added new Int53 and UInt53 types to bring back old behavior
Yuri6037 Aug 27, 2025
0926adc
Fixed bug in integer53
Yuri6037 Aug 27, 2025
4f8b0a9
Added support for cdata to to_integer and added new to_uinteger
Yuri6037 Aug 28, 2025
400f89e
Added new bp3d.util.num base library
Yuri6037 Aug 28, 2025
a6e3a1b
Added type definitions for new bp3d.util.num base library
Yuri6037 Aug 28, 2025
4370608
Added new tests for integer53
Yuri6037 Aug 28, 2025
968cca4
Added from_i64_lossy and from_u64_lossy
Yuri6037 Aug 29, 2025
0a26847
Added full util library
Yuri6037 Aug 30, 2025
03b9be5
Updated bp3d-os for debug support and added more security tests to us…
Yuri6037 Aug 31, 2025
aef31e8
Use new versions of bp3d-debug and bp3d-os
Yuri6037 Sep 13, 2025
4083780
Attempt at fixing build error in lua_ext patch
Yuri6037 Sep 13, 2025
efdeebc
Attempt at fixing build error in lua_ext patch v2
Yuri6037 Sep 13, 2025
6340f5a
Attempt at fixing build error in lua_ext patch v3
Yuri6037 Sep 13, 2025
fe3914a
Attempt at fixing test error for vm_test_safety
Yuri6037 Sep 14, 2025
c2b820c
Attempt at fixing build error in lua_ext patch v4
Yuri6037 Sep 14, 2025
78e67d1
Added provenance to lua_State which should mitigate test failures und…
Yuri6037 Sep 15, 2025
c7929c2
Format Rust code using rustfmt
github-actions[bot] Sep 15, 2025
e6805fa
Added initial support for post close functions
Yuri6037 Sep 15, 2025
a4b5e44
Added new utility functions to bp3d.util.num
Yuri6037 Sep 16, 2025
98958a7
Fixed bug where bp3d-lua is constantly re-built under windows
Yuri6037 Sep 16, 2025
3f834c1
Fixed output of safety test
Yuri6037 Sep 16, 2025
0bfe567
Format Rust code using rustfmt
github-actions[bot] Sep 16, 2025
0683adb
Updated to bp3d-os 2.1.0 to fix most safety issues arround modules
Yuri6037 Oct 19, 2025
618d396
Added luajit.patch
Yuri6037 Oct 19, 2025
6d317e0
Merge remote-tracking branch 'origin/develop' into develop
Yuri6037 Oct 19, 2025
ee24f9d
Format Rust code using rustfmt
github-actions[bot] Oct 19, 2025
32c22c5
Fixed possible use-after free when trying to unload modules
Yuri6037 Oct 20, 2025
f220a6d
Added support to access the path instead of only the full path
Yuri6037 Oct 22, 2025
c288855
Fixed bug in definitions
Yuri6037 Oct 28, 2025
f6d7e5a
Fixed bug in FromParam derive
Yuri6037 Oct 29, 2025
7810f99
Added table.unpack as a shortcut to the deprecated unpack method
Yuri6037 Oct 29, 2025
eb376ad
Fixed generation bug in FromParam
Yuri6037 Oct 30, 2025
58a0c22
Fixed deadlock in require
Yuri6037 Oct 30, 2025
1f20c4b
Fixed big bug where lua stack is not cleaned if a scope fails
Yuri6037 Oct 31, 2025
d1b7010
Fixed safety issue with registry LuaRef
Yuri6037 Nov 2, 2025
dab3955
Added support for lifetimes to userdata_func macros
Yuri6037 Nov 2, 2025
8df1595
Added initial version of files library
Yuri6037 Nov 4, 2025
0ae15de
Use new chroot and access system in loadFile/runFile functions
Yuri6037 Nov 4, 2025
8fbe441
Updated definitions for bp3d.lua and added new bp3d.files definitions
Yuri6037 Nov 4, 2025
6aab4f0
Added missing functions to SandboxPathBuf
Yuri6037 Nov 4, 2025
69f77fd
Moved chroot escape check to its function
Yuri6037 Nov 4, 2025
38bded5
Fixed symlink function in bp3d.files lib
Yuri6037 Nov 4, 2025
5187109
Fixed sandbox security for symlink
Yuri6037 Nov 5, 2025
028bc9d
Added fix to reject files over 5Mb
Yuri6037 Nov 5, 2025
7e95312
Rename obj to path
Yuri6037 Nov 5, 2025
9ce52e5
Added new access function and File object
Yuri6037 Nov 5, 2025
ff6e96c
Added definitions for new File type
Yuri6037 Nov 6, 2025
0af03fd
Fixed sandbox function parsing error under windows
Yuri6037 Nov 12, 2025
05f6e0c
Updated to new version of bp3d-os and bp3d-debug
Yuri6037 Nov 12, 2025
cf8bb5e
Fixed build error under windows
Yuri6037 Nov 12, 2025
2780d29
Format Rust code using rustfmt
github-actions[bot] Nov 12, 2025
6e15941
Added startsWith and endsWith to bp3d.util.string
Yuri6037 Dec 22, 2025
7092a79
Fixed possible safety issue with context system
Yuri6037 Dec 27, 2025
fb91e4e
Updated error messages
Yuri6037 Dec 27, 2025
5240ee5
Added function to access raw pointer from AnyUserData
Yuri6037 Dec 27, 2025
ce8afcb
Replace check_push_value by check_value_top to avoid duplicating valu…
Yuri6037 Dec 27, 2025
247da73
Added implementation of Upvalue for AnyUserData
Yuri6037 Dec 27, 2025
c5e1a25
Added implementation of FromParam for ()
Yuri6037 Dec 27, 2025
0a382bf
Added initial version of new from_rust_temporary closure system
Yuri6037 Dec 27, 2025
cdd5748
Fixed safety issue in context system
Yuri6037 Dec 30, 2025
c4c0ae8
Fixed safety issues with mutable userdata types
Yuri6037 Dec 30, 2025
54143f2
Fixed unusable RClosure API
Yuri6037 Dec 30, 2025
65cbe50
Format Rust code using rustfmt
github-actions[bot] Dec 30, 2025
005c0f7
Added support for __eq to PathWrapper
Yuri6037 Jan 2, 2026
43ac23e
Added rename and delete functions to files lib
Yuri6037 Jan 2, 2026
1b934b4
Added lua_loadx binding
Yuri6037 Jan 25, 2026
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
153 changes: 19 additions & 134 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,137 +5,22 @@ on:
- workflow_dispatch

jobs:
test-build:
name: Build & Test
strategy:
matrix:
os:
- ubuntu-20.04
- macos-11
- windows-2019
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --all-features
- name: Test
uses: bp3d-actions/cargo@main
with:
check-name: cargo test (${{ matrix.os }})
command: test
args: --all-features --no-fail-fast
token: ${{ secrets.GITHUB_TOKEN }}

clippy:
name: Check | Clippy
if: ${{ always() }}
needs: test-build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run check
uses: bp3d-actions/clippy-check@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

audit:
name: Check | Audit
if: ${{ always() }}
needs: test-build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Audit Tool
run: cargo install cargo-audit
- name: Run check
uses: bp3d-actions/audit-check@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

fmt:
name: Format Code
if: ${{ always() && github.ref != 'refs/heads/master' }}
needs:
- clippy
- audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run code formatter
uses: bp3d-actions/rustfmt-check@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

version:
name: Get Version
needs: test-build
runs-on: ubuntu-latest
outputs:
name: ${{ steps.version.outputs.name }}
version: ${{ steps.version.outputs.version }}
isnew: ${{ steps.version.outputs.isnew }}
ispre: ${{ steps.version.outputs.ispre }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Version
id: version
uses: bp3d-actions/cargo-version@main
with:
mode: get
token: ${{ secrets.GITHUB_TOKEN }}

create-pre-release:
name: Create Pre Release
needs: version
if: github.ref == 'refs/heads/develop' && needs.version.outputs.isnew == 'true' && needs.version.outputs.ispre == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup cargo
run: cargo login ${{ secrets.RELEASE_TOKEN }}
- name: Publish
run: cargo publish
- name: Create
uses: ncipollo/release-action@main
with:
tag: ${{ needs.version.outputs.version }}
commit: ${{ github.ref }}
prerelease: true
name: ${{ needs.version.outputs.name }} release ${{ needs.version.outputs.version }}
body: "[Link to crates.io](https://crates.io/crates/${{ needs.version.outputs.name }})"

create-release-pr:
name: Create Release Pull Request
needs: version
if: needs.version.outputs.isnew == 'true' && needs.version.outputs.ispre == 'false'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Pull Request
uses: repo-sync/pull-request@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_branch: master
pr_title: Release ${{ needs.version.outputs.version }}
Test:
uses: BlockProject3D/workflows/.github/workflows/Build_Test.yml@main
with:
rust_components: rust-src

Analyze:
uses: BlockProject3D/workflows/.github/workflows/Analyze.yml@main
needs: Test

Coverage:
uses: BlockProject3D/workflows/.github/workflows/Coverage.yml@main
with:
rust_components: rust-src

Release:
uses: BlockProject3D/workflows/.github/workflows/Release.yml@main
needs: Test
secrets:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
44 changes: 4 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,7 @@ on:
- master

jobs:
version:
name: Get Version
runs-on: ubuntu-latest
outputs:
name: ${{ steps.version.outputs.name }}
version: ${{ steps.version.outputs.version }}
isnew: ${{ steps.version.outputs.isnew }}
ispre: ${{ steps.version.outputs.ispre }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Version
id: version
uses: bp3d-actions/cargo-version@main
with:
mode: get
token: ${{ secrets.GITHUB_TOKEN }}

create-release:
name: Release
needs: version
if: needs.version.outputs.isnew == 'true' && needs.version.outputs.ispre == 'false'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup cargo
run: cargo login ${{ secrets.RELEASE_TOKEN }}
- name: Publish
run: cargo publish
- name: Create
uses: ncipollo/release-action@main
with:
tag: ${{ needs.version.outputs.version }}
commit: ${{ github.ref }}
prerelease: false
name: ${{ needs.version.outputs.name }} release ${{ needs.version.outputs.version }}
body: "[Link to crates.io](https://crates.io/crates/${{ needs.version.outputs.name }})"
Publish:
uses: BlockProject3D/workflows/.github/workflows/Publish.yml@main
secrets:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "LuaJIT"]
path = LuaJIT
url = https://github.com/LuaJIT/LuaJIT.git
26 changes: 8 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
[package]
name = "test"
version = "0.1.0"
authors = ["Yuri Edward <yuri6037@outlook.com>"]
edition = "2018"
description = ""
license = "BSD-3-Clause"
repository = "https://gitlab.com/bp3d/test"
readme = "./README.MD"
keywords = []
categories = []

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

[features]

[workspace]

Check failure on line 1 in Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo test (ubuntu-22.04)

Cargo.toml#L1

Test failed
members = [
"build",
"codegen",
"core",
"shell/core",
"shell/proto"
]
1 change: 1 addition & 0 deletions LuaJIT
Submodule LuaJIT added at eec7a8
10 changes: 10 additions & 0 deletions build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "bp3d-lua-build"
version = "1.0.0-rc.1.0.0"
edition = "2024"
publish = false

[dependencies]
bp3d-os = { version = "2.2.3", features = ["fs"] }
phf = { version = "0.11.3", features = ["macros"] }
cc = "1.2.15"
49 changes: 49 additions & 0 deletions build/src/build/interface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) 2025, BlockProject 3D
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of BlockProject 3D nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use crate::BuildInfo;
use crate::util::CommandRunner;
use std::path::PathBuf;

pub struct Lib {
pub name: String,
pub path: PathBuf,
pub dynamic: bool,
}

pub trait Build {
fn build(info: &BuildInfo, runner: &CommandRunner) -> std::io::Result<()>;
fn post_build(info: &BuildInfo, runner: &CommandRunner) -> std::io::Result<()>;
fn get_linked_lib(info: &BuildInfo) -> Lib;

fn run(info: &BuildInfo) -> std::io::Result<Lib> {
Self::build(info, &CommandRunner::new("failed to build LuaJIT"))?;
Self::post_build(info, &CommandRunner::new("failed to post-build LuaJIT"))?;
Ok(Self::get_linked_lib(info))
}
}
74 changes: 74 additions & 0 deletions build/src/build/linux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright (c) 2025, BlockProject 3D
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of BlockProject 3D nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use crate::BuildInfo;
use crate::build::Build;
use crate::build::interface::Lib;
use crate::util::CommandRunner;
use std::process::Command;

pub struct Linux;

impl Build for Linux {
fn build(info: &BuildInfo, runner: &CommandRunner) -> std::io::Result<()> {
let soname = format!("TARGET_SONAME=libbp3d-luajit-{}.so", info.version());
runner.run(
Command::new("make")
.arg(soname)
.current_dir(info.build_dir()),
)
}

fn post_build(info: &BuildInfo, _: &CommandRunner) -> std::io::Result<()> {
let filename = format!("libbp3d-luajit-{}.so", info.version());
let path_to_so = info.build_dir().join("src").join("libluajit.so");
let path_to_dylib = info.build_dir().join(&filename);
std::fs::copy(&path_to_so, path_to_dylib)?;
let path_to_dylib2 = info.target_dir().join(filename);
std::fs::copy(&path_to_so, path_to_dylib2)?;
std::fs::remove_file(path_to_so)?;
Ok(())
}

fn get_linked_lib(info: &BuildInfo) -> Lib {
if info.dynamic() {
let name = format!("bp3d-luajit-{}", info.version());
Lib {
name,
path: info.build_dir().into(),
dynamic: true,
}
} else {
Lib {
name: "luajit".into(),
path: info.build_dir().join("src"),
dynamic: false,
}
}
}
}
Loading
Loading