Skip to content
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

Minor fixes for Go bindings #2676

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

benozol
Copy link
Contributor

@benozol benozol commented Oct 27, 2023

No description provided.

case C.WASM_FUNCREF:
fallthrough
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch cases in Go require an explicit fallthrough, they break by default

@@ -1,4 +1,4 @@
module gitlab.alipay-inc.com/TNT_Runtime/ant-runtime/bindings/go
module github.com/bytecodealliance/wasm-micro-runtime/language-bindings/go
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when using the Go bindings in a separate project, the module name must match the project URL, and the test below must use the same URL, too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also we put header and libraries files under github.com/bytecodealliance/wasm-micro-runtime/language-bindings/go/packaged?

Copy link
Contributor Author

@benozol benozol Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header files and the host-native library are installed under go/packaged/ by go/build.sh. But there's also the script go/samples/build.sh, which does practically the same but always puts the host-native library into go/packaged/lib/amd64, which is incorrect, e.g., on arm64. What about just removing go/samples/build.sh?

Copy link
Contributor

@wenyongh wenyongh Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about not removing go/samples/build.sh, instead, just letting it call the go/build.sh first and then building the sample, for example:

CUR_DIR=$PWD

pushd ${CUR_DIR}/.. > /dev/null 2>&1
./build.sh
popd > /dev/null 2>& 1

cd ${CUR_DIR}
rm -f test
go build test.go
./test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #2681

Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 613c7ca into bytecodealliance:main Oct 30, 2023
1 check passed
@benozol benozol deleted the minor-fixes-for-go-bindings branch October 30, 2023 12:42
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants