diff --git a/cargo-concordium/Cargo.lock b/cargo-concordium/Cargo.lock index ff881140..fabe177c 100644 --- a/cargo-concordium/Cargo.lock +++ b/cargo-concordium/Cargo.lock @@ -299,7 +299,7 @@ dependencies = [ [[package]] name = "cargo-concordium" -version = "3.1.2" +version = "3.1.3" dependencies = [ "ansi_term", "anyhow", diff --git a/cargo-concordium/Cargo.toml b/cargo-concordium/Cargo.toml index e44ee51d..27e24cac 100644 --- a/cargo-concordium/Cargo.toml +++ b/cargo-concordium/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-concordium" -version = "3.1.2" +version = "3.1.3" authors = ["Concordium "] edition = "2021" license-file = "../LICENSE" diff --git a/cargo-concordium/README.md b/cargo-concordium/README.md index 30fbacbe..ab951d11 100644 --- a/cargo-concordium/README.md +++ b/cargo-concordium/README.md @@ -93,6 +93,7 @@ of the package root subject to the following - the package build directory (typically `target`) will be ignored - additional files listed in any `.ignore` files will be ignored. The format of this file should be the same as a `.gitignore` file. +- hidden files are ignored. Information about the sources and the build will be embedded into `contract.wasm.v1` file. This information includes diff --git a/cargo-concordium/src/build.rs b/cargo-concordium/src/build.rs index 0f5410e0..6823b446 100644 --- a/cargo-concordium/src/build.rs +++ b/cargo-concordium/src/build.rs @@ -152,7 +152,7 @@ fn create_archive( .git_global(true) .git_ignore(true) .parents(true) - .hidden(false) + .hidden(true) .sort_by_file_path(std::cmp::Ord::cmp) .build(); let mut lock_file_found = false; @@ -488,6 +488,13 @@ pub fn build_contract( tar_filename.push(".tar"); tar_filename.into() }; + let mut package_target_dir = metadata.target_directory.as_std_path().to_path_buf(); + if package_target_dir + .try_exists() + .context("Unable to check if target directory exists.")? + { + package_target_dir = package_target_dir.canonicalize()?; + }; let ContainerBuildOutput { output_wasm, build_info, @@ -495,11 +502,7 @@ pub fn build_contract( } = build_in_container( image, PackageData { - package_target_dir: metadata - .target_directory - .as_std_path() - .canonicalize()? - .as_path(), + package_target_dir: package_target_dir.as_path(), package_root_path: package_root_path.as_path(), package_version_string: &package_version_string, }, diff --git a/cargo-concordium/src/main.rs b/cargo-concordium/src/main.rs index 6507b5b6..13914db4 100644 --- a/cargo-concordium/src/main.rs +++ b/cargo-concordium/src/main.rs @@ -613,7 +613,7 @@ const WARNING_STYLE: ansi_term::Color = ansi_term::Color::Yellow; pub fn main() -> anyhow::Result<()> { #[cfg(target_os = "windows")] { - ansi_term::enable_ansi_support(); + let _ = ansi_term::enable_ansi_support(); } let cmd = { let app = CargoCommand::clap()