chiark / gitweb /
support: Move childio and debugmutex
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 14 May 2022 18:18:59 +0000 (19:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 14 May 2022 18:18:59 +0000 (19:18 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
12 files changed:
Cargo.lock
Cargo.toml
apitest/apitest.rs
src/crates.rs
src/imports.rs
src/lib.rs
support/Cargo.toml
support/childio.rs [moved from src/childio.rs with 100% similarity]
support/crates.rs
support/debugmutex.rs [moved from src/debugmutex.rs with 100% similarity]
support/imports.rs
support/lib.rs

index 4a8488c51c299fb39a97112013f0eebd6a64fd4d..939464ba37bfa0902390d89405d5613d4ecb9da2 100644 (file)
@@ -2673,7 +2673,6 @@ name = "otter"
 version = "1.0.0"
 dependencies = [
  "ambassador",
- "anyhow",
  "async-condvar-fair",
  "backtrace",
  "base64 0.13.0",
@@ -2706,7 +2705,6 @@ dependencies = [
  "lazy_static",
  "libc",
  "mio 0.8.2",
- "nix 0.23.1",
  "num",
  "num-derive",
  "num-traits",
@@ -2832,10 +2830,12 @@ dependencies = [
 name = "otter-support"
 version = "1.0.0"
 dependencies = [
+ "anyhow",
  "chrono",
  "chrono-tz",
  "fehler",
  "log",
+ "nix 0.23.1",
  "otter-base",
  "parking_lot",
  "serde",
index e696f42fe4fca0b1622d952ae563bbf0e3da78eb..3e66be3d01072738cd02af80117698d8b847ebae 100644 (file)
@@ -32,7 +32,6 @@ bundle-sources="0.0.1"
 otter-support.path="support"
 otter-support.version="=1.0.0"
        
-anyhow="1"
 backtrace="0.3"
 base64="0.13"
 boolinator="2"
@@ -56,7 +55,6 @@ lazy-init="0.5"
 lazy-regex="2"
 lazy_static="1"
 libc="0.2"
-nix="0.23"
 num="0.4"
 num-derive="0.3"
 num-traits="0.2"
index ead6ff0de28d80943ee27cdae0de4b63dee13000..3a1979c014ca3192e5c65adc2f1ba6cb5b3d87db 100644 (file)
@@ -345,6 +345,7 @@ impl<T,E> Result<T,E> {
 
 pub mod cleanup_notify {
   use super::crates::*;
+  use otter_support::crates::*;
   use super::AE;
   pub use super::Void; // TODO remove the need for this
 
index 75a98c1cccd7f186a5e1ff403d838a93c231c401..03ef76d100da115ef1042c19179e94d948fb3581 100644 (file)
@@ -6,7 +6,6 @@
 
 pub use otter_support;
 
-pub use anyhow;
 pub use async_condvar_fair;
 pub use base64;
 pub use boolinator;
@@ -25,7 +24,6 @@ pub use lazy_init;
 pub use lazy_static;
 pub use inventory;
 pub use libc;
-pub use nix;
 pub use once_cell;
 pub use ordered_float;
 pub use pwd;
index 356609bac6ae3e78217fa4b2ec732d95aa961262..69475c3784df32399624cc6021e7a3e07bf3231a 100644 (file)
@@ -13,9 +13,6 @@ use otter_base::imports::*;
 pub use std::any::Any;
 pub use std::borrow::Cow;
 pub use std::cmp::{self, max, min, Ordering};
-pub use std::collections::VecDeque;
-pub use std::collections::{btree_map, BTreeMap};
-pub use std::collections::{btree_set, BTreeSet};
 pub use std::convert::{Infallible, TryFrom, TryInto};
 pub use std::env;
 pub use std::error::Error;
@@ -23,26 +20,13 @@ pub use std::ffi::OsStr;
 pub use std::fmt::Formatter;
 pub use std::fmt::Write as _;
 pub use std::fmt::{self, Debug, Display};
-pub use std::fs;
-pub use std::fs::File;
 pub use std::hash::Hash;
-pub use std::io;
-pub use std::io::ErrorKind;
-pub use std::io::{BufRead, BufReader, BufWriter, Read, Write};
 pub use std::iter;
 pub use std::iter::{repeat_with};
 pub use std::marker::PhantomData;
 pub use std::num::{NonZeroUsize, TryFromIntError, Wrapping};
-pub use std::os::linux::fs::MetadataExt as _; // todo why linux for st_mode??
-pub use std::os::unix;
-pub use std::os::unix::ffi::OsStrExt;
-pub use std::os::unix::fs::{MetadataExt, OpenOptionsExt};
-pub use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd};
-pub use std::os::unix::net::UnixStream;
-pub use std::os::unix::process::{CommandExt, ExitStatusExt};
 pub use std::net::{IpAddr, SocketAddr, ToSocketAddrs, Ipv6Addr, Ipv4Addr};
 pub use std::path::PathBuf;
-pub use std::process::{exit, Child, Command, Stdio};
 pub use std::str;
 pub use std::str::FromStr;
 pub use std::string::ParseError;
@@ -51,7 +35,6 @@ pub use std::sync::mpsc;
 pub use std::thread::{self, sleep};
 pub use std::time::{self, Duration, Instant};
 
-pub use anyhow::{anyhow, ensure, Context};
 pub use async_condvar_fair::{Condvar, BatonExt as _};
 pub use boolinator::Boolinator as _;
 pub use byteorder::{BigEndian, LittleEndian, ReadBytesExt, WriteBytesExt};
@@ -72,9 +55,6 @@ pub use index_vec::{define_index_type, index_vec, IndexSlice, IndexVec};
 pub use lazy_regex::regex;
 pub use lazy_static::lazy_static;
 pub use log::{log, log_enabled};
-pub use nix::unistd::{self, Uid};
-pub use nix::sys::time::TimeSpec;
-pub use nix::time::clock_gettime;
 pub use num_derive::{ToPrimitive, FromPrimitive};
 pub use num_traits::{Bounded, FromPrimitive, ToPrimitive};
 pub use ordered_float::OrderedFloat;
@@ -129,14 +109,12 @@ pub use crate::authproofs::{self, Authorisation, Unauthorised};
 pub use crate::authproofs::AuthorisationSuperuser;
 pub use crate::asseturl::*;
 pub use crate::bundles::{self, InstanceBundles, MgmtBundleListExt};
-pub use crate::childio;
 pub use crate::commands::{AccessTokenInfo, AccessTokenReport, MgmtError};
 pub use crate::commands::{MgmtCommand, MgmtResponse};
 pub use crate::commands::{MgmtGameInstruction, MgmtGameResponse};
 pub use crate::commands::{MgmtBundleList, MgmtGameUpdateMode};
 pub use crate::commands::{ProgressUpdateMode};
 pub use crate::config::*;
-pub use crate::debugmutex::DebugIdentify;
 pub use crate::debugreader::DebugReader;
 pub use crate::digestrw::{self, *};
 pub use crate::error::*;
@@ -183,8 +161,6 @@ pub const MS: time::Duration = time::Duration::from_millis(1);
 
 // ---------- type abbreviations ----------
 
-pub type AE = anyhow::Error;
-
 // accounts.rs
 pub type AS = AccountScope;
 
index d8eaa5dfe8ed277391179adf9df77f0c2df6b830..a7236beaae3a74df5a027601d682f735ded93ddd 100644 (file)
@@ -26,7 +26,6 @@ pub mod accounts;
 pub mod asseturl;
 pub mod authproofs;
 pub mod bundles;
-pub mod childio;
 pub mod clock;
 pub mod commands;
 pub mod config;
@@ -34,7 +33,6 @@ pub mod currency;
 pub mod deck;
 pub mod dice;
 pub mod digestrw;
-pub mod debugmutex;
 pub mod debugreader;
 pub mod error;
 pub mod fastsplit;
index d748536d84501f511d51259d1251a12a7132bf53..4faca4c3d0262792fb289b40b879afb55d08e8cf 100644 (file)
@@ -26,10 +26,12 @@ path="lib.rs"
 otter-base.path="../base"
 otter-base.version="=1.0.0"
        
+anyhow="1"
 chrono="0.4"
 chrono-tz="0.6"
 fehler="1"
 log="0.4"
+nix="0.23"
 parking_lot="0.12"
 
 serde_with="1"
similarity index 100%
rename from src/childio.rs
rename to support/childio.rs
index ee60990cee2f6e795ee0e4e3b55378c492296182..f2a74b42a618b5867df6e0228601131e5a2ebbc8 100644 (file)
@@ -6,7 +6,9 @@
 
 pub use otter_base;
 
+pub use anyhow;
 pub use chrono;
 pub use chrono_tz;
 pub use log;
+pub use nix;
 pub use parking_lot;
similarity index 100%
rename from src/debugmutex.rs
rename to support/debugmutex.rs
index 5b7eae4c8c59a04458d6185e187b814d5ec3bc55..7da9160515be3f28a82bcc3c5c61ec2ab04498e6 100644 (file)
@@ -5,9 +5,29 @@
 // See Import Structure Doctrine in src/prelude.rs
 
 pub use std::collections::{hash_map, HashMap, HashSet};
+pub use std::collections::VecDeque;
+pub use std::collections::{btree_map, BTreeMap};
+pub use std::collections::{btree_set, BTreeSet};
+pub use std::fs;
+pub use std::fs::File;
+pub use std::io;
+pub use std::io::ErrorKind;
+pub use std::io::{BufRead, BufReader, BufWriter, Read, Write};
+pub use std::os::linux::fs::MetadataExt as _; // todo why linux for st_mode??
+pub use std::os::unix;
+pub use std::os::unix::ffi::OsStrExt;
+pub use std::os::unix::fs::{MetadataExt, OpenOptionsExt};
+pub use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd};
+pub use std::os::unix::net::UnixStream;
+pub use std::os::unix::process::{CommandExt, ExitStatusExt};
+pub use std::process::{exit, Child, Command, Stdio};
 pub use std::sync::Arc;
 
+pub use anyhow::{anyhow, ensure, Context};
 pub use log::{debug, error, info, trace, warn};
+pub use nix::unistd::{self, Uid};
+pub use nix::sys::time::TimeSpec;
+pub use nix::time::clock_gettime;
 pub use serde::ser::SerializeTuple;
 pub use serde::{de::DeserializeOwned, Deserialize, Serialize};
 pub use serde::de::Error as _;
@@ -22,6 +42,11 @@ pub use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
 pub use parking_lot::{Mutex, MutexGuard};
 //pub use crate::debugmutex::{Mutex, MutexGuard};
 
+pub use crate::childio;
+pub use crate::debugmutex::DebugIdentify;
 pub use crate::support::*;
 pub use crate::tz::*;
 
+// ---------- type abbreviations ----------
+
+pub type AE = anyhow::Error;
index 1fff09c52f6293f0a19f8e4267ff46b272ac8333..6b467cd943c3f89666a0d59b78a93099a85a8069 100644 (file)
@@ -6,5 +6,7 @@ pub mod crates;
 pub mod imports;
 pub mod prelude;
 
+pub mod childio;
+pub mod debugmutex;
 pub mod support;
 pub mod tz;