aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2021-04-14 07:33:24 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-04-14 07:33:24 +0000
commit5487c2f543d2ded61c3a94117fea43032851aa88 (patch)
tree145cd4e1b3c7e876a65031f30f607360690369ac
parentb242b8b6552b65ae40403971968d3a079c2eb4f1 (diff)
parent8fe8d38b50c3aa13a0e3906c1edda69f8c5e0bc1 (diff)
downloadshared_child-5487c2f543d2ded61c3a94117fea43032851aa88.tar.gz
Update shared_child to 0.3.5 am: 8fe8d38b50
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/shared_child/+/1674605 Change-Id: I283a616a6b127b48dac3388ee0496cdb6d1ea7b9
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp6
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA8
-rw-r--r--TEST_MAPPING8
-rw-r--r--appveyor.yml6
-rw-r--r--src/lib.rs17
-rw-r--r--src/sys/unix.rs2
-rw-r--r--src/sys/windows.rs10
-rw-r--r--src/unix.rs7
11 files changed, 47 insertions, 27 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index d5c37ad..a082427 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "d23a8b12f0228b9a9ebe7983f44b8fec1d815b9c"
+ "sha1": "9ff8c8e9d6dc8da25a7f7947f4488ceecdffa553"
}
}
diff --git a/Android.bp b/Android.bp
index ad4db29..010e107 100644
--- a/Android.bp
+++ b/Android.bp
@@ -23,7 +23,7 @@ rust_library {
host_supported: true,
crate_name: "shared_child",
srcs: ["src/lib.rs"],
- edition: "2015",
+ edition: "2018",
rustlibs: [
"liblibc",
],
@@ -39,7 +39,7 @@ rust_defaults {
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
- edition: "2015",
+ edition: "2018",
rustlibs: [
"liblibc",
],
@@ -59,4 +59,4 @@ rust_test {
}
// dependent_library ["feature_list"]
-// libc-0.2.92 "default,std"
+// libc-0.2.93 "default,std"
diff --git a/Cargo.toml b/Cargo.toml
index e9fc07c..75e890b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,11 +11,13 @@
# will likely look very different (and much more reasonable)
[package]
+edition = "2018"
name = "shared_child"
-version = "0.3.4"
+version = "0.3.5"
authors = ["jacko"]
description = "a library for using child processes from multiple threads"
documentation = "https://docs.rs/shared_child"
+readme = "README.md"
keywords = ["command", "process", "child", "subprocess"]
categories = ["os"]
license = "MIT"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 0de5303..5c8ea27 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,13 +1,15 @@
[package]
name = "shared_child"
-version = "0.3.4"
+version = "0.3.5"
authors = ["jacko"]
license = "MIT"
repository = "https://github.com/oconnor663/shared_child.rs"
documentation = "https://docs.rs/shared_child"
+readme = "README.md"
description = "a library for using child processes from multiple threads"
keywords = ["command", "process", "child", "subprocess"]
categories = ["os"]
+edition = "2018"
[target.'cfg(not(windows))'.dependencies]
libc = "0.2.42"
diff --git a/METADATA b/METADATA
index 57e4d01..2c67826 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/shared_child/shared_child-0.3.4.crate"
+ value: "https://static.crates.io/crates/shared_child/shared_child-0.3.5.crate"
}
- version: "0.3.4"
+ version: "0.3.5"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 3
- day: 12
+ month: 4
+ day: 13
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..22f1cfe
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,8 @@
+// Generated by update_crate_tests.py for tests that depend on this crate.
+{
+ "presubmit": [
+ {
+ "name": "shared_child_device_test_src_lib"
+ }
+ ]
+}
diff --git a/appveyor.yml b/appveyor.yml
index 11d0f88..354716e 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,11 +1,11 @@
environment:
matrix:
- TARGET: x86_64-pc-windows-msvc
- VERSION: 1.16.0
+ VERSION: 1.31.0
- TARGET: i686-pc-windows-msvc
- VERSION: 1.16.0
+ VERSION: 1.31.0
- TARGET: i686-pc-windows-gnu
- VERSION: 1.16.0
+ VERSION: 1.31.0
- TARGET: x86_64-pc-windows-msvc
VERSION: beta
- TARGET: i686-pc-windows-msvc
diff --git a/src/lib.rs b/src/lib.rs
index ee77aa4..58c1e0c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -222,7 +222,7 @@ enum ChildState {
Exited(ExitStatus),
}
-use ChildState::*;
+use crate::ChildState::*;
#[cfg(test)]
mod tests {
@@ -231,12 +231,27 @@ mod tests {
use std::process::Command;
use std::sync::Arc;
+ // Python isn't available on some Unix platforms, e.g. Android, so we need this instead.
+ #[cfg(unix)]
+ pub fn true_cmd() -> Command {
+ Command::new("true")
+ }
+
+ #[cfg(not(unix))]
pub fn true_cmd() -> Command {
let mut cmd = Command::new("python");
cmd.arg("-c").arg("");
cmd
}
+ #[cfg(unix)]
+ pub fn sleep_forever_cmd() -> Command {
+ let mut cmd = Command::new("sleep");
+ cmd.arg("1000000");
+ cmd
+ }
+
+ #[cfg(not(unix))]
pub fn sleep_forever_cmd() -> Command {
let mut cmd = Command::new("python");
cmd.arg("-c").arg("import time; time.sleep(1000000)");
diff --git a/src/sys/unix.rs b/src/sys/unix.rs
index 46fe5b2..400f910 100644
--- a/src/sys/unix.rs
+++ b/src/sys/unix.rs
@@ -1,5 +1,3 @@
-extern crate libc;
-
use std;
use std::io;
use std::process::Child;
diff --git a/src/sys/windows.rs b/src/sys/windows.rs
index db927bc..3e8fbc9 100644
--- a/src/sys/windows.rs
+++ b/src/sys/windows.rs
@@ -1,12 +1,10 @@
-extern crate winapi;
-
-use self::winapi::shared::winerror::WAIT_TIMEOUT;
-use self::winapi::um::synchapi::WaitForSingleObject;
-use self::winapi::um::winbase::{WAIT_OBJECT_0, INFINITE};
-use self::winapi::um::winnt::HANDLE;
use std::io;
use std::os::windows::io::{AsRawHandle, RawHandle};
use std::process::Child;
+use winapi::shared::winerror::WAIT_TIMEOUT;
+use winapi::um::synchapi::WaitForSingleObject;
+use winapi::um::winbase::{INFINITE, WAIT_OBJECT_0};
+use winapi::um::winnt::HANDLE;
pub struct Handle(RawHandle);
diff --git a/src/unix.rs b/src/unix.rs
index f53ddd6..f1e8d2c 100644
--- a/src/unix.rs
+++ b/src/unix.rs
@@ -1,7 +1,5 @@
//! Unix-only extensions, for sending signals.
-extern crate libc;
-
use std::io;
pub trait SharedChildExt {
@@ -30,11 +28,10 @@ impl SharedChildExt for super::SharedChild {
#[cfg(test)]
mod tests {
- use super::libc;
use super::SharedChildExt;
+ use crate::tests::*;
+ use crate::SharedChild;
use std::os::unix::process::ExitStatusExt;
- use tests::*;
- use SharedChild;
#[test]
fn test_send_signal() {