8000 Apply upstream patch to have more archs to build · sudo-bot/docker-rustpython@40c800a · GitHub
[go: up one dir, main page]

Skip to content

Commit 40c800a

Browse files
committed
Apply upstream patch to have more archs to build
RustPython/RustPython#4499
1 parent 9d5c796 commit 40c800a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docker/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,26 @@ ENV CARGO_INSTALL_ROOT="/workdir"
1010
# Newer rust needed due to let...else feature
1111
RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community rust cargo
1212

13-
RUN apk --no-cache add musl-dev
13+
RUN apk --no-cache add musl-dev git
1414

1515
ADD https://github.com/RustPython/RustPython/archive/refs/tags/v$RUST_PYTHON_VERSION.tar.gz /tmp/v$RUST_PYTHON_VERSION.tar.gz
1616
ADD https://github.com/RustPython/__doc__/archive/d927debd491e4c45b88e953e6e50e4718e0f2965.tar.gz /tmp/rp__doc__.tar.gz
1717

18+
# See: https://github.com/RustPython/RustPython/pull/4499
19+
ADD https://github.com/RustPython/RustPython/commit/9cac89347e2276fcb309f108561e99f4be5baff2.patch /tmp/9cac89347e2276fcb309f108561e99f4be5baff2.patch
20+
1821
RUN mkdir /workdir/rp__doc__/ && tar --strip-components=1 -C /workdir/rp__doc__/ -xzf /tmp/rp__doc__.tar.gz
1922

2023
RUN tar --strip-components=1 -C /workdir -xzf /tmp/v$RUST_PYTHON_VERSION.tar.gz
24+
RUN git apply /tmp/9cac89347e2276fcb309f108561e99f4be5baff2.patch
2125

2226
# Remove the git mode that triggers an error on armv6 and armv7
2327
# Ref: https://github.com/rust-lang/cargo/issues/2808 (failed to mmap. Could not write data: Out of memory; class=Os (2))
2428
RUN sed -i 's#{ git = .*#{ path = "/workdir/rp__doc__/" }#' /workdir/derive-impl/Cargo.toml
2529

2630
RUN cargo fetch
2731

28-
RUN if [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && [ "$(uname -m)" != "aarch64" ]; then cargo build --features freeze-stdlib --release --locked --offline --bin rustpython; else cargo build --no-default-features --features threading,zlib,importlib,rustpython-parser/lalrpop --release --locked --offline --bin rustpython; fi
32+
RUN cargo build --features freeze-stdlib --release --locked --offline --bin rustpython
2933

3034
FROM alpine:3.17
3135

0 commit comments

Comments
 (0)
0