Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ runs:
# override` has higher precedence though.
rustup override set "${{ steps.select.outputs.version }}"

rustup target add wasm32-wasip2

if [ "${{ inputs.toolchain }}" = "nightly" ]; then
rustup target add wasm32-wasip3
rustup component add rustfmt
rustup component add clippy
fi
rustup target add wasm32-wasip2 wasm32-wasip3
rustup component add rustfmt clippy

# Save disk space by avoiding incremental compilation. Also turn down
# debuginfo from 2 to 0 to help save disk space.
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ jobs:
- name: check p2
run: cargo check --workspace --all --bins --examples --target wasm32-wasip2

# TODO: remove all nightly conditions for p3 targets once wasm32-wasip3 is
# stable.
- name: check p3
if: matrix.rust == 'nightly'
run: cargo check --workspace --all --bins --examples --target wasm32-wasip3

- name: wstd p2 tests
run: cargo test -p wstd -p wstd-axum --target wasm32-wasip2 -- --nocapture

- name: wstd p3 tests
if: matrix.rust == 'nightly'
run: cargo test -p wstd -p wstd-axum --target wasm32-wasip3 -- --nocapture

- name: test-programs tests
Expand All @@ -81,8 +77,6 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: ./.github/actions/install-rust
with:
toolchain: nightly

- name: fmt
run: cargo fmt --all -- --check
Expand All @@ -105,8 +99,6 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: ./.github/actions/install-rust
with:
toolchain: nightly
- run: rustc ci/publish.rs
# Make sure we can bump version numbers for the next release
- run: ./publish bump
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/bytecodealliance/wstd"
keywords = ["WebAssembly", "async", "stdlib", "Components"]
categories = ["wasm", "asynchronous"]
rust-version = "1.92.0"
rust-version = "1.100.0"
authors = [
"Yoshua Wuyts <rust@yosh.is>",
"Pat Hickey <pat@moreproductive.org>",
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable"
targets = ["wasm32-wasip2"]
targets = ["wasm32-wasip2", "wasm32-wasip3"]
49 changes: 4 additions & 45 deletions test-programs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::process::Command;

fn main() {
let out_dir = PathBuf::from(var_os("OUT_DIR").expect("OUT_DIR env var exists"));
let nightly_toolchain = is_nightly_toolchain();

let meta = MetadataCommand::new()
.exec()
Expand All @@ -17,13 +16,6 @@ fn main() {
meta.workspace_root.as_os_str().to_str().unwrap()
);

// TODO: Remove this nightly only cfg once wasm32-wasip3 is available on
// stable.
println!("cargo::rustc-check-cfg=cfg(wstd_nightly)");
if nightly_toolchain {
println!("cargo:rustc-cfg=wstd_nightly");
}

fn build_target(pkg: &str, manifest: &str, kind: &str, target: &str, out_dir: &Path) {
// release build is required for aws sdk to not overflow wasm locals
let status = Command::new("cargo")
Expand All @@ -42,34 +34,16 @@ fn main() {
assert!(status.success());
}

fn build_targets(
pkg: &str,
manifest: &str,
kind: &str,
nightly_toolchain: bool,
out_dir: &Path,
) {
fn build_targets(pkg: &str, manifest: &str, kind: &str, build_p3: bool, out_dir: &Path) {
build_target(pkg, manifest, kind, "wasm32-wasip2", out_dir);

if nightly_toolchain {
if build_p3 {
build_target(pkg, manifest, kind, "wasm32-wasip3", out_dir);
}
}

build_targets(
"wstd",
"../Cargo.toml",
"--examples",
nightly_toolchain,
&out_dir,
);
build_targets(
"wstd-axum",
"../Cargo.toml",
"--examples",
nightly_toolchain,
&out_dir,
);
build_targets("wstd", "../Cargo.toml", "--examples", true, &out_dir);
build_targets("wstd-axum", "../Cargo.toml", "--examples", true, &out_dir);
build_targets(
"wstd-aws-example",
"../aws-example/Cargo.toml",
Expand Down Expand Up @@ -152,21 +126,6 @@ fn main() {
std::fs::write(out_dir.join("gen.rs"), generated_code).unwrap();
}

fn is_nightly_toolchain() -> bool {
let rustc = var_os("RUSTC").unwrap_or_else(|| "rustc".into());
let output = Command::new(rustc)
.arg("--version")
.output()
.expect("query active rustc version");
assert!(
output.status.success(),
"failed to query active rustc version"
);
String::from_utf8(output.stdout)
.expect("rustc version is UTF-8")
.contains("-nightly")
}

fn rustflags() -> &'static str {
match option_env!("RUSTFLAGS") {
Some(s) if s.contains("-D warnings") => "-D warnings",
Expand Down
2 changes: 0 additions & 2 deletions test-programs/tests/axum_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ fn hello_world() -> Result<()> {
run(test_programs::axum::HELLO_WORLD)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn hello_world_p3() -> Result<()> {
run(test_programs::axum::HELLO_WORLD_P3)
Expand All @@ -16,7 +15,6 @@ fn hello_world_nomacro() -> Result<()> {
run(test_programs::axum::HELLO_WORLD_NOMACRO)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn hello_world_nomacro_p3() -> Result<()> {
run(test_programs::axum::HELLO_WORLD_NOMACRO_P3)
Expand Down
3 changes: 1 addition & 2 deletions test-programs/tests/axum_weather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ fn weather() -> Result<()> {
run(test_programs::axum::WEATHER)
}

#[cfg(wstd_nightly)]
#[cfg_attr(wstd_nightly, ignore)]
#[ignore]
#[test_log::test]
fn weather_p3() -> Result<()> {
run(test_programs::axum::WEATHER_P3)
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/http_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ fn http_server() -> Result<()> {
run(test_programs::HTTP_SERVER)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn http_server_p3() -> Result<()> {
run(test_programs::HTTP_SERVER_P3)
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/http_server_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ fn http_server_proxy() -> Result<()> {
run(test_programs::HTTP_SERVER, test_programs::HTTP_SERVER_PROXY)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn http_server_proxy_p3() -> Result<()> {
run(
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ fn stdio_p2() -> Result<()> {
run(test_programs::STDIO, false)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn stdio_p3() -> Result<()> {
run(test_programs::STDIO_P3, true)
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/tcp_echo_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ fn tcp_echo_server_p2() -> Result<()> {
run(test_programs::TCP_ECHO_SERVER, false)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn tcp_echo_server_p3() -> Result<()> {
run(test_programs::TCP_ECHO_SERVER_P3, true)
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/tcp_stream_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ fn tcp_stream_client_p2() -> Result<()> {
run(test_programs::TCP_STREAM_CLIENT, false)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn tcp_stream_client_p3() -> Result<()> {
run(test_programs::TCP_STREAM_CLIENT_P3, true)
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/udp_echo_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ fn udp_echo_server_p2() -> Result<()> {
run(test_programs::UDP_ECHO_SERVER, false)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn udp_echo_server_p3() -> Result<()> {
run(test_programs::UDP_ECHO_SERVER_P3, true)
Expand Down
1 change: 0 additions & 1 deletion test-programs/tests/udp_stream_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ fn udp_stream_client_p2() -> Result<()> {
run(test_programs::UDP_STREAM_CLIENT, false)
}

#[cfg(wstd_nightly)]
#[test_log::test]
fn udp_stream_client_p3() -> Result<()> {
run(test_programs::UDP_STREAM_CLIENT_P3, true)
Expand Down
Loading