diff --git a/common_service/socket/src/apis.rs b/common_service/socket/src/apis.rs index 1c00fc09..1e0c0727 100644 --- a/common_service/socket/src/apis.rs +++ b/common_service/socket/src/apis.rs @@ -132,7 +132,7 @@ pub fn smol_send(handle: SockFd, data: &[u8]) -> SmoltcpResult<()> { #[no_mangle] pub fn smol_recv(handle: SockFd, buf: &mut [u8]) -> SmoltcpResult { - // println!("smol_recv"); + println!("smol_recv"); let mut iface = acquire_iface()?; let mut sockets = acquire_sockets()?; diff --git a/common_service/socket/src/lib.rs b/common_service/socket/src/lib.rs index 0685703a..f6dacb61 100644 --- a/common_service/socket/src/lib.rs +++ b/common_service/socket/src/lib.rs @@ -88,7 +88,8 @@ lazy_static! { iface.update_ip_addrs(|ip_addrs| { ip_addrs .push(IpCidr::new( - IpAddress::v4(192, 168, 69, init_context::isolation_ctx().isol_id as u8), + // IpAddress::v4(192, 168, 69, init_context::isolation_ctx().isol_id as u8), + IpAddress::v4(192, 168, 69, 1), 24, )) .unwrap(); diff --git a/justfile b/justfile index a37e61db..4c4132a8 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ set positional-arguments enable_mpk := "0" -enable_pkey_per_func := "1" +enable_pkey_per_func := "0" enable_release := "0" @@ -26,8 +26,11 @@ release_flag := if enable_release == "1" { "--release" } else { "" } -all_rust: - # ./scripts/build_user.sh +all_libos: + ./scripts/build_all_common{{ if enable_mpk == "1" { "_mpk" } else { "" } }}.sh {{ release_flag }} + +all_rust: + just all_libos ./scripts/build_user.sh {{ release_flag }} {{ cmd_flag }} cc_flags_p1 := "-Wl,--gc-sections -nostdlib -Wl,--whole-archive" @@ -97,6 +100,7 @@ c_checker_so: -o target/{{target}}/debug/libwasmtime_checker.so run_rust_test: + just all_libos just all_rust ./scripts/run_tests.sh {{ cmd_flag }} diff --git a/scripts/build_user.sh b/scripts/build_user.sh index 342f42f0..307f875d 100755 --- a/scripts/build_user.sh +++ b/scripts/build_user.sh @@ -23,7 +23,6 @@ for file in $(find user -name 'Cargo.toml' \ -not -path 'user/httpd/Cargo.toml' \ -not -path 'user/should_panic/Cargo.toml' \ -not -path 'user/load_all/Cargo.toml' \ - -not -path 'user/simple_http/Cargo.toml' \ -not -path 'user/never_stop/Cargo.toml' \ -not -path 'user/tinywasm*/Cargo.toml' \ -not -path 'user/wasmtime*/Cargo.toml'); do diff --git a/user/simple_http/Cargo.toml b/user/simple_http/Cargo.toml index bcb1b195..38752715 100644 --- a/user/simple_http/Cargo.toml +++ b/user/simple_http/Cargo.toml @@ -14,4 +14,6 @@ ms_std = { path = "../../ms_std", features = ["unwinding", "alloc_def"] } [features] mpk = ["ms_std/mpk"] +pkey_per_func = ["mpk"] + default = [] \ No newline at end of file diff --git a/user/simple_http/src/lib.rs b/user/simple_http/src/lib.rs index 4ec2d8eb..d13d5e79 100644 --- a/user/simple_http/src/lib.rs +++ b/user/simple_http/src/lib.rs @@ -9,7 +9,8 @@ use ms_std::{agent::FaaSFuncResult as Result, net::TcpStream, println}; #[no_mangle] pub fn main() -> Result<()> { - let mut stream = TcpStream::connect("192.168.69.100:9999".into())?; + let mut stream = TcpStream::connect("www.baidu.com".into())?; + println!("tcp connection created."); stream.write_all(b"GET / HTTP/1.0\r\n\r\n")?; let mut buffer = [0; 4096]; // println!("send data finish.");