From 8a7ca102101ffc2514ba31504c2c037e986e88f5 Mon Sep 17 00:00:00 2001 From: J H <2364004+Blu-J@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:24:56 -0600 Subject: [PATCH] Fixes: Builds for the macs --- Makefile | 5 +++-- backend/Cargo.toml | 2 +- backend/README.md | 3 ++- compress-uis.sh | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a6d73e8195..68ef34f68d 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ FRONTEND_DIAGNOSTIC_UI_SRC := $(shell find frontend/projects/diagnostic-ui) FRONTEND_INSTALL_WIZARD_SRC := $(shell find frontend/projects/install-wizard) PATCH_DB_CLIENT_SRC := $(shell find patch-db/client -not -path patch-db/client/dist -and -not -path patch-db/client/node_modules) GZIP_BIN := $(shell which pigz || which gzip) +TAR_BIN := $(shell which gtar || which tar) ALL_TARGETS := $(EMBASSY_BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar $(EMBASSY_SRC) $(shell if [ "$(OS_ARCH)" = "raspberrypi" ]; then echo cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep; fi) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) ifeq ($(REMOTE),) @@ -26,11 +27,11 @@ ifeq ($(REMOTE),) cp = cp -r $1 $2 ln = ln -sf $1 $2 else - mkdir = ssh $(REMOTE) 'mkdir -p $1' + mkdir = ssh $(REMOTE) 'sudo mkdir -p $1' rm = ssh $(REMOTE) 'sudo rm -rf $1' ln = ssh $(REMOTE) 'sudo ln -sf $1 $2' define cp - tar --transform "s|^$1|x|" -czv -f- $1 | ssh $(REMOTE) "sudo tar --transform 's|^x|$2|' -xzv -f- -C /" + $(TAR_BIN) --transform "s|^$1|x|" -czv -f- $1 | ssh $(REMOTE) "sudo tar --transform 's|^x|$2|' -xzv -f- -C /" endef endif diff --git a/backend/Cargo.toml b/backend/Cargo.toml index d4b4e30add..99e449ab8d 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -26,7 +26,7 @@ path = "src/main.rs" [features] avahi = ["avahi-sys"] -default = ["avahi-alias", "cli", "sdk", "daemon", "js_engine"] +default = ["cli", "sdk", "daemon", "js_engine"] dev = [] unstable = ["patch-db/unstable"] avahi-alias = ["avahi"] diff --git a/backend/README.md b/backend/README.md index 986972efd9..01d0b2a4db 100644 --- a/backend/README.md +++ b/backend/README.md @@ -5,6 +5,7 @@ - Recommended: [rust-analyzer](https://rust-analyzer.github.io/) - [Docker](https://docs.docker.com/get-docker/) - [Rust ARM64 Build Container](https://github.com/Start9Labs/rust-arm-builder) + - Mac `brew install gnu-tar` - Scripts (run within the `./backend` directory) - `build-prod.sh` - compiles a release build of the artifacts for running on ARM64 @@ -12,7 +13,7 @@ ## Structure -The StartOS backend is packed into a single binary `startbox` that is symlinked under +The StartOS backend is packed into a single binary `startbox` that is symlinked under several different names for different behaviour: - startd: This is the main workhorse of StartOS - any new functionality you diff --git a/compress-uis.sh b/compress-uis.sh index 964ddeb574..aa9ec3530e 100755 --- a/compress-uis.sh +++ b/compress-uis.sh @@ -8,9 +8,9 @@ find frontend/dist/raw -type f -not -name '*.gz' -and -not -name '*.br' | xargs find frontend/dist/raw -type f -not -name '*.gz' -and -not -name '*.br' | xargs -n 1 -P 0 brotli -kf for file in $(find frontend/dist/raw -type f -not -name '*.gz' -and -not -name '*.br'); do - raw_size=$(du --bytes $file | awk '{print $1}') - gz_size=$(du --bytes $file.gz | awk '{print $1}') - br_size=$(du --bytes $file.br | awk '{print $1}') + raw_size=$(expr $(du $file | awk '{print $1}') \* 512) + gz_size=$(expr $(du $file.gz | awk '{print $1}') \* 512 ) + br_size=$(expr $(du $file.br | awk '{print $1}') \* 512 ) if [ $((gz_size * 100 / raw_size)) -gt 70 ]; then rm $file.gz fi