diff --git a/.gitignore b/.gitignore index e865b47c..141b3b09 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ lib*.a # Generated by Builders **/artifacts/ + +api/libmovevm.so +api/libcompiler.so diff --git a/Makefile b/Makefile index 06e6252c..961f3251 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,18 @@ test-filenames: echo $(COMPILER_SHARED_LIB_DST) echo $(COMPILER_SHARED_LIB_SRC) -test: precompile test-rust test-go +test: check-libs precompile test-rust test-go + +# TODO - codeql is failing without this symlink, not sure why +# - https://github.com/golang/go/issues/69605 +check-libs: + @if [ ! -f api/$(SHARED_LIB_SRC) ]; then \ + ln -s api/$(SHARED_LIB_DST) api/$(SHARED_LIB_SRC); \ + fi + + @if [ ! -f api/$(COMPILER_SHARED_LIB_SRC) ]; then \ + ln -s api/$(COMPILER_SHARED_LIB_DST) api/$(COMPILER_SHARED_LIB_SRC); \ + fi test-go: RUST_BACKTRACE=full go test -v -count=1 -parallel=1 ./... @@ -129,7 +140,9 @@ clean: @-rm libmovevm/bindings.h @-rm libcompiler/bindings_compiler.h @-rm api/$(SHARED_LIB_DST) + @-rm api/$(SHARED_LIB_SRC) @-rm api/$(COMPILER_SHARED_LIB_DST) + @-rm api/$(COMPILER_SHARED_LIB_SRC) @echo cleaned. # Creates a release build in a containerized build environment of the static library for Alpine Linux (.a) diff --git a/tools/generate-bcs-go/src/main.rs b/tools/generate-bcs-go/src/main.rs index 5fcd8054..23523e31 100644 --- a/tools/generate-bcs-go/src/main.rs +++ b/tools/generate-bcs-go/src/main.rs @@ -1,7 +1,7 @@ use std::{env::current_dir, fs::File}; use serde_generate::{golang::CodeGenerator, CodeGeneratorConfig, Encoding}; -use serde_reflection::{Tracer, TracerConfig}; +use serde_reflection::{Samples, Tracer, TracerConfig}; use initia_move_types::{ account::Account, @@ -22,46 +22,46 @@ use initia_move_types::{ view_function::{ViewFunction, ViewOutput}, vm_config::InitiaVMConfig, }; -use move_core_types::{ - account_address::AccountAddress, - identifier::Identifier, - language_storage::{ModuleId, ResourceKey, StructTag, TypeTag}, -}; +use move_core_types::language_storage::{ModuleId, ResourceKey, TypeTag}; fn main() { let mut tracer = Tracer::new(TracerConfig::default()); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::().unwrap(); - tracer.trace_simple_type::