-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean build previous artifacts after successful build #69
Conversation
if entry.path().to_string_lossy() != bindgen_out.to_string_lossy() { | ||
let path = entry.path(); | ||
if path.is_dir().await { | ||
fs::remove_dir_all(&path).await.context("Deleting directory after build failed")? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't reliable on Windows. We should use something like https://github.com/XAMPPRocky/remove_dir_all.
See https://blog.qwaz.io/chat/issues-of-rusts-remove-dir-all-implementation-on-windows for more info.
Note: The comment is valid for all fs::remove_dir_all
calls in the code-base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MartinKavik do you know if that applies to just the std
implementation, or also to the async_std::remove_dir_all implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the async-std source code (https://github.com/async-rs/async-std/blob/master/src/fs/remove_dir_all.rs#L31-L38), it doesn't seem to do that. It just uses std::fs
implementation directly, and exposes it in an async way. So I don't think it would work in async-std
either
// wasm-bindgen build succeeded so delete everything in `dist`, | ||
// copy everything from `dist/.current` to `dist` and | ||
// delete `dist/.current` | ||
let mut entries = fs::read_dir(self.bindgen_out.as_path()).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be walking target/wasm-bindgen/debug
instead of dist
.
Superseded by #108 |
Closes #49
This is a recreation of my previous PR #61. I had to recreate this because I mess up (to my knowledge, irreversibly) on the last (
master
) branch. I apologize for any inconvenience I caused.Checklist