Skip to content

Commit 67939b3

Browse files
authored
Relax project msrv; CI test on msrv, stable, and nightly (#118)
* back msrv off to 1.88 * ci: matrix build on msrv, stable, nightly * ci: no need to matrix on host os this is entirely cross-compiled. Duplicating testing on multiple OSs takes a bunch of time and is what the wasmtime project is supposed to do so we don't have to. If we regret this later its not hard to re-enable, but for now it doesn't seem warranted * install-rust action: fix msrv sed * test programs: compat with 1.88
1 parent 2396bc9 commit 67939b3

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

.github/actions/install-rust/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ inputs:
1010
runs:
1111
using: composite
1212
steps:
13-
- name: Install Rust
13+
- name: Select Rust
1414
shell: bash
1515
id: select
1616
run: |
17-
# Determine MSRV as N in `1.N.0` by looking at the `rust-version`
18-
# located in the root `Cargo.toml`.
19-
msrv=$(grep 'rust-version.*1' Cargo.toml | sed 's/.*\.\([0-9]*\)\..*/\1/')
17+
# Determine MSRV by looking at the `rust-version` located in the root
18+
# `Cargo.toml`.
19+
msrv=$(grep 'rust-version.*1' Cargo.toml | sed 's/rust-version *\= *"\([^"]*\)"/\1/')
2020
2121
if [ "${{ inputs.toolchain }}" = "msrv" ]; then
22-
echo "version=1.$msrv.0" >> "$GITHUB_OUTPUT"
22+
echo "version=$msrv" >> "$GITHUB_OUTPUT"
2323
else
2424
echo "version=${{ inputs.toolchain }}" >> "$GITHUB_OUTPUT"
2525
fi

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ permissions:
1717
jobs:
1818
build_and_test:
1919
name: Build and test
20-
runs-on: ${{ matrix.os }}
20+
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
os: [ubuntu-latest, windows-latest, macOS-latest]
23+
rust: [msrv, stable, nightly]
2424

2525
steps:
2626
- uses: actions/checkout@master
2727

2828
- uses: ./.github/actions/install-rust
29+
with:
30+
toolchain: ${{ matrix.rust }}
2931

3032
- name: Install wasmtime
3133
uses: bytecodealliance/actions/wasmtime/setup@v1

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ license = "Apache-2.0 WITH LLVM-exception"
5959
repository = "https://github.com/bytecodealliance/wstd"
6060
keywords = ["WebAssembly", "async", "stdlib", "Components"]
6161
categories = ["wasm", "asynchronous"]
62-
# Rust-version policy: stable N-2, same as wasmtime.
63-
rust-version = "1.89"
62+
rust-version = "1.88"
6463
authors = [
6564
"Yoshua Wuyts <rust@yosh.is>",
6665
"Pat Hickey <pat@moreproductive.org>",

test-programs/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ ureq.workspace = true
1616
cargo_metadata.workspace = true
1717
heck.workspace = true
1818

19+
[dependencies]
20+
fs2 = "0.4"
21+
1922
[features]
2023
default = []
2124
no-aws = []

test-programs/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ use std::process::{Child, Command};
66
use std::thread::sleep;
77
use std::time::Duration;
88

9+
// Required until msrv over 1.89, at which point locking is available in std
10+
use fs2::FileExt;
11+
912
const DEFAULT_SERVER_PORT: u16 = 8081;
1013

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

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

0 commit comments

Comments
 (0)