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

feat(runtime) Use dynamic libraries instead of compiling the runtime #12

Merged
merged 2 commits into from
May 29, 2019

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented May 29, 2019

Dependency: wasmerio/wasmer#474.

This sequence of patches aims at using dynamic libraries for the runtime. It avoids the need to compile the runtime (with rustc/cargo) when installing the Go library.

Hywan added 2 commits May 29, 2019 12:39
This patch depends on wasmerio/wasmer#474,
which fixes the dylib ID for macOS to use `@rpath`.

This patch renames the `just go` recipe to `just build`.

The `just build` recipe compiles the Rust dynamic library only when
required, i.e. when the `libwasmer_runtime_c_api.*` file is absent
from the source tree.

This patch also updates `bridge.go` to specify the `rpath` to the
linker with `-Wl,-rpath`. On macOS, the solution would be to set
`rpath` to `@executable_path` but since
https://nvd.nist.gov/vuln/detail/CVE-2018-6574, some flags are
disabled (see https://github.com/golang/go/wiki/InvalidFlag for more
information). Hopefully for us, cgo has this special `${SRCDIR}`
variable (see
https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command), which
is a possible alternative.
@Hywan Hywan added 🎉 enhancement New feature or request 📦 component-runtime About the Wasm runtime labels May 29, 2019
@Hywan Hywan self-assigned this May 29, 2019
@Hywan
Copy link
Contributor Author

Hywan commented May 29, 2019

bors try

bors bot added a commit that referenced this pull request May 29, 2019
@bors
Copy link
Contributor

bors bot commented May 29, 2019

try

Build succeeded

@Hywan
Copy link
Contributor Author

Hywan commented May 29, 2019

bors r+

bors bot added a commit that referenced this pull request May 29, 2019
12: feat(runtime) Use dynamic libraries instead of compiling the runtime r=Hywan a=Hywan

Dependency: wasmerio/wasmer#474.

This sequence of patches aims at using dynamic libraries for the runtime. It avoids the need to compile the runtime (with `rustc`/`cargo`) when installing the Go library.

Co-authored-by: Ivan Enderlin <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 29, 2019

Build succeeded

@bors bors bot merged commit a599b8c into wasmerio:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 component-runtime About the Wasm runtime 🎉 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant