Skip to content

Commit

Permalink
Round two of fixing #124
Browse files Browse the repository at this point in the history
This time, the path was being canonicalized in another location. My
original verification apparently did not account for this.

All calls to `canonicalize` have been audited, and every location where
such is called, it is also expected that the path exist, and is indeed
considered an error if it does not exist.
  • Loading branch information
thedodd committed Feb 10, 2021
1 parent 1a497f5 commit da9b1fb
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 46 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe

## Unreleased

## 0.8.1
## 0.8.2 & 0.8.1
### fixed
- Fixed [#124](https://github.com/thedodd/trunk/issues/124) where path canonicalization was being performed on a path which did not yet exist, and as it turns out was already in canonical form.

Expand Down
80 changes: 40 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trunk"
version = "0.8.1"
version = "0.8.2"
edition = "2018"
description = "Build, bundle & ship your Rust WASM application to the web."
license = "MIT/Apache-2.0"
Expand Down
5 changes: 1 addition & 4 deletions src/pipelines/rust_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ impl RustApp {
async fn cargo_build(&mut self) -> Result<(PathBuf, String)> {
self.progress.set_message(&format!("building {}", &self.manifest.package.name));
if let Some(chan) = &mut self.ignore_chan {
let target_dir = async_std::fs::canonicalize(&self.manifest.metadata.target_directory)
.await
.context("error taking canonical path to cargo target dir")?;
let _ = chan.try_send(target_dir.into());
let _ = chan.try_send(self.manifest.metadata.target_directory.clone());
}

// Spawn the cargo build process.
Expand Down

0 comments on commit da9b1fb

Please sign in to comment.