fix incompatibilities with edition 2018 module changes

With this we could add `edition = "2018"` to enable new features like
async/await.
This commit is contained in:
Daiderd Jordan 2019-11-13 01:24:22 +01:00 committed by Cole Helbling
parent c2ea19fe47
commit c7978aca74
No known key found for this signature in database
GPG key ID: B37E0F2371016A4C
29 changed files with 134 additions and 140 deletions

View file

@ -1,4 +1,4 @@
use ofborg::systems::System;
use crate::systems::System;
pub struct ACL {
trusted_users: Vec<String>,

View file

@ -1,6 +1,6 @@
use crate::clone;
use crate::clone::GitClonable;
use md5;
use ofborg::clone;
use ofborg::clone::GitClonable;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::fs;
@ -253,7 +253,7 @@ impl clone::GitClonable for CachedProject {
#[cfg(test)]
mod tests {
use super::*;
use ofborg::test_scratch::TestScratch;
use crate::test_scratch::TestScratch;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

View file

@ -1,9 +1,9 @@
use crate::acl;
use crate::nix::Nix;
use hubcaps::{Credentials, Github, InstallationTokenGenerator, JWTCredentials};
use hyper::net::HttpsConnector;
use hyper::Client;
use hyper_native_tls::NativeTlsClient;
use nix::Nix;
use ofborg::acl;
use serde_json;
use std::collections::HashMap;
use std::fs::File;

View file

@ -1,7 +1,7 @@
use crate::config::RabbitMQConfig;
use crate::ofborg;
use amqp;
use amqp::Basic;
use ofborg;
use ofborg::config::RabbitMQConfig;
pub struct ConsumeConfig {
/// Specifies the name of the queue to consume from.

View file

@ -1,7 +1,7 @@
extern crate amqp;
extern crate env_logger;
use ofborg::nix;
use crate::nix;
use std::fs::File;
use std::path::Path;

View file

@ -1,4 +1,4 @@
use ofborg::ghevent::{Comment, Issue, Repository};
use crate::ghevent::{Comment, Issue, Repository};
#[derive(Serialize, Deserialize, Debug)]
pub struct IssueComment {

View file

@ -1,4 +1,4 @@
use ofborg::ghevent::Repository;
use crate::ghevent::Repository;
#[derive(Serialize, Deserialize)]
pub struct PullRequestEvent {

View file

@ -61,29 +61,29 @@ pub mod worker;
pub mod writetoline;
pub mod ofborg {
pub use acl;
pub use asynccmd;
pub use checkout;
pub use clone;
pub use commentparser;
pub use commitstatus;
pub use config;
pub use easyamqp;
pub use evalchecker;
pub use files;
pub use ghevent;
pub use locks;
pub use message;
pub use nix;
pub use notifyworker;
pub use outpathdiff;
pub use stats;
pub use systems;
pub use tagger;
pub use tasks;
pub use test_scratch;
pub use worker;
pub use writetoline;
pub use crate::acl;
pub use crate::asynccmd;
pub use crate::checkout;
pub use crate::clone;
pub use crate::commentparser;
pub use crate::commitstatus;
pub use crate::config;
pub use crate::easyamqp;
pub use crate::evalchecker;
pub use crate::files;
pub use crate::ghevent;
pub use crate::locks;
pub use crate::message;
pub use crate::nix;
pub use crate::notifyworker;
pub use crate::outpathdiff;
pub use crate::stats;
pub use crate::systems;
pub use crate::tagger;
pub use crate::tasks;
pub use crate::test_scratch;
pub use crate::worker;
pub use crate::writetoline;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

View file

@ -1,4 +1,4 @@
use ofborg::nix::Nix;
use crate::nix::Nix;
use std::collections::{HashMap, HashSet};
use std::io::Write;
use std::path::Path;
@ -125,9 +125,9 @@ impl std::fmt::Display for ImpactedMaintainers {
#[cfg(test)]
mod tests {
use super::*;
use checkout::cached_cloner;
use clone::GitClonable;
use ofborg::test_scratch::TestScratch;
use crate::checkout::cached_cloner;
use crate::clone::GitClonable;
use crate::test_scratch::TestScratch;
use std::env;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};

View file

@ -1,5 +1,5 @@
use ofborg::commentparser::Subset;
use ofborg::message::{Pr, Repo};
use crate::commentparser::Subset;
use crate::message::{Pr, Repo};
use serde_json;
#[derive(Serialize, Deserialize, Debug)]

View file

@ -1,5 +1,5 @@
use crate::message::{Pr, Repo};
use hubcaps::checks::Conclusion;
use ofborg::message::{Pr, Repo};
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum BuildStatus {

View file

@ -1,5 +1,5 @@
use ofborg::message::{Pr, Repo};
use ofborg::worker;
use crate::message::{Pr, Repo};
use crate::worker;
use serde_json;
pub fn from(data: &[u8]) -> Result<EvaluationJob, serde_json::error::Error> {

View file

@ -1,5 +1,5 @@
use ofborg::asynccmd::{AsyncCmd, SpawnedAsyncCmd};
use ofborg::partition_result;
use crate::asynccmd::{AsyncCmd, SpawnedAsyncCmd};
use crate::ofborg::partition_result;
use std::collections::HashMap;
use std::env;
use std::ffi::OsStr;

View file

@ -1,8 +1,8 @@
use crate::nix;
/// Evaluates the expression like Hydra would, with regards to
/// architecture support and recursed packages.
use crate::nixstats::EvaluationStats;
use crate::outpathdiff;
use ofborg::nix;
use serde_json;
use std::fs;
use std::fs::File;

View file

@ -1,8 +1,8 @@
use crate::worker::Action;
use amqp::protocol::basic::{BasicProperties, Deliver};
use amqp::Basic;
use amqp::{Channel, Consumer};
use std::marker::Send;
use worker::Action;
pub struct NotifyWorker<T: SimpleNotifyWorker> {
internal: T,

View file

@ -1,10 +1,9 @@
use crate::nix;
use crate::nixenv::Error as NixEnvError;
use crate::nixenv::HydraNixEnv;
use crate::nixstats::{EvaluationStats, EvaluationStatsDiff};
use ofborg::nix;
use std::collections::{HashMap, HashSet};
use std::io::BufRead;
use std::path::PathBuf;
pub struct OutPathDiff {

View file

@ -1,6 +1,6 @@
use crate::maintainers::{Maintainer, MaintainersByPackage};
use ofborg::outpathdiff::PackageArch;
use ofborg::tasks;
use crate::outpathdiff::PackageArch;
use crate::tasks;
use std::collections::HashMap;
pub struct StdenvTagger {

View file

@ -2,19 +2,16 @@ extern crate amqp;
extern crate env_logger;
extern crate uuid;
use uuid::Uuid;
use ofborg::checkout;
use ofborg::commentparser;
use ofborg::message::buildjob;
use ofborg::message::buildlogmsg;
use ofborg::message::buildresult::{BuildResult, BuildStatus, V1Tag};
use ofborg::nix;
use std::collections::VecDeque;
use crate::checkout;
use crate::commentparser;
use crate::message::buildresult::{BuildResult, BuildStatus, V1Tag};
use crate::message::{buildjob, buildlogmsg};
use crate::nix;
use crate::notifyworker;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::notifyworker;
use ofborg::worker;
use std::collections::VecDeque;
use uuid::Uuid;
pub struct BuildWorker {
cloner: checkout::CachedCloner,
@ -394,9 +391,9 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker {
#[cfg(test)]
mod tests {
use super::*;
use notifyworker::SimpleNotifyWorker;
use ofborg::message::{Pr, Repo};
use ofborg::test_scratch::TestScratch;
use crate::message::{Pr, Repo};
use crate::notifyworker::SimpleNotifyWorker;
use crate::test_scratch::TestScratch;
use std::env;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

View file

@ -1,8 +1,8 @@
use ofborg::checkout::CachedProjectCo;
use ofborg::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker;
use crate::checkout::CachedProjectCo;
use crate::commitstatus::CommitStatus;
use crate::evalchecker::EvalChecker;
use crate::tasks::eval::{EvaluationComplete, EvaluationStrategy, StepResult};
use std::path::Path;
use tasks::eval::{EvaluationComplete, EvaluationStrategy, StepResult};
#[derive(Default)]
pub struct GenericStrategy {}

View file

@ -4,11 +4,11 @@ mod nixpkgs;
pub use self::nixpkgs::NixpkgsStrategy;
mod generic;
pub use self::generic::GenericStrategy;
use crate::checkout::CachedProjectCo;
use crate::commitstatus::{CommitStatus, CommitStatusError};
use crate::evalchecker::EvalChecker;
use crate::message::buildjob::BuildJob;
use hubcaps::checks::CheckRunOptions;
use ofborg::checkout::CachedProjectCo;
use ofborg::commitstatus::{CommitStatus, CommitStatusError};
use ofborg::evalchecker::EvalChecker;
use ofborg::message::buildjob::BuildJob;
use std::path::Path;
pub trait EvaluationStrategy {

View file

@ -1,29 +1,29 @@
use crate::checkout::CachedProjectCo;
use crate::commentparser::Subset;
use crate::commitstatus::CommitStatus;
use crate::evalchecker::EvalChecker;
use crate::maintainers;
use crate::maintainers::ImpactedMaintainers;
use crate::message::buildjob::BuildJob;
use crate::message::evaluationjob::EvaluationJob;
use crate::nix;
use crate::nix::Nix;
use crate::nixenv::HydraNixEnv;
use crate::outpathdiff::{OutPathDiff, PackageArch};
use crate::tagger::{MaintainerPRTagger, PathsTagger, RebuildTagger};
use crate::tagger::{PkgsAddedRemovedTagger, StdenvTagger};
use crate::tasks::eval::{
stdenvs::Stdenvs, Error, EvaluationComplete, EvaluationStrategy, StepResult,
};
use crate::tasks::evaluate::make_gist;
use crate::tasks::evaluate::update_labels;
use chrono::Utc;
use hubcaps::checks::{CheckRunOptions, CheckRunState, Conclusion, Output};
use hubcaps::gists::Gists;
use hubcaps::issues::{Issue, IssueRef};
use hubcaps::repositories::Repository;
use ofborg::checkout::CachedProjectCo;
use ofborg::commentparser::Subset;
use ofborg::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker;
use ofborg::message::buildjob::BuildJob;
use ofborg::message::evaluationjob::EvaluationJob;
use ofborg::nix;
use ofborg::nix::Nix;
use ofborg::outpathdiff::{OutPathDiff, PackageArch};
use ofborg::tagger::{MaintainerPRTagger, PathsTagger, RebuildTagger};
use ofborg::tagger::{PkgsAddedRemovedTagger, StdenvTagger};
use ofborg::tasks::eval::{
stdenvs::Stdenvs, Error, EvaluationComplete, EvaluationStrategy, StepResult,
};
use ofborg::tasks::evaluate::update_labels;
use std::collections::HashMap;
use std::path::Path;
use tasks::evaluate::make_gist;
use uuid::Uuid;
pub struct NixpkgsStrategy<'a> {

View file

@ -1,5 +1,5 @@
use ofborg::files::file_to_str;
use ofborg::nix;
use crate::files::file_to_str;
use crate::nix;
use std::path::PathBuf;
enum StdenvFrom {

View file

@ -2,27 +2,28 @@
extern crate amqp;
extern crate env_logger;
extern crate uuid;
use crate::acl::ACL;
use crate::checkout;
use crate::commitstatus::{CommitStatus, CommitStatusError};
use crate::config::GithubAppVendingMachine;
use crate::files::file_to_str;
use crate::message::{buildjob, evaluationjob};
use crate::nix;
use crate::stats;
use crate::stats::Event;
use crate::systems;
use crate::tasks::eval;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use hubcaps;
use hubcaps::checks::CheckRunOptions;
use hubcaps::gists::Gists;
use hubcaps::issues::Issue;
use ofborg::acl::ACL;
use ofborg::checkout;
use ofborg::commitstatus::{CommitStatus, CommitStatusError};
use ofborg::config::GithubAppVendingMachine;
use ofborg::files::file_to_str;
use ofborg::message::{buildjob, evaluationjob};
use ofborg::nix;
use ofborg::stats;
use ofborg::stats::Event;
use ofborg::systems;
use ofborg::worker;
use std::collections::HashMap;
use std::path::Path;
use std::sync::RwLock;
use std::time::Instant;
use tasks::eval;
pub struct EvaluationWorker<E> {
cloner: checkout::CachedCloner,

View file

@ -1,13 +1,12 @@
extern crate amqp;
extern crate env_logger;
use ofborg::acl;
use ofborg::ghevent;
use serde_json;
use crate::acl;
use crate::ghevent;
use crate::message::{evaluationjob, Pr, Repo};
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::message::{evaluationjob, Pr, Repo};
use ofborg::worker;
use serde_json;
pub struct EvaluationFilterWorker {
acl: acl::ACL,
@ -107,7 +106,7 @@ impl worker::SimpleWorker for EvaluationFilterWorker {
#[cfg(test)]
mod tests {
use super::*;
use worker::SimpleWorker;
use crate::worker::SimpleWorker;
#[test]
fn changed_base() {

View file

@ -2,16 +2,15 @@ extern crate amqp;
extern crate env_logger;
extern crate uuid;
use ofborg::acl;
use ofborg::ghevent;
use serde_json;
use uuid::Uuid;
use crate::acl;
use crate::commentparser;
use crate::ghevent;
use crate::message::{buildjob, evaluationjob, Pr, Repo};
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use hubcaps;
use ofborg::commentparser;
use ofborg::message::{buildjob, evaluationjob, Pr, Repo};
use ofborg::worker;
use serde_json;
use uuid::Uuid;
pub struct GitHubCommentWorker {
acl: acl::ACL,

View file

@ -1,16 +1,15 @@
extern crate amqp;
extern crate env_logger;
use serde_json;
use crate::config::GithubAppVendingMachine;
use crate::message::buildjob::{BuildJob, QueuedBuildJobs};
use crate::message::buildresult::{BuildResult, BuildStatus, LegacyBuildResult};
use crate::message::Repo;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use chrono::{DateTime, Utc};
use hubcaps::checks::{CheckRunOptions, CheckRunState, Conclusion, Output};
use message::buildjob::{BuildJob, QueuedBuildJobs};
use ofborg::config::GithubAppVendingMachine;
use ofborg::message::buildresult::{BuildResult, BuildStatus, LegacyBuildResult};
use ofborg::message::Repo;
use ofborg::worker;
use serde_json;
pub struct GitHubCommentPoster {
github_vend: GithubAppVendingMachine,
@ -210,8 +209,8 @@ fn list_segment(name: &str, things: &[String]) -> Vec<String> {
#[cfg(test)]
mod tests {
use super::*;
use crate::message::{Pr, Repo};
use chrono::TimeZone;
use message::{Pr, Repo};
#[test]
pub fn test_queued_build() {

View file

@ -1,5 +1,11 @@
extern crate amqp;
extern crate env_logger;
use crate::message::buildlogmsg::{BuildLogMsg, BuildLogStart};
use crate::message::buildresult::BuildResult;
use crate::worker;
use crate::writetoline::LineWriter;
use amqp::protocol::basic::{BasicProperties, Deliver};
use lru_cache::LruCache;
use serde_json;
use std::fs;
@ -7,12 +13,6 @@ use std::fs::{File, OpenOptions};
use std::io::Write;
use std::path::{Component, PathBuf};
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::message::buildlogmsg::{BuildLogMsg, BuildLogStart};
use ofborg::message::buildresult::BuildResult;
use ofborg::worker;
use ofborg::writetoline::LineWriter;
#[derive(Eq, PartialEq, Hash, Debug, Clone)]
pub struct LogFrom {
routing_key: String,
@ -237,10 +237,10 @@ impl worker::SimpleWorker for LogMessageCollector {
#[cfg(test)]
mod tests {
use super::*;
use ofborg::message::buildresult::{BuildStatus, V1Tag};
use ofborg::message::{Pr, Repo};
use ofborg::test_scratch::TestScratch;
use ofborg::worker::SimpleWorker;
use crate::message::buildresult::{BuildStatus, V1Tag};
use crate::message::{Pr, Repo};
use crate::test_scratch::TestScratch;
use crate::worker::SimpleWorker;
use std::io::Read;
use std::path::PathBuf;

View file

@ -1,9 +1,9 @@
extern crate amqp;
extern crate env_logger;
use crate::stats;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::stats;
use ofborg::worker;
use serde_json;
pub struct StatCollectorWorker<E> {

View file

@ -84,7 +84,7 @@ impl LineWriter {
#[cfg(test)]
mod tests {
use super::*;
use ofborg::test_scratch::TestScratch;
use crate::test_scratch::TestScratch;
use std::fs::File;
use std::fs::OpenOptions;
use std::io::Read;