fix: update dependencies

fix: cargo fmt
pull/19/head
Amin Yahyaabadi 2 years ago
parent 90dc08d452
commit 7cc3342221

1012
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -13,14 +13,14 @@ categories = ["development-tools::build-utils", "api-bindings"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
[dependencies] [dependencies]
either = "1.6" either = "1.6.1"
failure = "0.1" failure = "0.1.8"
lazy_static = "1" lazy_static = "1.4.0"
log = "0.4" log = "0.4.14"
prost = "0.6" prost = "0.9.0"
regex = "1" regex = "1.5.4"
serde_json = "1.0" serde_json = "1.0.79"
sha2 = "0.8" sha2 = "0.10.2"
[dependencies.buildkit-proto] [dependencies.buildkit-proto]
version = "0.2" version = "0.2"

@ -1,5 +1,6 @@
#![deny(warnings)] #![deny(warnings)]
#![deny(clippy::all)] #![deny(clippy::all)]
#![allow(dead_code)]
// FIXME: get rid of the unwraps // FIXME: get rid of the unwraps
// TODO: implement warnings for op hash collisions (will incredibly help to debug problems). // TODO: implement warnings for op hash collisions (will incredibly help to debug problems).

@ -23,8 +23,8 @@ impl Node {
pub fn get_digest(bytes: &[u8]) -> String { pub fn get_digest(bytes: &[u8]) -> String {
let mut hasher = Sha256::new(); let mut hasher = Sha256::new();
hasher.input(&bytes); hasher.update(&bytes);
format!("sha256:{:x}", hasher.result()) format!("sha256:{:x}", hasher.finalize())
} }
} }

@ -13,12 +13,12 @@ categories = ["development-tools::build-utils", "api-bindings"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
[dependencies] [dependencies]
prost = "0.6" prost = "0.9.0"
prost-types = "0.6" prost-types = "0.9.0"
tonic = { git = "https://github.com/edrevo/tonic", branch = "unimplemented-content-type" } tonic = { git = "https://github.com/aminya/tonic", branch = "master" }
[build-dependencies.tonic-build] [build-dependencies.tonic-build]
git = "https://github.com/edrevo/tonic" git = "https://github.com/aminya/tonic"
branch = "unimplemented-content-type" branch = "master"
default-features = false default-features = true
features = ["prost", "transport"] features = ["prost", "transport"]

@ -5,23 +5,24 @@ authors = ["Ximo Guanter <ximo.guanter@gmail.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
anyhow = "1" anyhow = "1.0.54"
async-trait = "0.1" async-trait = "0.1.52"
crossbeam = "0.7" crossbeam = "0.8.1"
either = "1" either = "1.6.1"
env_logger = "0.8" env_logger = "0.9.0"
futures = "0.3" futures = "0.3.21"
libc = "0.2" libc = "0.2.119"
mio = "0.6" mio = "0.6.21"
pin-project = "1" pin-project = "1.0.10"
prost = "0.6" prost = "0.9.0"
prost-types = "0.6" prost-types = "0.9.0"
regex = "1.3" regex = "1.5.4"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1" serde_json = "1.0.79"
tokio = { version = "0.2", features = ["macros", "rt-core", "rt-threaded"] } tokio = { version = "1.17.0", features = ["macros", "rt", "rt-multi-thread"] }
tonic = { git = "https://github.com/edrevo/tonic", branch = "unimplemented-content-type" } tokio-stream = "*"
tower = "0.3" tonic = { git = "https://github.com/aminya/tonic", branch = "master" }
url = "2.2" tower = "0.4.12"
url = "2.2.2"
buildkit-llb = { version = "0.2", path = "../buildkit-llb" } buildkit-llb = { version = "0.2", path = "../buildkit-llb" }
buildkit-proto = { version = "0.2", path = "../buildkit-proto" } buildkit-proto = { version = "0.2", path = "../buildkit-proto" }

@ -5,7 +5,7 @@ use anyhow::Result;
use buildkit_proto::moby::buildkit::v1::frontend::{ use buildkit_proto::moby::buildkit::v1::frontend::{
self, llb_bridge_client::LlbBridgeClient, llb_bridge_server::LlbBridge, self, llb_bridge_client::LlbBridgeClient, llb_bridge_server::LlbBridge,
}; };
use crossbeam::{channel, Sender}; use crossbeam::{channel, channel::Sender};
use frontend::{llb_bridge_server::LlbBridgeServer, ReadFileResponse}; use frontend::{llb_bridge_server::LlbBridgeServer, ReadFileResponse};
use tokio::sync::RwLock; use tokio::sync::RwLock;
use tonic::{transport::Channel, transport::Server, Request, Response}; use tonic::{transport::Channel, transport::Server, Request, Response};
@ -38,7 +38,7 @@ impl DockerfileFrontend {
self.dockerfile_name.clone(), self.dockerfile_name.clone(),
dockerfile_contents.as_bytes().to_vec(), dockerfile_contents.as_bytes().to_vec(),
))) )))
.serve_with_incoming(tokio::stream::once(StdioSocket::try_new_rw( .serve_with_incoming(tokio_stream::once(StdioSocket::try_new_rw(
dockerfile_front.stdout.take().unwrap(), dockerfile_front.stdout.take().unwrap(),
dockerfile_front.stdin.take().unwrap(), dockerfile_front.stdin.take().unwrap(),
))) )))

@ -117,17 +117,17 @@ async fn dockerfile_trap(
let context_layer = solve(&mut client, Terminal::with(context_source.output())).await?; let context_layer = solve(&mut client, Terminal::with(context_source.output())).await?;
fn replace( fn replace(
l : & String, l: &String,
r : &mut Vec<String>, r: &mut Vec<String>,
c : &mut LlbBridgeClient<Channel>, c: &mut LlbBridgeClient<Channel>,
ctx : & String ctx: &String,
) -> Result<()> { ) -> Result<()> {
if let Some(file_path) = l.trim().strip_prefix(INCLUDE_COMMAND) { if let Some(file_path) = l.trim().strip_prefix(INCLUDE_COMMAND) {
let bytes = executor::block_on(read_file(c, &ctx, file_path.trim_start().to_string(), None)) let bytes = executor::block_on(read_file(c, &ctx, file_path.trim_start().to_string(), None))
.with_context(|| format!("Could not read file \"{}\". Remember that the file path is relative to the build context, not the Dockerfile path.", file_path))?; .with_context(|| format!("Could not read file \"{}\". Remember that the file path is relative to the build context, not the Dockerfile path.", file_path))?;
//recurse //recurse
for l2 in std::str::from_utf8(&bytes)?.to_string().lines() { for l2 in std::str::from_utf8(&bytes)?.to_string().lines() {
replace(&l2.to_string(), r, c, &ctx)? ; replace(&l2.to_string(), r, c, &ctx)?;
} }
} else { } else {
r.push(l.to_string()); r.push(l.to_string());
@ -136,7 +136,7 @@ async fn dockerfile_trap(
} }
for line in dockerfile_contents.lines() { for line in dockerfile_contents.lines() {
replace(&line.to_string(), &mut result, &mut client, &context_layer)? ; replace(&line.to_string(), &mut result, &mut client, &context_layer)?;
} }
let dockerfile_contents = result.join("\n"); let dockerfile_contents = result.join("\n");
dockerfile_frontend.solve(&dockerfile_contents).await dockerfile_frontend.solve(&dockerfile_contents).await

Loading…
Cancel
Save