When I try to install a python package that is compatible with Python 3.4 but contains native code which should be compiled during installation, it simply fails with the error message:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-i_0bp7r8/
The package I wanted to use is pycryptodome version 3.9.9 which is a dependency of another package I wanted to use...
Steps to Reproduce
Install IronPython (I used the portable zip file version and ran it using mono)
Enable pip by running: mono ipy.exe -m ensurepip
Try to install the package: mono ipy.exe -m pip install pycryptodomex==3.9.9
Since I think, the problem is caused by missing build variables which should be exposed by distutil's sysconfig -> get_config_var (and get_config_vars), you could end up with the following procedure to reproduce:
Open IronPython cli (mono ipy.exe)
Enter "import sysconfig"
Enter "print(sysconfig.get_config_var('CC'))"
Expected behavior:
The installation succeeds and the package will be installed
Actual behavior:
The compilation fails.
From what I've seen so far, the setup.py script tries to use set_compiler_options which then runs a function to check if the system is using clang or gcc. For that reason it tries to compile some small sample code against either clang or gcc. As part of that, the function test_compilation (in compiler_opt.py in the package) is invoked which runs distutils.sysconfig.customize_compiler()
customize_compiler comes from the pre-bundled distutils version which is part of this repository. From what I've found out, the method customize_compiler in sysconfig.py of distutils tries to use get_config_vars to get values for CC, CXX, OPT, CFLAGS, CCSHARED, LDSHARED, SHLIB_SUFFIX, AR and ARFLAGS.
None of them are returned by get_config_vars - and I think that's the underlying problem.
Version Information
Ironpython 3.4.1 (3.4.1.1000)
[.NETFramework,Version=V4.6.2 on Mono 6.8.0.105 (Debian 6.8.0.105+dfsg-3.3 Wed Dec 14 11:30:18 UTC 2022) (64-bit)]
Prerequisites
Description
When I try to install a python package that is compatible with Python 3.4 but contains native code which should be compiled during installation, it simply fails with the error message:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-i_0bp7r8/
The package I wanted to use is pycryptodome version 3.9.9 which is a dependency of another package I wanted to use...
Steps to Reproduce
Since I think, the problem is caused by missing build variables which should be exposed by distutil's sysconfig -> get_config_var (and get_config_vars), you could end up with the following procedure to reproduce:
Expected behavior:
The installation succeeds and the package will be installed
Actual behavior:
The compilation fails.
From what I've seen so far, the setup.py script tries to use set_compiler_options which then runs a function to check if the system is using clang or gcc. For that reason it tries to compile some small sample code against either clang or gcc. As part of that, the function test_compilation (in compiler_opt.py in the package) is invoked which runs distutils.sysconfig.customize_compiler()
customize_compiler comes from the pre-bundled distutils version which is part of this repository. From what I've found out, the method customize_compiler in sysconfig.py of distutils tries to use get_config_vars to get values for CC, CXX, OPT, CFLAGS, CCSHARED, LDSHARED, SHLIB_SUFFIX, AR and ARFLAGS.
None of them are returned by get_config_vars - and I think that's the underlying problem.
Version Information
Ironpython 3.4.1 (3.4.1.1000) [.NETFramework,Version=V4.6.2 on Mono 6.8.0.105 (Debian 6.8.0.105+dfsg-3.3 Wed Dec 14 11:30:18 UTC 2022) (64-bit)]