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(cross-compilation) Allow cross-compilation! #180

Merged
merged 7 commits into from
Feb 5, 2021

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Jan 29, 2021

Depends on wasmerio/wasmer#2072.

This patch implements Target, Triple, and CpuFeatures.
Then, it adds Config.UseTarget.
And finally, we can test it inside engine_test.go.

	triple, err := NewTriple("x86_64-apple-darwin")
	assert.NoError(t, err)

	cpuFeatures := NewCpuFeatures()
	err = cpuFeatures.Add("sse2")
	assert.NoError(t, err)

	target := NewTarget(triple, cpuFeatures)

	config := NewConfig()
	config.UseTarget(target)

	engine := NewEngineWithConfig(config)
	store := NewStore(engine)

	module, err := NewModule(store, testGetBytes())
	assert.NoError(t, err)

	_ = module

More tests can be added to handle error cases.

@Hywan Hywan added 🎉 enhancement New feature or request 📦 component-extension About the Go extension 📦 component-runtime About the Wasm runtime 🧪 tests I love tests labels Jan 29, 2021
@Hywan Hywan requested a review from jubianchi January 29, 2021 14:26
@Hywan Hywan self-assigned this Jan 29, 2021
@Hywan Hywan force-pushed the feat-cross-compilation branch from 3327ee1 to 61a139e Compare February 5, 2021 08:54
@Hywan
Copy link
Contributor Author

Hywan commented Feb 5, 2021

bors try

bors bot added a commit that referenced this pull request Feb 5, 2021
@bors
Copy link
Contributor

bors bot commented Feb 5, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 5, 2021

Waiting on wasmerio/wasmer#2097

There is a small bug in Wasmer, see
wasmerio/wasmer#2097. While waiting on the
fix, we change the cross-compilation target in our test so that the CI
is happy and we can merge the entire PR. The new release of Wasmer
will come quickly.
@Hywan
Copy link
Contributor Author

Hywan commented Feb 5, 2021

bors try

bors bot added a commit that referenced this pull request Feb 5, 2021
@bors
Copy link
Contributor

bors bot commented Feb 5, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 5, 2021

bors try

bors bot added a commit that referenced this pull request Feb 5, 2021
@bors
Copy link
Contributor

bors bot commented Feb 5, 2021

@Hywan Hywan merged commit e8bffc8 into wasmerio:master Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 component-extension About the Go extension 📦 component-runtime About the Wasm runtime 🎉 enhancement New feature or request 🧪 tests I love tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant