Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename release executables to allow for scripting on Unix #559

Open
sanmai-NL opened this issue Oct 4, 2023 · 5 comments
Open

Rename release executables to allow for scripting on Unix #559

sanmai-NL opened this issue Oct 4, 2023 · 5 comments
Labels
feature request A new lefthook feature description

Comments

@sanmai-NL
Copy link
Contributor

⚡ Summary

The hardware platform suffix for Linux builds is now amd64 or arm64. Change this for more reliable automation in provisioning.

Value

Make container builds work with automated fetching of the released Lefthook executable, even under virtualized Linux such as Docker Desktop, Rancher Desktop, Podman Desktop on MacOS.

Behavior and configuration changes

The problem:

/ # uname -m
aarch64
/ # uname -h
BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.

Usage: uname [-amnrspvio]

Print system information

        -a      Print all
        -m      Machine (hardware) type
        -n      Hostname
        -r      Kernel release
        -s      Kernel name (default)
        -p      Processor type
        -v      Kernel version
        -i      Hardware platform
        -o      OS name
/ # uname -p
unknown
/ # uname -i
unknown

Follow uname -m as hardware platform suffix. So that this script works:

#!/bin/sh
set -eux
curl \
  --fail \
  --location \
  --output /usr/local/bin/lefthook \
  --proto '=https' \
  --show-error \
  --silent \
  --tlsv1.3 \
  -- \
  "https://github.com/evilmartians/lefthook/releases/download/v1.4.9/lefthook_1.4.9_Linux_$(uname -m)"
chmod \
  a+x \
  -- \
  /usr/local/bin/lefthook
@sanmai-NL sanmai-NL added the feature request A new lefthook feature description label Oct 4, 2023
@mrexox
Copy link
Member

mrexox commented Oct 5, 2023

We decided to keep arm64 for ARM 64 architectures, so please, use uname -m | sed 's/aarch64/arm64/. This is because on macOS uname -m returns arm64, and on Linux it is aarch64. The decision was made a long time ago, and I don't want to change this to not break the things.

But I can probably add an artifact with aarch64 name in new releases. Do you feel OK about it?

@sanmai-NL
Copy link
Contributor Author

The suffix can be Linux-only, no?

@sanmai-NL
Copy link
Contributor Author

@mrexox adding a duplicate artifact is fine. What about migrating to the new suffix scheme for new releases only? How would that break things?

@mrexox
Copy link
Member

mrexox commented Oct 24, 2023

It probably won't break things if other people don't rely on this of course. So, you suggest to change the artifact lefthook_1.5.2_Linux_arm64 to lefthook_1.5.2_Linux_aarch64, right?

@sanmai-NL
Copy link
Contributor Author

Well that but only for future releases, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new lefthook feature description
Projects
None yet
Development

No branches or pull requests

2 participants