dotnet / dotnet-buildtools-prereqs-docker

Used to maintain the Docker images hosted at the mcr.microsoft.com/dotnet-buildtools/prereqs image repository
MIT License
57 stars 103 forks source link

Helix ARM images fail to build, asks for Rust to be installed or can't build cryptography wheel #903

Open lbussell opened 1 year ago

lbussell commented 1 year ago

In https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/897, unrelated to the PR's changes, the Raspbian and Debian Helix stages failed to build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=343439&view=logs&j=3269ed96-e1ee-5791-373d-a55e5a2175a9&t=6d9bf06a-e7bf-5504-6e26-c5b767fa7b88

The specific error is:

> [stage-1 3/5] RUN ln -sf /usr/bin/python3 /usr/bin/python &&     curl https://bootstrap.pypa.io/get-pip.py -o ./get-pip.py --fail --silent --show-error &&     python ./get-pip.py && rm ./get-pip.py &&     python -m pip install --upgrade pip==20.2 &&     python -m pip install virtualenv==16.6.0 &&     pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple &&     export CRYPTOGRAPHY_DONT_BUILD_RUST=1 &&     pip install ./helix_scripts-*-py3-none-any.whl:
#6 98.52   If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs/) is the recommended way to download and update the Rust compiler toolchain.
#6 98.52   
#6 98.52   This package requires Rust >=1.56.0.
#6 98.52   ----------------------------------------
#6 98.52   ERROR: Failed building wheel for cryptography
#6 98.52 Successfully built psutil pycparser cffi
#6 98.52 Failed to build cryptography
#6 98.52 ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
#6 98.57 WARNING: You are using pip version 20.2; however, version 23.2 is available.
#6 98.57 You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

It seems that the Helix install script doesn't respect the CRYPTOGRAPHY_DONT_BUILD_RUST environment variable that has been set:

https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/af784859c2a9daa4322f2d6d0750f644cedd08d0/src/debian/11/helix/arm32v7/Dockerfile#L50-L57

cc @riarenas @garath @missymessa

wfurt commented 11 months ago

we may follow #929 that fixed Debian 11 on arm32. We may do the same for Debian 12. It also may not be needed since Debian 12 has newer rush e.g. the old pattern may just work.

lbussell commented 8 months ago

I'm seeing this issue blocking alpine arm32 images now -

> [3/7] RUN apk update && apk add --no-cache &&     apk add         cargo         libffi-dev         linux-headers         python3-dev         openssl-dev &&     ln -sf /usr/bin/python3 /usr/bin/python &&     curl https://bootstrap.pypa.io/get-pip.py -o ./get-pip.py --fail --silent --show-error &&     python3 ./get-pip.py && rm ./get-pip.py &&     python3 -m pip install --upgrade pip==22.2.2 &&     python3 -m pip install virtualenv==20.16.5 &&     pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple &&     pip install ./helix_scripts-*-py3-none-any.whl &&     apk del         cargo         libffi-dev         linux-headers         python3-dev         openssl-dev:
#6 47.17       running build_rust
#6 47.17       error: Rust 1.60.0 does not match extension requirement >=1.63.0
#6 47.17       [end of output]
#6 47.17   
#6 47.17   note: This error originates from a subprocess, and is likely not a problem with pip.
#6 47.17   ERROR: Failed building wheel for cryptography
#6 47.17 Successfully built psutil pycparser
#6 47.17 Failed to build cryptography
#6 47.17 ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
#6 47.21 WARNING: There was an error checking the latest version of pip.

https://dev.azure.com/dnceng/internal/_build/results?buildId=2363776&view=logs&j=1bd276f8-9fb5-54c7-5be2-bbe0faefcec6&t=78f2343a-ba72-59a4-e152-58a1d5b13d94 [internal link]

I think we should probably disable that image to unblock other builds.