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

Could not install on Alpine Linux 3.11 and Rust 1.39.0 #46

Closed
analytically opened this issue Jan 7, 2020 · 6 comments
Closed

Could not install on Alpine Linux 3.11 and Rust 1.39.0 #46

analytically opened this issue Jan 7, 2020 · 6 comments

Comments

@analytically
Copy link

  error: could not compile `smallvec`.
  warning: build failed, waiting for other jobs to finish...
  error: build failed
  💥 maturin failed
    Caused by: Failed to build a native library through cargo
    Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --lib --release -- -C target-feature=+sse2 -C link-arg=-s`
  Running `maturin pep517 build-wheel -i python --manylinux=off --rustc-extra-args=-C target-feature=+sse2 --strip=on`
  Error: Command '['maturin', 'pep517', 'build-wheel', '-i', 'python', '--manylinux=off', '--rustc-extra-args=-C target-feature=+sse2', '--strip=on']' returned non-zero exit status 1.
@ijl
Copy link
Owner

ijl commented Jan 8, 2020

There's some discussion in #8. If rustup works on Alpine now, someone could document this and specify how to run CI on Alpine.

@ijl ijl closed this as completed Jan 13, 2020
@hartwork
Copy link

hartwork commented Feb 25, 2020

#8 has been closed now and installing orjson==2.5.1 on Alpine Linux 3.11 and Rust 1.39.0 still does not work out of the box. Maybe with things like #8 (comment) . I would vote for re-opening and maybe pinning this ticket.

@ijl
Copy link
Owner

ijl commented Feb 25, 2020

Using https://pkgs.alpinelinux.org/package/v3.11/community/x86_64/rust? That's stable, and this requires nightly. If you can document how to install it, great.

@hartwork
Copy link

Using https://pkgs.alpinelinux.org/package/v3.11/community/x86_64/rust? That's stable, and this requires nightly.

Yes and yes.

If you can document how to install it, great.

I stopped research half way due to timeout, so I cannot, at least yet.

So we cannot re-open and/or pin this ticket for the next person to maybe find this quicker?

@hartwork
Copy link

If you can document how to install it, great.

I stopped research half way due to timeout, so I cannot, at least yet.

Based on #8 (comment) by @scuml I can confirm that this Dockerfile works for orjson on Alpine 3.11:

FROM python:3.8-alpine

RUN apk update \
        && \
    apk add build-base wget

RUN wget -Oinit.sh https://sh.rustup.rs \
        && \
    sh init.sh -y \
        && \
    rm init.sh

ENV PATH="/root/.cargo/bin:${PATH}"

RUN rustup install nightly \
        && \
    rustup default nightly

ENV RUSTFLAGS="-C target-feature=-crt-static"

RUN pip install --no-binary=orjson orjson==2.5.1

RUN python -c 'import orjson; print(orjson.loads("[1, true]"))'

It took about 10 minutes total runtime over here.

@gatopeich
Copy link

The recipe above only works now with nightly-2020-09-14
Tested on python:3.8-alpine3.12 and orjson==3.3.1

FROM python:3.8-alpine3.12
RUN apk add build-base wget
ENV PATH="/root/.cargo/bin:${PATH}"
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN wget https://sh.rustup.rs -O rustup-init \
    && sh rustup-init -y --default-toolchain nightly-2020-09-14
RUN pip install --no-binary=orjson $(grep -o 'orjson[^#]*' runtime.deps)
RUN python -c 'import orjson; print(orjson.loads("[1, true]"))'

I am now testing on plain Alpine3.12, where binary manylinux build seems a bit slower...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants