Skip to content

Commit

Permalink
feat: upgrade and aarch64 musl support (#93)
Browse files Browse the repository at this point in the history
* feat: upgrade and aarch64 musl support

* Committing WIP for git town undo

* feat: bump
  • Loading branch information
zifeo authored Oct 31, 2024
1 parent d883742 commit 2f72f76
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
suffix: ""
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: ".exe"
Expand Down
30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@ resolver = "2"

[package]
name = "lade"
version = "0.11.4-beta.1"
version = "0.11.4"
edition = "2021"
description = "Automatically load secrets from your preferred vault as environment variables, and clear them once your shell command is over."
license = "MPL-2.0"
repository = "https://github.com/zifeo/lade"

[dependencies]
anyhow = "1.0.83"
anyhow = "1.0.91"
self_update = { version = "0.41.0", features = [
"archive-tar",
"archive-zip",
"compression-flate2",
"compression-zip-deflate",
"compression-zip-bzip2",
] }
serde = { version = "1.0.201", features = ["derive"] }
serde = { version = "1.0.214", features = ["derive"] }
serde_yaml = "0.9.34"
clap = { version = "4.5.4", features = ["derive"] }
regex = "1.10.4"
lade-sdk = { path = "./sdk", version = "0.11.4-beta.1" }
clap = { version = "4.5.20", features = ["derive"] }
regex = "1.11.1"
lade-sdk = { path = "./sdk", version = "0.11.4" }
tokio = { version = "1", features = ["full"] }
indexmap = { version = "2.2.6", features = ["serde"] }
clap-verbosity-flag = "2.2.0"
env_logger = "0.11.3"
openssl = { version = "0.10.64", features = ["vendored"] }
serde_json = "1.0.117"
futures = "0.3.30"
indexmap = { version = "2.6.0", features = ["serde"] }
clap-verbosity-flag = "2.2.2"
env_logger = "0.11.5"
openssl = { version = "0.10.68", features = ["vendored"] }
serde_json = "1.0.132"
futures = "0.3.31"
path-clean = "1.0.1"
directories = "5.0.1"
chrono = { version = "0.4.38", features = ["serde"] }
log = "0.4.21"
log = "0.4.22"
semver = "1.0.23"
sysinfo = "0.30.12"
sysinfo = "0.32.0"
textwrap = "0.16.1"

[target.'cfg(target_family = "unix")'.dependencies]
nix = { version = "0.29.0", features = ["signal"] }

[dev-dependencies]
assert_cmd = "2.0.14"
assert_cmd = "2.0.16"
51 changes: 35 additions & 16 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,43 @@ OUT_DIR="${OUT_DIR:-/usr/local/bin}"
VERSION="${VERSION:-$LATEST_VERSION}"
MACHINE=$(uname -m)

if ldd --version 2>&1 | grep -q musl; then
LIBC="musl"
else
LIBC="gnu"
fi

if [ "${PLATFORM:-x}" = "x" ]; then
case "$(uname -s | tr '[:upper:]' '[:lower:]')" in
"linux")
case "$MACHINE" in
"arm64"* | "aarch64"* ) PLATFORM='aarch64-unknown-linux-gnu' ;;
*"64") PLATFORM='x86_64-unknown-linux-gnu' ;;
esac
;;
"darwin")
case "$MACHINE" in
"arm64"* | "aarch64"* ) PLATFORM='aarch64-apple-darwin' ;;
*"64") PLATFORM='x86_64-apple-darwin' ;;
esac
"linux")
case "$MACHINE" in
"arm64"* | "aarch64"*)
if [ "$LIBC" = "musl" ]; then
PLATFORM='aarch64-unknown-linux-musl'
else
PLATFORM='aarch64-unknown-linux-gnu'
fi
;;
"msys"*|"cygwin"*|"mingw"*|*"_nt"*|"win"*)
case "$MACHINE" in
*"64") PLATFORM='x86_64-pc-windows-msvc' ;;
esac
*"64")
if [ "$LIBC" = "musl" ]; then
PLATFORM='x86_64-unknown-linux-musl'
else
PLATFORM='x86_64-unknown-linux-gnu'
fi
;;
esac
;;
"darwin")
case "$MACHINE" in
"arm64"* | "aarch64"*) PLATFORM='aarch64-apple-darwin' ;;
*"64") PLATFORM='x86_64-apple-darwin' ;;
esac
;;
"msys"* | "cygwin"* | "mingw"* | *"_nt"* | "win"*)
case "$MACHINE" in
*"64") PLATFORM='x86_64-pc-windows-msvc' ;;
esac
;;
esac
if [ "${PLATFORM:-x}" = "x" ]; then
cat >&2 <<EOF
Expand All @@ -47,6 +65,7 @@ if [ "${PLATFORM:-x}" = "x" ]; then
To continue with installation, please choose from one of the following values:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-apple-darwin
Expand Down Expand Up @@ -106,7 +125,7 @@ fi

rm -r "$TMP_DIR"

OUT_DIR=$(realpath $OUT_DIR)
OUT_DIR=$(realpath "$OUT_DIR")
if [[ ":$PATH:" != *":$OUT_DIR:"* ]]; then
cat <<EOF
Expand Down
3 changes: 3 additions & 0 deletions lade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
^echo a:
A1: "1"

^echo a.+# production:
A1: "2"

^echo b:
B1: doppler://api.doppler.com/lade/dev/DOPPLER_A
B2: doppler://api.doppler.com/lade/dev/DOPPLER_B
Expand Down
6 changes: 3 additions & 3 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lade-sdk"
version = "0.11.4-beta.1"
version = "0.11.4"
edition = "2021"
description = "Lade SDK"
license = "MPL-2.0"
Expand All @@ -9,7 +9,7 @@ repository = "https://github.com/zifeo/lade"
[dependencies]
access-json = "0.1"
anyhow = "1"
async-process = "2.2"
async-process = "2.3"
async-trait = "0.1"
directories = "5"
futures = "0.3"
Expand All @@ -24,5 +24,5 @@ serde_yaml = "0.9"
tempfile = "3"
tokio = { version = "1", features = ["fs"] }
toml = "0.8"
url = "2.4"
url = "2.5"
urlencoding = "2"
2 changes: 1 addition & 1 deletion src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Shell {
let parent = sys
.process(process.parent().expect("no parent pid"))
.expect("parent pid does not exist");
let shell = parent.name().trim().to_lowercase();
let shell = parent.name().to_string_lossy().trim().to_lowercase();
let shell = shell.strip_suffix(".exe").unwrap_or(&shell); // windows bad

match shell {
Expand Down

0 comments on commit 2f72f76

Please sign in to comment.