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

Fix MM2 compilation errors for wasm32 arch #841

Merged
merged 29 commits into from
Mar 11, 2021
Merged

Conversation

sergeyboyko0791
Copy link

  • Remove "native" and "w-bindgen" features from toml files, replace the compilation conditions that depend on these features with target_arch = "wasm32"
  • Remove feature = "native" from toml files, replace it with target_arch = "wasm32"
  • Remove '--features native' from CI scripts

* Fix the 'unused_variable' warnings while using mm_metrics in wasm mode
* Add mm2_libp2p::runtime module
* TODO pass a Js transport to the libp2p::wasm_ext::ExtTransport::new
* TODO configure SwarmRuntime for wasm32 arch
* Replace feature = "native" with target_arch = "wasm32" in the remaining modules
* Replace feature = "w-bindgen" with target_arch = "wasm32"
* Replace eth::eth_tests::wasm_bindgen_tests into eth::eth_wasm_tests
* Fix utxo_tests compilation errors on `cargo test --target wasm32-unknown-unknown --package coins`
* Add independent common::log::LogLevel enum
* Add for_tests::require_log_level, use it in mm2_tests::test_best_orders

# Conflicts:
#	mm2src/coins/Cargo.toml
#	mm2src/coins/eth/eth_tests.rs
#	mm2src/coins/utxo/rpc_clients.rs
#	mm2src/common/Cargo.toml
#	mm2src/common/build.rs
#	mm2src/common/common.rs
#	mm2src/common/for_tests.rs
#	mm2src/common/mm_metrics/native.rs
#	mm2src/lp_network.rs
#	mm2src/lp_ordermatch.rs
#	mm2src/mm2_tests.rs
#	mm2src/rpc.rs
@sergeyboyko0791 sergeyboyko0791 linked an issue Mar 5, 2021 that may be closed by this pull request
Copy link
Author

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

I just left a few comments to accommodate them.

@@ -3,27 +3,26 @@
//! Sometimes we need to call downstream, from a dependency and into a dependent crate,
//! such as when calling `mm2::rpc::process_rpc_request` from `common::MarketMakerIt::rpc`.
//! Here we can use C-like headers and/or constructible slots for that.
//!
//! TODO refactor this.
Copy link
Author

Choose a reason for hiding this comment

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

This TODO refers to the following comment.


/// Access to `rpc::process_rpc_request` defined downstream.
/// Initialized in `rpc::init_header_slots`.
#[cfg(not(feature = "native"))]

pub static RPC_SERVICE: Constructible<
Copy link
Author

Choose a reason for hiding this comment

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

I suggest refactoring the RPC_SERVICE somehow in the next iteration. It's just why I left the TODO above.

Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

Great work on this! Just a couple of changes 🙂

Jenkinsfile Outdated Show resolved Hide resolved
azure-pipelines-build-stage-job.yml Show resolved Hide resolved
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

1 more minor change 🙂

azure-pipelines-build-stage-job.yml Outdated Show resolved Hide resolved
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

Great job, thanks! 🔥

@artemii235 artemii235 merged commit 9e4b9b9 into mm2.1 Mar 11, 2021
@artemii235 artemii235 deleted the fix-wasm-compile branch March 11, 2021 10:41
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.

Recheck WASM build status and fix it.
2 participants