Skip to content

Commit 5bea217

Browse files
committed
file locking is in std if we lie about msrv policy for 7 days
1 parent d0dae63 commit 5bea217

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ repository = "https://github.com/bytecodealliance/wstd"
6161
keywords = ["WebAssembly", "async", "stdlib", "Components"]
6262
categories = ["wasm", "asynchronous"]
6363
# Rust-version policy: stable N-2, same as wasmtime.
64-
rust-version = "1.87"
64+
rust-version = "1.89"
6565
authors = [
6666
"Yoshua Wuyts <rust@yosh.is>",
6767
"Pat Hickey <pat@moreproductive.org>",

test-programs/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ license.workspace = true
66
rust-version.workspace = true
77
publish = false
88

9-
[dependencies]
10-
fslock = "0.2.1"
11-
129
[dev-dependencies]
1310
anyhow.workspace = true
1411
test-log.workspace = true

test-programs/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include!(concat!(env!("OUT_DIR"), "/gen.rs"));
22

3-
use fslock::LockFile;
3+
use std::fs::File;
44
use std::net::TcpStream;
55
use std::process::{Child, Command};
66
use std::thread::sleep;
@@ -9,7 +9,7 @@ use std::time::Duration;
99
/// Manages exclusive access to port 8081, and kills the process when dropped
1010
pub struct WasmtimeServe {
1111
#[expect(dead_code, reason = "exists to live for as long as wasmtime process")]
12-
lockfile: LockFile,
12+
lockfile: File,
1313
process: Child,
1414
}
1515

@@ -23,9 +23,9 @@ impl WasmtimeServe {
2323
/// Kills the wasmtime process, and releases the lock, once dropped.
2424
pub fn new(guest: &str) -> std::io::Result<Self> {
2525
let mut lockfile = std::env::temp_dir();
26-
lockfile.push("TEST_PROGRAMS_WASMTIME_SERVE.pid");
27-
let mut lockfile = LockFile::open(&lockfile)?;
28-
lockfile.lock_with_pid()?;
26+
lockfile.push("TEST_PROGRAMS_WASMTIME_SERVE.lock");
27+
let lockfile = File::create(&lockfile)?;
28+
lockfile.lock()?;
2929

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

0 commit comments

Comments
 (0)