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

PyO3 is not supported on Alpine Linux #599

Closed
thedrow opened this issue Sep 10, 2019 · 5 comments
Closed

PyO3 is not supported on Alpine Linux #599

thedrow opened this issue Sep 10, 2019 · 5 comments

Comments

@thedrow
Copy link
Contributor

thedrow commented Sep 10, 2019

🐛 Bug Reports

When attempting to compile a PyO3 library I get the following:
error: cannot produce proc-macro for `ctor v0.1.10` as the target `x86_64-unknown-linux-musl` does not support these crate types

🌍 Environment

  • Your operating system and version: Alpine Linux 3.10.2
  • Your python version: Python 3.7.3
  • How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?: using apk, no.
  • Your rust version (rustc --version): rustc 1.39.0-nightly (0b36e9dea 2019-09-09)
  • Are you using the latest pyo3 version? Have you tried using latest master (replace version = "0.x.y" with git = "https://github.com/PyO3/pyo3")? Yes. No.

💥 Reproducing

sudo docker pull alpine:latest
sudo docker run -it /bin/sh
apk add --update libgcc python3-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
git clone https://github.com/thedrow/fastuuid.git
cd fastuuid
cargo build
@kngwyu
Copy link
Member

kngwyu commented Sep 10, 2019

So what I can say is

  1. It's not our problem(maybe because of ctor?)
  2. x86_64-unknown-linux-musl is tier-2 support so, yeah, please don't expect everything works fine on this

@thedrow
Copy link
Contributor Author

thedrow commented Sep 10, 2019

If we can consider to drop ctor and/or replace it this issue becomes actionable.
If not, we should simply document the fact that we don't support Alpine.

@althonos
Copy link
Member

If we can consider to drop ctor and/or replace it this issue becomes actionable.

From the error message, I'd say that x86_64-unknown-linux-musl doesn't support any proc-macros crate, and given that PyO3 heavily uses proc-macros, I don't know how it could work with that target.

@kngwyu
Copy link
Member

kngwyu commented Sep 10, 2019

@althonos
You're right, I found that we cannot do that by googling.
rust-lang/rust#40174
Looks like there's an issue around dynamic loading.

@kngwyu kngwyu closed this as completed Sep 10, 2019
@mmastrac
Copy link

mmastrac commented Sep 21, 2019

As a heads up, I was able to make use of ctor on musl via cross - this might work for PyO3 as well. The important thing is that you build on a platform that supports dynamic linking!

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