Skip to content

Commit

Permalink
update ubuntu build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtgs committed Aug 15, 2024
1 parent 2a9404a commit 94641a7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,22 @@ async fn generate_dispatcher() -> io::Result<()> {
let path = format!(
"./modules/linux-dispatcher/target/{target}/linux-dispatcher/linux-dispatcher"
);
// try to UPX
Command::new("upx").args(["--best", &*path]);

Command::new("upx")
.args(["--best", &*path])
.status()
.await?
.success()
.then_some(())
.ok_or_else(|| {
io::Error::other("failed to pack linux-dispatcher, make sure upx is installed")
})?;

eprintln!(
"{:?}",
std::fs::read_dir(&*path).and_then(|x| x.collect::<Result<Vec<_>, _>>())
);

tokio::fs::try_exists(&path)
.await?
.then_some(path)
Expand Down

0 comments on commit 94641a7

Please sign in to comment.