Skip to content

Commit

Permalink
Merge pull request #156 from Jenkins-J/ppc64le-support
Browse files Browse the repository at this point in the history
Add ppc64le support
  • Loading branch information
Muscraft authored Jan 13, 2024
2 parents e04165e + 557d703 commit b1268c2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions 1.75.0/bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN set -eux; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
ppc64el) rustArch='powerpc64le-unknown-linux-gnu'; rustupSha256='1032934fb154ad2d365e02dcf770c6ecfaec6ab2987204c618c21ba841c97b44' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
Expand Down
1 change: 1 addition & 0 deletions 1.75.0/bookworm/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN set -eux; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
ppc64el) rustArch='powerpc64le-unknown-linux-gnu'; rustupSha256='1032934fb154ad2d365e02dcf770c6ecfaec6ab2987204c618c21ba841c97b44' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
Expand Down
1 change: 1 addition & 0 deletions 1.75.0/bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN set -eux; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
ppc64el) rustArch='powerpc64le-unknown-linux-gnu'; rustupSha256='1032934fb154ad2d365e02dcf770c6ecfaec6ab2987204c618c21ba841c97b44' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
Expand Down
1 change: 1 addition & 0 deletions 1.75.0/bullseye/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN set -eux; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
ppc64el) rustArch='powerpc64le-unknown-linux-gnu'; rustupSha256='1032934fb154ad2d365e02dcf770c6ecfaec6ab2987204c618c21ba841c97b44' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
Expand Down
29 changes: 23 additions & 6 deletions x.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
DebianArch("i386", "i386", "i686-unknown-linux-gnu"),
]

debian_non_buster_arches = [
DebianArch("ppc64le", "ppc64el", "powerpc64le-unknown-linux-gnu"),
]

debian_variants = [
"buster",
"bullseye",
Expand Down Expand Up @@ -62,25 +66,34 @@ def update_debian():
for arch in debian_arches:
hash = rustup_hash(arch.rust)
arch_case += f" {arch.dpkg}) rustArch='{arch.rust}'; rustupSha256='{hash}' ;; \\\n"
arch_case += ' *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \\\n'
arch_case += ' esac'

end = ' *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \\\n'
end += ' esac'

template = read_file("Dockerfile-debian.template")
slim_template = read_file("Dockerfile-slim.template")

for variant in debian_variants:
case = arch_case
if variant != "buster":
for arch in debian_non_buster_arches:
hash = rustup_hash(arch.rust)
case += f" {arch.dpkg}) rustArch='{arch.rust}'; rustupSha256='{hash}' ;; \\\n"

case += end

rendered = template \
.replace("%%RUST-VERSION%%", rust_version) \
.replace("%%RUSTUP-VERSION%%", rustup_version) \
.replace("%%DEBIAN-SUITE%%", variant) \
.replace("%%ARCH-CASE%%", arch_case)
.replace("%%ARCH-CASE%%", case)
write_file(f"{rust_version}/{variant}/Dockerfile", rendered)

rendered = slim_template \
.replace("%%RUST-VERSION%%", rust_version) \
.replace("%%RUSTUP-VERSION%%", rustup_version) \
.replace("%%DEBIAN-SUITE%%", variant) \
.replace("%%ARCH-CASE%%", arch_case)
.replace("%%ARCH-CASE%%", case)
write_file(f"{rust_version}/{variant}/slim/Dockerfile", rendered)

def update_alpine():
Expand Down Expand Up @@ -170,9 +183,13 @@ def generate_stackbrew_library():
tags.append(version_tag)
tags.append("latest")

arches = debian_arches[:]
if variant != "buster":
arches += debian_non_buster_arches

library += single_library(
tags,
map(lambda a: a.bashbrew, debian_arches),
map(lambda a: a.bashbrew, arches),
os.path.join(rust_version, variant))

tags = []
Expand All @@ -186,7 +203,7 @@ def generate_stackbrew_library():

library += single_library(
tags,
map(lambda a: a.bashbrew, debian_arches),
map(lambda a: a.bashbrew, arches),
os.path.join(rust_version, variant, "slim"))

for version in alpine_versions:
Expand Down

0 comments on commit b1268c2

Please sign in to comment.