Skip to content

Release 0.1.0 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 351 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
351 commits
Select commit Hold shift + click to select a range
ab18253
Added support for LuaDrop to userdata Registry
Yuri6037 Mar 17, 2025
1c6dd06
Added better docs to FromParam and FromLua traits
Yuri6037 Mar 17, 2025
460b3ce
Added support for AnyUserData
Yuri6037 Mar 17, 2025
65f1501
Removed unnecessary path prefix
Yuri6037 Mar 17, 2025
be2cd94
Removed some code duplications
Yuri6037 Mar 17, 2025
8416e6f
Removed AnyStr implementation for CString and String as these were un…
Yuri6037 Mar 17, 2025
e5279c6
Fixed possible safety bug with malicious IntoParam trait implementati…
Yuri6037 Mar 20, 2025
79b38a2
Fixed possible safety bug with malicious IntoLua trait implementations.
Yuri6037 Mar 20, 2025
8158d40
Added initial version of codegen tool to generate FromParam and LuaType
Yuri6037 Mar 21, 2025
88fc953
Added test for codegen
Yuri6037 Mar 21, 2025
36d45d6
Added try_from_param function
Yuri6037 Mar 22, 2025
91c0102
Added initial untested version of FromParam derive for enums
Yuri6037 Mar 22, 2025
230f792
Added support for lifetimes to macros
Yuri6037 Mar 23, 2025
b023298
Added lifetime test to custom_from_param
Yuri6037 Mar 23, 2025
3cd56f3
Added support for IntoParam derive macro
Yuri6037 Mar 23, 2025
78b8976
Removed now unneeded impl_from_param macro
Yuri6037 Mar 23, 2025
979b4f4
Added support for different FromUpvalue and IntoUpvalue types
Yuri6037 Mar 26, 2025
a70151e
Added new RawRegistryKey type which is much more unsafe but is much c…
Yuri6037 Mar 26, 2025
1e9581d
Added initial version of context system with macro test (still no run…
Yuri6037 Mar 26, 2025
c063816
Added replace function to RawRegistryKey
Yuri6037 Mar 27, 2025
6cea701
Fixed build error in decl_from_param macro
Yuri6037 Mar 27, 2025
4c2a373
Finished initial version of context system
Yuri6037 Mar 27, 2025
40fd4f3
Added initial context test
Yuri6037 Mar 27, 2025
5c0e907
Improved context test
Yuri6037 Mar 27, 2025
199f6a6
Improved closure API
Yuri6037 Mar 28, 2025
2899b40
Added performance test comparison with mlua for context based functions
Yuri6037 Mar 28, 2025
61ea358
Added initial support for lua threads
Yuri6037 Mar 29, 2025
9e19e91
Added Thread to AnyValue
Yuri6037 Mar 29, 2025
5110729
Fixed usability issue in LuaFunction
Yuri6037 Mar 29, 2025
7128c26
Added a more reasonable test using function calls rather than run_code
Yuri6037 Mar 29, 2025
ac5037e
Use real-time based Instant from bp3d-os to avoid biased clock_gettime
Yuri6037 Mar 29, 2025
6879388
Updated bp3d-os to fix bug with real-time Instant
Yuri6037 Mar 29, 2025
8e1d79f
Added support to run named lua code
Yuri6037 Mar 29, 2025
f4c1751
Added lua_load_no_bc patch
Yuri6037 Mar 30, 2025
5bcdc73
Large refactoring of the core module
Yuri6037 Mar 30, 2025
db05914
Tweaked more inline attributes to gain reduce slightly running time
Yuri6037 Mar 30, 2025
da682b8
Added backtrace test
Yuri6037 Mar 31, 2025
ef58f9f
Renamed traceback to backtrace
Yuri6037 Mar 31, 2025
31d1d48
Added run function with associated test
Yuri6037 Mar 31, 2025
2cbec6e
Added load_custom function with associated test and refactored core m…
Yuri6037 Mar 31, 2025
fd6f6d1
Added new Script load component to run actual script files
Yuri6037 Mar 31, 2025
1ac2f39
Added more tests for userdata
Yuri6037 Apr 1, 2025
9bfc539
Refactored table abstraction to no longer require a scope. The scope …
Yuri6037 Apr 2, 2025
7f3559a
Removed comments from main table module
Yuri6037 Apr 2, 2025
a3f7f66
Added *const T to ensure registry/context types are not Send and not …
Yuri6037 Apr 2, 2025
6bcfc91
Added HAS_VM flag to ensure registry keys and contexts are safe
Yuri6037 Apr 2, 2025
96273a9
Added support for replacing registry values
Yuri6037 Apr 2, 2025
ed9ae48
Added support for FromLua to Option
Yuri6037 Apr 2, 2025
dcc9d12
Fixed stack not cleaned when reading a None value from the top of the…
Yuri6037 Apr 2, 2025
03ea1dc
Added new Namespace tool and first test in test_vm_closures
Yuri6037 Apr 2, 2025
068ff5b
Added class test
Yuri6037 Apr 4, 2025
3c3ed5a
Fixed possible bug with userdata and use bp3d-debug for logs
Yuri6037 Apr 4, 2025
c6cbaf0
Added support for AnyReturn, which allows to transfer all results
Yuri6037 Apr 4, 2025
251a88c
Added UncheckedAnyReturn to return any number of lua results
Yuri6037 Apr 5, 2025
af8b27b
Added load_code and load functions to Vm
Yuri6037 Apr 5, 2025
8fe025d
Fixed bug in macros
Yuri6037 Apr 5, 2025
d56e437
Added support for tuples to IntoParam and removed IntoLua implementat…
Yuri6037 Apr 5, 2025
3424df3
Added support for FromParam and IntoParam to LuaFunction
Yuri6037 Apr 5, 2025
2199907
Added initial version of bp3d.lua library with associated test
Yuri6037 Apr 5, 2025
98b5297
Fixed mutable variable warning when only one argument is needed
Yuri6037 Apr 6, 2025
09a7133
Renamed dostring to runString and loadstring to loadString
Yuri6037 Apr 6, 2025
47150f4
Added test for runString
Yuri6037 Apr 6, 2025
37ef918
Updated version
Yuri6037 Apr 6, 2025
9d0265b
Fixed test
Yuri6037 Apr 6, 2025
9992764
Renamed RootVm::leak to RootVm::attach_box
Yuri6037 Apr 6, 2025
5933736
Fixed build errors in decl_closure
Yuri6037 Apr 6, 2025
00e4a44
Added support for &Path and &OsStr to closures
Yuri6037 Apr 6, 2025
a23171f
Added support for new Raw trait to attach any type with destructor to…
Yuri6037 Apr 7, 2025
9ee712d
Added support to plug Rc into closures
Yuri6037 Apr 7, 2025
4683811
Fixed leakage in Namespace tool
Yuri6037 Apr 7, 2025
ef3f377
Added initial support for require function
Yuri6037 Apr 7, 2025
2070803
Greatly simplified run_string and load_string
Yuri6037 Apr 7, 2025
10cf452
Updated tests
Yuri6037 Apr 7, 2025
3128016
Added bp3d.lua.pcall function which supports backtrace information
Yuri6037 Apr 7, 2025
1ff37a0
Added support for loadFile and runFile behind a chroot
Yuri6037 Apr 7, 2025
1d8e020
Tweaked inline and memory representations for performance
Yuri6037 Apr 7, 2025
5069318
Added check to avoid breaking lua stack if into_lua returns 0.
Yuri6037 Apr 8, 2025
b8eefcd
Fixed bug in table iterator
Yuri6037 Apr 8, 2025
49e0730
Added support for IntoLua and ty to AnyValue
Yuri6037 Apr 8, 2025
fa60cd1
Moved load related functions to sub-namespace load
Yuri6037 Apr 8, 2025
6d5e22c
Added support for Debug and Display implementations to AnyValue
Yuri6037 Apr 8, 2025
4089094
Removed unused import
Yuri6037 Apr 8, 2025
261429a
Added mini table toolkit
Yuri6037 Apr 8, 2025
c647f33
Refactored table utility into its own lib
Yuri6037 Apr 8, 2025
087a9e0
Added support for Eq, PartialEq, FromParam and IntoParam to AnyValue
Yuri6037 Apr 8, 2025
b11ed98
Added bp3d.util.table.contains and containsKey
Yuri6037 Apr 8, 2025
9395af5
Added bp3d.util.string.contains and split
Yuri6037 Apr 8, 2025
ea346f3
Added check to avoid iterating over moved values
Yuri6037 Apr 9, 2025
c674c40
Added initial version of utf8 lib
Yuri6037 Apr 9, 2025
4f05071
Renamed module macros to macro
Yuri6037 Apr 9, 2025
fb61097
Added new Lib trait for future thread system
Yuri6037 Apr 10, 2025
6884a3c
Added additional security test
Yuri6037 Apr 10, 2025
ad93556
Refactored lib system to include support for tuples and multi-libs
Yuri6037 Apr 12, 2025
0dec072
Refactored util lib to new Lib system
Yuri6037 Apr 12, 2025
f78705b
Fixed build warning when function requires no arguments
Yuri6037 Apr 12, 2025
1156f4c
Added support to set the metatable of a Lua table
Yuri6037 Apr 12, 2025
c821b41
Added bp3d.util.table.protect
Yuri6037 Apr 12, 2025
6849dd5
Added support for IntoParam to OsString
Yuri6037 Apr 12, 2025
379afb0
Added initial version of base os lib
Yuri6037 Apr 12, 2025
c1539b0
Fixed build bug with userdata macro
Yuri6037 Apr 13, 2025
a8da030
Added initial support for bp3d.os.time lib
Yuri6037 Apr 13, 2025
9fd49d6
Moved base os lib (lua compatibility) to os lib
Yuri6037 Apr 13, 2025
97b4908
Renamed base to compat to mean a compatibility module for standard lua
Yuri6037 Apr 13, 2025
7aed83a
Added initial version of instant lib
Yuri6037 Apr 13, 2025
3a337c2
Added small test for time and instant
Yuri6037 Apr 13, 2025
e20dd90
Added small test for os base lib
Yuri6037 Apr 13, 2025
17d9c89
Added support for IntoParam on Cow
Yuri6037 Apr 14, 2025
7de2751
Using new Cow implementation in bp3d.util.utf8
Yuri6037 Apr 14, 2025
0a2526f
Replaced OsString implementation by Vec<u8>
Yuri6037 Apr 14, 2025
c431b19
Fixed warning
Yuri6037 Apr 14, 2025
a8f6ab1
Added support for case convertions to userdata registration
Yuri6037 Apr 14, 2025
7249e92
Added mappings for capitalise/decapitalise and sub functions
Yuri6037 Apr 14, 2025
faa4e0d
Added small test for utf8.sub
Yuri6037 Apr 14, 2025
1af18e9
Added support for cloning lua values
Yuri6037 Apr 15, 2025
3516837
Renamed set/get to seti/geti
Yuri6037 Apr 15, 2025
4f0b81d
Added support for get/set functions on table with any key type and an…
Yuri6037 Apr 15, 2025
2fa9ba9
Added support to append at the end of a lua table
Yuri6037 Apr 15, 2025
bb66246
Added new iter module to core module to support iterating the lua stack
Yuri6037 Apr 15, 2025
c9aeb9e
Added a few more utilities to bp3d.util.table
Yuri6037 Apr 15, 2025
b2c3a5e
Added support for lua_sethook to FFI
Yuri6037 Apr 16, 2025
5a02aae
Added initial design for Vm interruption system
Yuri6037 Apr 16, 2025
d239213
Added spawn_interruptible function to simplify passing Signal out of …
Yuri6037 Apr 16, 2025
51488e4
Added better error handling to vm interrupt system and added test
Yuri6037 Apr 16, 2025
1c55329
Fixed bug in os compat lib and added additional test
Yuri6037 Apr 19, 2025
f007e8d
Added initial support for dynamic linking against luajit
Yuri6037 Apr 19, 2025
42aba34
Updated LuaJIT submodule
Yuri6037 Apr 19, 2025
4aad98c
Updated workflows
Yuri6037 Apr 19, 2025
27d6a89
Fixed vm interrupt under Linux
Yuri6037 Apr 19, 2025
03ab2fa
Fixed crash in lua_interrupt
Yuri6037 Apr 19, 2025
fcef6ee
Fixed dynamic linking under linux
Yuri6037 Apr 19, 2025
d483891
Added new build support crate and refactored build script to use new …
Yuri6037 Apr 19, 2025
431eace
Added new windows_set_lib_names patch
Yuri6037 Apr 19, 2025
91ba983
Fixed bug in util
Yuri6037 Apr 19, 2025
c904093
Renamed base to compat
Yuri6037 Apr 19, 2025
876a445
Merge branch 'rewrite' of github.com:BlockProject3D/tools.lua into re…
Yuri6037 Apr 19, 2025
22a649d
Added fix for test_vm_lib_os_time under CI
Yuri6037 Apr 19, 2025
87f8d33
Added fix for test_vm_lib_os under CI
Yuri6037 Apr 19, 2025
447c89d
Attempt at fixing interrupt test under CI
Yuri6037 Apr 19, 2025
bf778d8
Added more logs to figure out what went wrong in VM interrupt test
Yuri6037 Apr 20, 2025
f65a404
Fixed bug with interrupt system sometimes not calling the hook
Yuri6037 Apr 20, 2025
4df15b5
Fixed linker error on mac and linux
Yuri6037 Apr 20, 2025
7f96e12
Refactored and simplified build process
Yuri6037 Apr 20, 2025
1cda0a4
Refactored and simplified patch system
Yuri6037 Apr 20, 2025
7629cbf
Removed bp3d-os dep from build deps
Yuri6037 Apr 20, 2025
8b9b84e
Added comment to test
Yuri6037 Apr 20, 2025
7662d45
Added initial version of context v2
Yuri6037 Apr 20, 2025
ce837a2
Added new context_opt2 benchmark
Yuri6037 Apr 20, 2025
9bddaab
Improved API for context v2
Yuri6037 Apr 20, 2025
ed0b74b
Replaced context v1 by context v2 which seems about 2 ms faster
Yuri6037 Apr 21, 2025
ceeb6c9
Replaced RootVm attach by destructor pool
Yuri6037 Apr 21, 2025
e91edff
Use Vm instead of RootVm in libs
Yuri6037 Apr 21, 2025
fe677e5
Added support to attach elements to the destructor pool immutably
Yuri6037 Apr 21, 2025
6e43cc9
Fixed luajit build errors under windows
Yuri6037 Apr 21, 2025
fcb1296
Added initial support for Vm interrupt
Yuri6037 Apr 21, 2025
daace74
Format Rust code using rustfmt
github-actions[bot] Apr 21, 2025
7339cf9
Fixed most clippy warnnings
Yuri6037 Apr 22, 2025
4ee216c
Removed SIGNATURE to avoid clippy warning
Yuri6037 Apr 22, 2025
e2943cf
Added Safety section to Vm::from_raw
Yuri6037 Apr 22, 2025
9f30a77
Use Option<Hook> instead of Hook to remove the need for one transmute
Yuri6037 Apr 22, 2025
7e337b2
Fixed build error under windows
Yuri6037 Apr 22, 2025
daa168a
Increased buffer time in instant test to avoid failure in CI builds
Yuri6037 Apr 22, 2025
5b7bca9
Do not publish any crates for now
Yuri6037 Apr 22, 2025
35458d2
Removed unused Hook type under windows
Yuri6037 Apr 22, 2025
2c1f499
Format Rust code using rustfmt
github-actions[bot] Apr 22, 2025
6201e1f
Merge remote-tracking branch 'origin/develop' into develop
Yuri6037 Apr 22, 2025
98faa8a
Format Rust code using rustfmt
github-actions[bot] Apr 22, 2025
bdd3464
Attempt at fixing clippy warning
Yuri6037 Apr 22, 2025
c540b14
Fixed clippy warning
Yuri6037 Apr 22, 2025
a315071
Fixed most clippy warnings in testbin
Yuri6037 Apr 22, 2025
d5876b8
Moved testbin out of the workspace due to link issues under Linux
Yuri6037 Apr 23, 2025
6636068
Merge branch 'develop' of github.com:BlockProject3D/tools.lua into de…
Yuri6037 Apr 23, 2025
76c2cba
Added aarch64 macos to testbin and fixed build error under windows
Yuri6037 Apr 23, 2025
1fc816d
Added yet another stupid undocumented feature to windows-sys
Yuri6037 Apr 23, 2025
e09783c
Renamed LuaFunction to Function
Yuri6037 Apr 23, 2025
1a47299
Refactor: rename util to util::core
Yuri6037 Apr 23, 2025
e944cdc
Refactor: moved vm::namespace::Namespace to util::Namespace
Yuri6037 Apr 23, 2025
482385e
Added new LuaFunction utility in replacement of specialized impl on R…
Yuri6037 Apr 23, 2025
91640ce
Added export of LuaFunction
Yuri6037 Apr 23, 2025
8d2b836
Renamed value::function::Function to value::Function
Yuri6037 Apr 23, 2025
f7dece0
Fixed build error in context_opt
Yuri6037 Apr 23, 2025
ad6c7e6
Added LuaMethod in replacement for member functions on Table
Yuri6037 Apr 23, 2025
6cca251
Removed TODO comments
Yuri6037 Apr 23, 2025
cbe66da
Updated doc comment
Yuri6037 Apr 23, 2025
43e9106
Renamed decl_from_param decl_from_param_unchecked as this macro is un…
Yuri6037 Apr 24, 2025
f74688d
Format Rust code using rustfmt
github-actions[bot] Apr 24, 2025
e8ae8b6
Renamed RegistryKey to Key and RawRegistryKey to RawKey
Yuri6037 Apr 24, 2025
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
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
143 changes: 12 additions & 131 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,137 +5,18 @@ 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 }}
Test:
uses: BlockProject3D/workflows/.github/workflows/Build_Test.yml@main

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
Analyze:
uses: BlockProject3D/workflows/.github/workflows/Analyze.yml@main
needs: Test

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 }}
Coverage:
uses: BlockProject3D/workflows/.github/workflows/Coverage.yml@main

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 }}
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
24 changes: 6 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
[package]
name = "test"
version = "0.1.0"
authors = ["Yuri Edward <[email protected]>"]
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]
members = [
"build",
"codegen",
"core"
]
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 = "1.0.0-rc.4.2.1", 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