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

Misleading build error on unsupported architecture #806

Closed
omus opened this issue Aug 13, 2020 · 5 comments · Fixed by #906
Closed

Misleading build error on unsupported architecture #806

omus opened this issue Aug 13, 2020 · 5 comments · Fixed by #906

Comments

@omus
Copy link

omus commented Aug 13, 2020

When attempting to build PyCall on Sys.ARCH of :aarch64 with the environmental variable PYTHON="" set you get the following error message:

┌ Error: Error building `PyCall`:
│ ERROR: LoadError: No system-wide Python was found; got the following error:
│ UseCondaPython()
│ Stacktrace:
│  [1] error(::String, ::String) at ./error.jl:42
│  [2] top-level scope at /root/.julia/packages/PyCall/zqDXB/deps/build.jl:77
│  [3] include at ./boot.jl:328 [inlined]
│  [4] include_relative(::Module, ::String) at ./loading.jl:1105
│  [5] include(::Module, ::String) at ./Base.jl:31
│  [6] include(::String) at ./client.jl:424
│  [7] top-level scope at none:5
│ in expression starting at /root/.julia/packages/PyCall/zqDXB/deps/build.jl:43
│ caused by [exception 1]
│ UseCondaPython()
│ Stacktrace:
│  [1] top-level scope at /root/.julia/packages/PyCall/zqDXB/deps/build.jl:51
│  [2] include at ./boot.jl:328 [inlined]
│  [3] include_relative(::Module, ::String) at ./loading.jl:1105
│  [4] include(::Module, ::String) at ./Base.jl:31
│  [5] include(::String) at ./client.jl:424
│  [6] top-level scope at none:5
└ @ Pkg.Operations /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.3/Pkg/src/backwards_compatible_isolation.jl:649

If I add :aarch64 into the list of supported architectures I get a much better error message:

┌ Error: Error building `PyCall`:
│ ┌ Info: Using the Python distribution in the Conda package by default.
│ └ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
│ [ Info: Downloading miniconda installer ...
│ ERROR: LoadError: Unsupported architecture: aarch64
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] _installer_url() at /root/.julia/packages/Conda/3rPhK/src/Conda.jl:143
│  [3] _install_conda(::String, ::Bool) at /root/.julia/packages/Conda/3rPhK/src/Conda.jl:164
│  [4] _install_conda(::String) at /root/.julia/packages/Conda/3rPhK/src/Conda.jl:155
│  [5] runconda(::Cmd, ::String) at /root/.julia/packages/Conda/3rPhK/src/Conda.jl:112
│  [6] #add#1(::String, ::typeof(Conda.add), ::String, ::String) at /root/.julia/packages/Conda/3rPhK/src/Conda.jl:188
│  [7] add at /root/.julia/packages/Conda/3rPhK/src/Conda.jl:187 [inlined] (repeats 2 times)
│  [8] top-level scope at /root/.julia/packages/PyCall/gqZkc/deps/build.jl:86
│  [9] include at ./boot.jl:328 [inlined]
│  [10] include_relative(::Module, ::String) at ./loading.jl:1105
│  [11] include(::Module, ::String) at ./Base.jl:31
│  [12] include(::String) at ./client.jl:424
│  [13] top-level scope at none:5
│ in expression starting at /root/.julia/packages/PyCall/gqZkc/deps/build.jl:45
└ @ Pkg.Operations /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.3/Pkg/src/backwards_compatible_isolation.jl:649

Unsetting the PYTHON environmental variable allows the PyCall build to complete. It would be good to fix the PyCall error message so it isn't misleading.

@rapus95
Copy link

rapus95 commented May 6, 2021

Given that Conda.jl supports miniforge I would even suggest to remove that architecture check. If Conda is selected, let Conda handle it.

@tpgillam
Copy link

tpgillam commented Jun 3, 2021

I've also run into this problem just now.

@omus Out of interest, when you say:

Unsetting the PYTHON environmental variable allows the PyCall build to complete.

was this the only step that was required, or was the addition of :aarch64 somewhere also needed? For me just having PYTHON not set seems insufficient to get the build to complete. Thanks!

@omus
Copy link
Author

omus commented Jun 3, 2021

@tpgillam I believe the commend of unsetting PYTHON was in addition to adding :aarch64 to the list of supported architectures in deps/build.jl.

If you just want to get PyCall working on aarch64 set:

export PYTHON=$(which python)

before starting Julia. You may need to run ] build PyCall with that environmental variable set.

@stevengj
Copy link
Member

stevengj commented Jun 3, 2021

Given that Conda.jl supports miniforge I would even suggest to remove that architecture check. If Conda is selected, let Conda handle it.

I agree; see #906.

@tpgillam
Copy link

tpgillam commented Jun 4, 2021

Thanks @omus! This does indeed work (along with installing a few additional dependencies for the system python — I was doing this inside a docker container running on an M1 mac).

@tkf tkf closed this as completed in #906 Oct 24, 2021
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

Successfully merging a pull request may close this issue.

4 participants