feat: pack starmelon with upx

This commit is contained in:
YetAnotherMinion 2021-09-27 04:39:30 +01:00 committed by nobody
commit c845bf95a3
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
2 changed files with 20 additions and 1 deletions

15
default.upx.do Normal file
View file

@ -0,0 +1,15 @@
mkdir -p obj
case $1 in
"starmelon.upx")
git ls-files src | xargs redo-ifchange
cargo build --release >&2
cp ../../../target/release/starmelon obj/
strip obj/starmelon >&2;
upx -1 -o "$3" obj/starmelon >&2;
;;
*)
echo "no rule to build '$1'" >&2;
exit 1;
;;
esac

View file

@ -123,6 +123,7 @@ impl SetupError {
impl CompilerError { impl CompilerError {
pub fn to_doc(&self) -> Doc { pub fn to_doc(&self) -> Doc {
let mut title = "COMPILER ERROR";
use CompilerError::*; use CompilerError::*;
let message = match self { let message = match self {
MissingElmJson(io_err) => Doc::text("TODO missing elm.json"), MissingElmJson(io_err) => Doc::text("TODO missing elm.json"),
@ -140,7 +141,10 @@ impl CompilerError {
//) //)
} }
FailedBuildingFixture => Doc::text("TODO failed building fixture elm"), FailedBuildingFixture => Doc::text("TODO failed building fixture elm"),
ReadInputFailed(io_err, path) => Doc::text("TODO read file failed"), ReadInputFailed(io_err, path) => {
title = "IO ERROR";
Doc::text("TODO read file failed")
},
WriteOutputFailed(io_err, path) => { WriteOutputFailed(io_err, path) => {
Doc::text(format!("TODO write file failed {:?} {:?}", io_err, path)) Doc::text(format!("TODO write file failed {:?} {:?}", io_err, path))
} }