Skip to content

Commit

Permalink
Merge #1357
Browse files Browse the repository at this point in the history
1357: Refactored bin commands into separate files r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Refactored bin commands into separate files.
This PR does not do any sustancial changes other than refactoring into different files for better readability.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
  • Loading branch information
bors[bot] and syrusakbary authored Apr 7, 2020
2 parents bc75790 + f7c84c8 commit 1058dcd
Show file tree
Hide file tree
Showing 13 changed files with 1,207 additions and 1,235 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## **[Unreleased]**

- [#1357](https://github.com/wasmerio/wasmer/pull/1357) Refactored bin commands into separate files
- [#1331](https://github.com/wasmerio/wasmer/pull/1331) Implement the `record` type and instrutions for WIT
- [#1345](https://github.com/wasmerio/wasmer/pull/1345) Adding ARM testing in Azure Pipelines
- [#1335](https://github.com/wasmerio/wasmer/pull/1335) Change mutability of `memory` to `const` in `wasmer_memory_data_length` in the C API
Expand Down
23 changes: 11 additions & 12 deletions src/bin/kwasmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ use structopt::StructOpt;
#[cfg(feature = "loader-kernel")]
use wasmer_singlepass_backend::SinglePassCompiler;

#[cfg(feature = "loader-kernel")]
use wasmer_runtime_core::loader::Instance;

#[cfg(feature = "loader-kernel")]
use std::os::unix::net::{UnixListener, UnixStream};

Expand Down Expand Up @@ -50,12 +53,8 @@ fn handle_client(mut stream: UnixStream) {
let mut wasm_binary: Vec<u8> = Vec::with_capacity(binary_size as usize);
unsafe { wasm_binary.set_len(binary_size as usize) };
stream.read_exact(&mut wasm_binary).unwrap();
use wasmer_bin::webassembly;
use wasmer_runtime_core::{
backend::{CompilerConfig, MemoryBoundCheckMode},
loader::Instance,
};
let module = webassembly::compile_with_config_with(
use wasmer_runtime_core::backend::{CompilerConfig, MemoryBoundCheckMode};
let module = wasmer_runtime::compile_with_config_with(
&wasm_binary[..],
CompilerConfig {
symbol_map: None,
Expand Down Expand Up @@ -167,12 +166,12 @@ fn run_listen(opts: Listen) {
#[cfg(feature = "loader-kernel")]
fn main() {
panic!("Kwasm not updated for 128-bit support, yet. Sorry!");
let options = CLIOptions::from_args();
match options {
CLIOptions::Listen(listen) => {
run_listen(listen);
}
}
// let options = CLIOptions::from_args();
// match options {
// CLIOptions::Listen(listen) => {
// run_listen(listen);
// }
// }
}

#[cfg(not(feature = "loader-kernel"))]
Expand Down
Loading

0 comments on commit 1058dcd

Please sign in to comment.