feat: with updated dagger-sdk
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -4,12 +4,12 @@ use crate::source::RustSource;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct RustBuild {
|
||||
client: Arc<dagger_sdk::Query>,
|
||||
client: dagger_sdk::Query,
|
||||
registry: Option<String>,
|
||||
}
|
||||
|
||||
impl RustBuild {
|
||||
pub fn new(client: Arc<dagger_sdk::Query>) -> Self {
|
||||
pub fn new(client: dagger_sdk::Query) -> Self {
|
||||
Self {
|
||||
client,
|
||||
registry: None,
|
||||
@@ -60,9 +60,9 @@ impl RustBuild {
|
||||
}
|
||||
let rust_prebuild = rust_build_image
|
||||
.with_workdir("/mnt/src")
|
||||
.with_directory("/mnt/src", dep_src.id().await?)
|
||||
.with_directory("/mnt/src", dep_src)
|
||||
.with_exec(build_options)
|
||||
.with_mounted_cache("/mnt/src/target/", target_cache.id().await?);
|
||||
.with_mounted_cache("/mnt/src/target/", target_cache);
|
||||
|
||||
let incremental_dir = rust_source
|
||||
.get_rust_target_src(&source, rust_prebuild.clone(), crates.to_vec())
|
||||
@@ -72,10 +72,10 @@ impl RustBuild {
|
||||
.with_workdir("/mnt/src")
|
||||
.with_directory(
|
||||
"/usr/local/cargo",
|
||||
rust_prebuild.directory("/usr/local/cargo").id().await?,
|
||||
rust_prebuild.directory("/usr/local/cargo"),
|
||||
)
|
||||
.with_directory("/mnt/src/target", incremental_dir.id().await?)
|
||||
.with_directory("/mnt/src/", src.id().await?);
|
||||
.with_directory("/mnt/src/target", incremental_dir)
|
||||
.with_directory("/mnt/src/", src);
|
||||
|
||||
Ok(rust_with_src)
|
||||
}
|
||||
@@ -210,10 +210,10 @@ impl RustBuild {
|
||||
.with_exec(packages);
|
||||
|
||||
let final_image = base_debian
|
||||
.with_file(format!("/usr/local/bin/{}", bin_name), bin.id().await?)
|
||||
.with_file(format!("/usr/local/bin/{}", bin_name), bin)
|
||||
.with_exec(vec![bin_name, "--help"]);
|
||||
|
||||
final_image.exit_code().await?;
|
||||
final_image.sync().await?;
|
||||
|
||||
Ok(final_image)
|
||||
}
|
||||
@@ -238,8 +238,7 @@ impl RustBuild {
|
||||
packages.extend_from_slice(production_deps);
|
||||
let base_debian = base_debian.with_exec(packages);
|
||||
|
||||
let final_image =
|
||||
base_debian.with_file(format!("/usr/local/bin/{}", bin_name), bin.id().await?);
|
||||
let final_image = base_debian.with_file(format!("/usr/local/bin/{}", bin_name), bin);
|
||||
|
||||
Ok(final_image)
|
||||
}
|
||||
|
Reference in New Issue
Block a user