Skip to content

Add support for configuring the engine's target#157

Merged
ianks merged 2 commits intomainfrom
target-feature
Mar 24, 2023
Merged

Add support for configuring the engine's target#157
ianks merged 2 commits intomainfrom
target-feature

Conversation

@ianks
Copy link
Copy Markdown
Collaborator

@ianks ianks commented Mar 23, 2023

This will all users to cross-compile modules for various architectures. On top of that, it provides a mechanism to use a generic CPU architecture that doesn't make use of the native CPU features (i.e. if your servers use a mix of old and new x86_64 chips).

engine = Wasmtime::Engine.new(target: "x86_64-unknown-linux-gnu")
precompiled_bytes = engine.precompile_module("(module)")

Co-authored-by: Matt Rose <matt.rose@shopify.com>
@ianks ianks requested a review from jbourassa March 23, 2023 21:05
Copy link
Copy Markdown
Collaborator

@jbourassa jbourassa left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!


- name: Run ruby tests (hard-mode with GC.stress)
run: bundle exec rake spec
if: matrix.os != 'macos-latest' # these specs are aborting on CI with no logs, maybe OOM killer?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#156 is why it's aborting on macOS. Skipping meanwhile is fine by me, but I really want to fix that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good call. We'll re-enable after the fix is in.

end

at_exit { GC.start(full_mark: true) }
at_exit { GC.start(full_mark: true) } if ENV["GC_AT_EXIT"] == "1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you expand on your rationale behind this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's really only necessary for valgrind, since Ruby might not free everything at exit otherwise from what I gather. Stole it from nokogiri.

@ianks ianks merged commit e074109 into main Mar 24, 2023
@ianks ianks deleted the target-feature branch March 24, 2023 13:48
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