Skip to content

Commit

Permalink
Merge branch 'main' into dev/opensk
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 committed Jul 31, 2024
2 parents 45b37e7 + 5df9140 commit 58b101c
Show file tree
Hide file tree
Showing 33 changed files with 2,360 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "third_party/rust-lang/rustup"]
path = third_party/rust-lang/rustup
url = https://github.com/rust-lang/rustup.git
[submodule "third_party/wasm3/wasm-coremark"]
path = third_party/wasm3/wasm-coremark
url = https://github.com/wasm3/wasm-coremark.git
6 changes: 6 additions & 0 deletions crates/cli-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.1.1-git

### Minor

- Change the behavior of `fs::copy_if_changed()` to keep an original source

## 0.1.0

<!-- Increment to skip CHANGELOG.md test: 0 -->
2 changes: 1 addition & 1 deletion crates/cli-tools/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 crates/cli-tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasefire-cli-tools"
version = "0.1.0"
version = "0.1.1-git"
authors = ["Julien Cretin <cretin@google.com>"]
license = "Apache-2.0"
publish = true
Expand Down
13 changes: 11 additions & 2 deletions crates/cli-tools/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,18 @@ pub fn copy(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<u64> {
}

pub fn copy_if_changed(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<bool> {
let changed = !exists(&dst) || metadata(&dst)?.modified()? < metadata(&src)?.modified()?;
let dst_orig = dst.as_ref().with_added_extension("orig");
let mut changed = !exists(&dst)
|| metadata(&dst)?.modified()? < metadata(&src)?.modified()?
|| !exists(&dst_orig);
if !changed {
let src_data = std::fs::read(&src)?;
let dst_data = std::fs::read(&dst_orig)?;
changed = src_data != dst_data;
}
if changed {
copy(src, dst)?;
copy(&src, dst)?;
std::fs::copy(src, dst_orig)?;
}
Ok(changed)
}
Expand Down
2 changes: 2 additions & 0 deletions crates/cli-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
//!
//! This library is also used for the internal maintenance CLI of Wasefire called xtask.

#![feature(path_add_extension)]

macro_rules! debug {
($($x:tt)*) => {
print!("\x1b[1;36m");
Expand Down
1 change: 1 addition & 0 deletions crates/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Patch

- Update dependencies
- Restore release builds to the default

## 0.1.1
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/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 crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ clap_complete = { version = "4.5.2", default-features = false }
data-encoding = { version = "2.6.0", default-features = false, features = ["std"] }
humantime = { version = "2.1.0", default-features = false }
rusb = { version = "0.9.4", default-features = false }
wasefire-cli-tools = { version = "0.1.0", path = "../cli-tools" }
wasefire-cli-tools = { version = "0.1.1-git", path = "../cli-tools" }
wasefire-protocol = { version = "0.1.0", path = "../protocol", features = ["host"] }
wasefire-protocol-usb = { version = "0.1.0", path = "../protocol-usb", features = ["host"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/protocol/crates/schema/Cargo.lock

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

3 changes: 3 additions & 0 deletions crates/wasm-bench/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[target.thumbv7em-none-eabi]
runner = "probe-rs run --chip=nRF52840_xxAA"
rustflags = ["-Clink-arg=-Tlink.x"]
Loading

0 comments on commit 58b101c

Please sign in to comment.