Closed hareeshnagaraj closed 2 years ago
I was able to resolve this by adding the following lines to my Dockerfile:
# Install Rust for anchor.py dependency
RUN curl -s --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env
As well as:
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pip
I think this is actually the only part you need.
What you're seeing is pip trying to build pyheck from source, which it shouldn't be doing in this case.
Pyheck has prebuilt wheels on pypi for all the common platforms so you don't need to have rust installed.
However I remember some older versions of pip not being able to find these wheels. So yeah just use an up-to-date pip
thank for the quick reply @kevinheavey! will try with the rust installation step removed
So did this work? @hareeshnagaraj
yes! no rust installation was necessary
Hey @kevinheavey -- Just curious, do you have any thoughts on why this wouldn't work in docker on m1? I see that there should be a wheel https://pypi.org/project/pyheck/#files, but always fails out on
#10 27.65 Collecting pyheck<0.2.0,>=0.1.4
#10 27.65 Downloading pyheck-0.1.5.tar.gz (3.4 kB)
#10 27.76 Installing build dependencies: started
#10 30.21 Installing build dependencies: finished with status 'done'
#10 30.21 Getting requirements to build wheel: started
#10 30.25 Getting requirements to build wheel: finished with status 'done'
#10 30.26 Preparing metadata (pyproject.toml): started
#10 61.25 Preparing metadata (pyproject.toml): finished with status 'error'
#10 61.26 error: subprocess-exited-with-error
#10 61.26
#10 61.26 × Preparing metadata (pyproject.toml) did not run successfully.
#10 61.26 │ exit code: 1
#10 61.26 ╰─> [7 lines of output]
#10 61.26 💥 maturin failed
#10 61.26 Caused by: Failed to read LICENSE
#10 61.26 Caused by: failed to open file `LICENSE`
#10 61.26 Caused by: No such file or directory (os error 2)
#10 61.26 Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-cqmo_4_l', '--interpreter', '/usr/bin/python3']' returned non-zero exit status 1.
#10 61.26 Checking for Rust toolchain....
#10 61.26 Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-cqmo_4_l --interpreter /usr/bin/python3`
#10 61.26 [end of output]
@raymondjacobson have you checked if your docker image is using an old version of pip?
@raymondjacobson have you checked if your docker image is using an old version of pip?
Thanks for the speedy reply! I work with @hareeshnagaraj -- just trying out our docker setup on different platforms. So pip is python3 & upgraded. Just learned that switching the dep to pyheck 0.1.4 works instead of 0.1.5! I see that anchorpy only requires 0.1.4 at the moment, so that's totally unblocking. Curious to dig into some of the diff to see what it might be. Odd!
Yeah that's weird, pyheck 0.1.5 should be more portable, not less. It relaxed the Python version requirement from >=3.9 to >=3.7, and added musllinux wheels
@raymondjacobson I can see that it's downloading pyheck-0.1.5.tar.gz
instead of the wheel file. That only happens if it doesn't find a wheel it can use, which shouldn't be happening
@raymondjacobson did you ever figure this out?
@raymondjacobson did you figure out if something was wrong in the end? I'm going to be inflicting some Rust on solana-py and would like to know if there's something missing for some platform
During a docker container build with anchor.py==0.8.0 in
requirements.txt
we are encountering the following error -Is there a known fix for this?
We have tried adding a rust dependency manually in a Docker build to work around it with little luck - things get stuck indefinitely in the following stage:
Any recommendations would be greatly appreciated!