Fix compilation on wasm32-wasi.

This commit is contained in:
Dan Gohman
2022-11-28 13:12:25 -08:00
parent fcb5639e8b
commit 16eb8038aa
3 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ jobs:
- run: >
rustup target add
wasm32-wasi
- run: cargo check --workspace --release -vv --target=wasm32-wasi
- run: cargo check --workspace --release -vv --target=wasm32-wasi --all-targets
test:
name: Test
+2 -2
View File
@@ -18,7 +18,7 @@ include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"]
io-lifetimes = "1.0.0"
[target.'cfg(not(any(windows, target_os = "hermit", target_os = "unknown")))'.dependencies]
rustix = { version = "0.36.0", features = ["termios"] }
rustix = { version = "0.36.4", features = ["termios"] }
[target.'cfg(target_os = "hermit")'.dependencies]
hermit-abi = "0.2.0"
@@ -33,5 +33,5 @@ features = [
[dev-dependencies]
atty = "0.2.14"
[target.'cfg(unix)'.dev-dependencies]
[target.'cfg(any(unix, target_os = "wasi"))'.dev-dependencies]
libc = "0.2.110"
+7 -6
View File
@@ -256,6 +256,7 @@ impl IsTerminal for std::process::ChildStderr {
#[cfg(test)]
mod tests {
#[cfg(not(target_os = "unknown"))]
use super::IsTerminal;
#[test]
@@ -286,7 +287,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
fn stdin() {
unsafe {
assert_eq!(
@@ -297,7 +298,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
fn stdout() {
unsafe {
assert_eq!(
@@ -308,7 +309,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
fn stderr() {
unsafe {
assert_eq!(
@@ -319,7 +320,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
fn stdin_vs_libc() {
unsafe {
assert_eq!(
@@ -330,7 +331,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
fn stdout_vs_libc() {
unsafe {
assert_eq!(
@@ -341,7 +342,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
fn stderr_vs_libc() {
unsafe {
assert_eq!(