Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Respect the lockfile [#948](https://github.com/paritytech/cargo-contract/pull/948)

## [2.0.0-rc.1] - 2023-02-01
Second release candidate compatible with `ink! 4.0.0-rc`.

Expand Down
19 changes: 17 additions & 2 deletions crates/build/src/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl Workspace {
.tempdir()?;
tracing::debug!("Using temp workspace at '{}'", tmp_dir.path().display());
let new_paths = self.write(&tmp_dir)?;
let root_manifest_path = new_paths
let tmp_root_manifest_path = new_paths
.iter()
.find_map(|(pid, path)| {
if *pid == self.root_package {
Expand All @@ -210,6 +210,21 @@ impl Workspace {
}
})
.expect("root package should be a member of the temp workspace");
f(root_manifest_path)

// copy the `Cargo.lock` file
let src_lockfile = self.workspace_root.clone().join("Cargo.lock");
let dest_lockfile = tmp_root_manifest_path
.absolute_directory()?
.join("Cargo.lock");
if src_lockfile.exists() {
tracing::debug!(
"Copying '{}' to ' '{}'",
src_lockfile.display(),
dest_lockfile.display()
);
std::fs::copy(src_lockfile, dest_lockfile)?;
}

f(tmp_root_manifest_path)
}
}