Skip to content

Commit

Permalink
Added support for armv7l
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauszus committed Dec 11, 2024
1 parent 7c2c0c9 commit ccc5caf
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ __pycache__/

# Our Sphinx extension (see: docs/_ext/) dynamically generates doc sources here.
/docs/_/

# IntelliJ projects.
.idea/
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 0.9.0

This release adds support for Linux ARM (armv7l and armv8l 32 bit mode).

## 0.8.2

Upgrade the science internal Python distribution to [PBS][PBS] CPython 3.12.8.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You'll need to download the correct binary for your system, mark it as executabl
your $PATH somewhere.

The binaries are released via [GitHub Releases](https://github.com/a-scie/lift/releases)
for Windows, Linux and macOS for both aarch64 and x86-64. For each of these platforms
for Windows, Linux and macOS for both armv7l (Linux only), aarch64 and x86-64. For each of these platforms
there are two varieties, "thin" and "fat". The "fat" varieties are named `science-fat-*`, include
a hermetic CPython 3.12 distribution from the [Python Build Standalone]() project and are larger as
a result. The "thin" varieties have the CPython 3.12 distribution gouged out and are smaller as a
Expand Down
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function determine_arch() {
amd64*) echo "x86_64" ;;
arm64*) echo "aarch64" ;;
aarch64*) echo "aarch64" ;;
armv7l*) echo "armv7l" ;;
armv8l*) echo "armv7l" ;;
*) die "unknown arch: ${read_arch}" ;;
esac
}
Expand Down
3 changes: 3 additions & 0 deletions science/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class Platform(Enum):
Linux_aarch64 = "linux-aarch64"
Linux_armv7l = "linux-armv7l"
Linux_x86_64 = "linux-x86_64"
Macos_aarch64 = "macos-aarch64"
Macos_x86_64 = "macos-x86_64"
Expand All @@ -33,6 +34,8 @@ def current(cls) -> Platform:
match (system := platform.system().lower(), machine := platform.machine().lower()):
case ("linux", "aarch64" | "arm64"):
return cls.Linux_aarch64
case ("linux", "armv7l" | "armv8l"):
return cls.Linux_armv7l
case ("linux", "amd64" | "x86_64"):
return cls.Linux_x86_64
case ("darwin", "aarch64" | "arm64"):
Expand Down
4 changes: 4 additions & 0 deletions science/providers/python_build_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def rank_compatibility(platform: Platform, target_triple: str) -> int | None:
match target_triple:
case "aarch64-unknown-linux-gnu":
return 0
case Platform.Linux_armv7l:
match target_triple:
case "armv7-unknown-linux-gnueabihf":
return 0
case Platform.Linux_x86_64:
match target_triple:
case "x86_64-unknown-linux-gnu":
Expand Down

0 comments on commit ccc5caf

Please sign in to comment.