Skip to content

Commit 2476768

Browse files
committed
Cleanup: rm specific runtime examples, etc.
1 parent 22bacfc commit 2476768

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

box/src/builder/builder.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ impl Builder {
4747
},
4848
"nginx:alpine" => {
4949
},
50+
// etc.
5051
_ => {
5152
println!("Base '{}' not recognized.", base);
5253
}
@@ -84,11 +85,6 @@ impl Builder {
8485
}
8586

8687
pub fn build(&self, wasm_only: bool) {
87-
// Makes single executable: runtime, .wasm, args, OR just wasm + args
88-
// If single executable, make the host run exec command on execution.
89-
90-
// future: bindings to drop in a js , or a node env, etc., could
91-
// interface with signatures.
9288
}
9389

9490
pub fn set_working_directory(&mut self, dir: PathBuf) {

box/src/main.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ enum BoxCli {
2828
#[structopt(name = "run")]
2929
/// Runs a built box; if no name given, defaults to last built box
3030
Run {
31-
// add args to pass runtime, etc
3231
},
3332
}
3433

@@ -59,13 +58,7 @@ fn main() {
5958
}
6059
}
6160
BoxCli::Run { /* ... */ } => {
62-
let wasm_file = "final_build.wasm";
63-
//let script = "demo_src/my_app.rb";
64-
let script = "src/my_app.rb";
65-
66-
if let Err(e) = execute_wasm_with_wasmtime(wasm_file, script) {
67-
eprintln!("Error executing WASM with Wasmtime: {}", e);
68-
}
61+
//
6962
},
7063
}
7164
}
@@ -83,19 +76,6 @@ fn execute_run(instr: RunInstruction) {
8376
}
8477

8578
fn execute_cmd(instr: CmdInstruction) {
86-
// start here:
87-
88-
// 1.2 - save WORKDIR in struct and add it to 1.4 if it is defined
89-
//
90-
// 1.3 - COPY: /src and demo_src/ and makes those the guest, host for bundle_fs
91-
// respectively
92-
//
93-
// 1.4 - save path to pass wo execute in path_cache, use last date after build if unique
94-
// names (just a string like '/src/my_app.py'. (this gets appended on to the WORKDIR at
95-
// runtime)
96-
// do in CMD or ENTRYPOINT or RUN)
97-
// - Must check for 'ruby' or 'python'
98-
9979
println!("Execution complete!");
10080
}
10181

@@ -194,7 +174,6 @@ fn execute_arg(instr: ArgInstruction) {
194174
fn execute_misc(builder: &mut Builder, instr: MiscInstruction) {
195175
//handles: `MAINTAINER`, `EXPOSE`, `VOLUME`, `Add`
196176
//`USER`, `WORKDIR`, `ONBUILD`, `STOPSIGNAL`, `HEALTHCHECK`, `SHELL`
197-
// TODO: start here
198177

199178
//println!("{:#?}", instr.arguments.components[0] - match on for content);
200179
}
@@ -217,8 +196,6 @@ fn execute_wasm_with_wasmtime(wasm_file: &str, script: &str) -> Result<()> {
217196
//let start = instance.get_typed_func::<(), ()>(&mut store, "_start")?;
218197
//start.call(&mut store, ())?;
219198

220-
221-
// shelling out for now, adjust to use as lib
222199
let command = "wasmtime";
223200
let args = [wasm_file, "--", script];
224201

examples/c/sync_server.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <string.h>
44
#include <unistd.h>
55
#include <arpa/inet.h>
6+
#include <sys/socket.h>
67

78
#define PORT 8080
89
#define BUFFER_SIZE 1024

0 commit comments

Comments
 (0)