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
10 changes: 5 additions & 5 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ inputs:
runs:
using: composite
steps:
- name: Install Rust
- name: Select Rust
shell: bash
id: select
run: |
# Determine MSRV as N in `1.N.0` by looking at the `rust-version`
# located in the root `Cargo.toml`.
msrv=$(grep 'rust-version.*1' Cargo.toml | sed 's/.*\.\([0-9]*\)\..*/\1/')
# Determine MSRV by looking at the `rust-version` located in the root
# `Cargo.toml`.
msrv=$(grep 'rust-version.*1' Cargo.toml | sed 's/rust-version *\= *"\([^"]*\)"/\1/')

if [ "${{ inputs.toolchain }}" = "msrv" ]; then
echo "version=1.$msrv.0" >> "$GITHUB_OUTPUT"
echo "version=$msrv" >> "$GITHUB_OUTPUT"
else
echo "version=${{ inputs.toolchain }}" >> "$GITHUB_OUTPUT"
fi
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ permissions:
jobs:
build_and_test:
name: Build and test
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [msrv, stable, nightly]

steps:
- uses: actions/checkout@master

- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}

- name: Install wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/bytecodealliance/wstd"
keywords = ["WebAssembly", "async", "stdlib", "Components"]
categories = ["wasm", "asynchronous"]
# Rust-version policy: stable N-2, same as wasmtime.
rust-version = "1.89"
rust-version = "1.88"
authors = [
"Yoshua Wuyts <rust@yosh.is>",
"Pat Hickey <pat@moreproductive.org>",
Expand Down
3 changes: 3 additions & 0 deletions test-programs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ ureq.workspace = true
cargo_metadata.workspace = true
heck.workspace = true

[dependencies]
fs2 = "0.4"

[features]
default = []
no-aws = []
6 changes: 5 additions & 1 deletion test-programs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use std::process::{Child, Command};
use std::thread::sleep;
use std::time::Duration;

// Required until msrv over 1.89, at which point locking is available in std
use fs2::FileExt;

const DEFAULT_SERVER_PORT: u16 = 8081;

/// Manages exclusive access to port 8081, and kills the process when dropped
Expand All @@ -31,7 +34,8 @@ impl WasmtimeServe {
let mut lockfile = std::env::temp_dir();
lockfile.push(format!("TEST_PROGRAMS_WASMTIME_SERVE_{port}.lock"));
let lockfile = File::create(&lockfile)?;
lockfile.lock()?;
// Once msrv reaches 1.89, replace with std's `.lock()` method
lockfile.lock_exclusive()?;

// Run wasmtime serve.
// Enable -Scli because we currently don't have a way to build with the
Expand Down