Comments (15)
Could we document the installation process on alpine?
from maturin.
There are two solutions:
- Use the sdist publish with 0.7.0. I haven't tested it completely (it's surprisingly hard to install rustup on alpine, and the rust version apk delivers is too old), but it should work.
- Fake manylinux compliance and use the wheel like on any other platform.
from maturin.
FYI we've just merged a similar patch to automatically set the flag for musl in setuptools-rust: PyO3/setuptools-rust#80
from maturin.
I tried to pip install in Docker and got that error.
Step 10/11 : RUN pip install --upgrade pyo3-pack
---> Running in 0ff18cb8d404
Collecting pyo3-pack
Downloading https://files.pythonhosted.org/packages/bb/4c/3e276f48e39f7c86dba37796d4580a7b229dcc7b2ceeb5f0edc544879446/pyo3_pack-0.7.0_beta.10.tar.gz (57kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 2:
command: /usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mijhtirv/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- pyo3-pack
cwd: None
Complete output (23 lines):
Collecting pyo3-pack
Using cached https://files.pythonhosted.org/packages/bb/4c/3e276f48e39f7c86dba37796d4580a7b229dcc7b2ceeb5f0edc544879446/pyo3_pack-0.7.0_beta.10.tar.gz
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 188, in main
status = self.run(options, args)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 345, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 196, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 359, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 307, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 213, in prepare_linked_requirement
with self.req_tracker.track(req):
File "/usr/local/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py", line 94, in track
self.add(req)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py", line 63, in add
% (link, fp.read()))
LookupError: https://files.pythonhosted.org/packages/bb/4c/3e276f48e39f7c86dba37796d4580a7b229dcc7b2ceeb5f0edc544879446/pyo3_pack-0.7.0_beta.10.tar.gz#sha256=221895634587ba97c4d8f7a264d0f4d520ef0ad640a2af976590430f5a2d9dd1 (from https://pypi.org/simple/pyo3-pack/) is already being built: pyo3-pack from https://files.pythonhosted.org/packages/bb/4c/3e276f48e39f7c86dba37796d4580a7b229dcc7b2ceeb5f0edc544879446/pyo3_pack-0.7.0_beta.10.tar.gz#sha256=221895634587ba97c4d8f7a264d0f4d520ef0ad640a2af976590430f5a2d9dd1
----------------------------------------
ERROR: Command errored out with exit status 2: /usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mijhtirv/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- pyo3-pack Check the logs for full command output.
The command '/bin/sh -c pip install --upgrade pyo3-pack' returned a non-zero code: 1
from maturin.
I am getting the same error on NixOS.
from maturin.
This looks like this pip bug: pypa/pip#5739. The only workaround I can think of would be writing a custom setup.py that builds pyo3-pack, which would kinda defeat the purpose of pyo3-pack and PEP 517.
If you don't need PEP 517 support, you can also just download the binary (https://github.com/PyO3/pyo3-pack/releases/download/v0.7.0-beta.11/pyo3-pack-v0.7.0-beta.11-x86_64-unknown-linux-musl.tar.gz - if there's a problem with a linked library on alpine I can change those releases to fully static binaries)
from maturin.
@konstin I get a not found
error using that binary on Alpine. Could you offer fully static binaries?
from maturin.
I've created #191 with an attempt to fix pip install pyo3-pack
on alpine. I already got python setup.py install
working in an alpine container, let's see if it also works with pip and pypi.
from maturin.
It turns out that using musl as a host toolchain isn't really supported by rust and cargo yet (rust-lang/rust#59302). However I've realized that there's an unexpectedly easy solution with cross compiling and multi stage builds:
- Start with some glibc based image (like
rust:strech
) - Compile with
RUSTFLAGS="-C target-feature=-crt-static"
and--target x86_64-unknown-linux-musl --manylinux off
- Switch to alpine
apk add libgcc gcompat
- Pull the wheel from the earlier stage and install it
edit: That solution is for installing some package using maturin, not for maturin itself.
from maturin.
It is supported. What isn't supported is using musl c as a dynamic library as far as I understand.
But I'll try that.
from maturin.
Since this came up in the pyo3 issue tracker (PyO3/pyo3#1109) and was proposed for setuptools-rust (PyO3/setuptools-rust#80): Should we automatically set -C target-feature=-crt-static
for --target x86_64-unknown-linux-mus
?
from maturin.
... for
--target x86_64-unknown-linux-mus
?
assuming you meant musl instead of mus.
from maturin.
I think it's ok to automatically set it, ideally with this behaviour documented somewhere. (e.g. in case in the future this flag should no longer be set, users might want to know about it so that they can report it as a bug for us to fix.)
(I think it's ok to automatically set because we already set target-specific flags for macos)
from maturin.
Can we please do the same here?
from maturin.
@davidhewitt Ping?
from maturin.
Related Issues (20)
- maturin built failed after rust 1.74 for bin/rust-gdb conflicts HOT 4
- Recommend install via `pipx`? HOT 1
- the `multipart` crate is unmaintained HOT 1
- Cargo xwin configutation to download sdks and headers for target arch only. HOT 1
- Allow ignoring shared libraries HOT 2
- Compatibility with conda and poetry used simultaneously
- Fix or skip cffi tests on Windows PyPy
- maturin build fails on CentOS 7 HOT 4
- Build fails if REUSE-compliant LICENSES directory is present
- Panic when running `maturin build --interpreter python --target x86_64-pc-windows-msvc` HOT 2
- Source distribution missing workspace files HOT 6
- Build option to dynamically set abi3 version HOT 9
- Make it possible to skip passing `--interpreter` option when building editable wheels via pep517 backend
- Uniffi multiple crates not supported
- Uniffi-bindgen not detected in cargo workspace
- Maturin uses .gitignore from the incorrect context when used in out-of-project build environments such as conda
- [cffi] Allow generated shared library to have a name other than `native.so` HOT 2
- When the .pyd file is in use and Maturin develop mentions the Pip warning, that needs to be much more obvious that that's really bad.
- uniffi-bindgen verion 0.26 not supported HOT 5
- Python can't find DLL when linking external C library (gtstreamer) on Windows HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maturin.