conda-forge / pypy3.6-feedstock

A conda-smithy repository for pypy3.6.
BSD 3-Clause "New" or "Revised" License
4 stars 13 forks source link

break the posix build into stages #43

Closed mattip closed 3 years ago

mattip commented 3 years ago

Checklist

At the end of translation, PyPy by default builds the cffi import libraries using --embed-dependencies, which is wrong for conda. It also swallows the output for the final stages, which makes debugging CI more difficult.

By adding the --no-compile option, the translation will stop before calling make, which is the last option to terminate traslation. Maybe someday PyPy will grow an option to only skip the cffi build stage, which is complicated for ... reasons. So the PR adds the option, then dives into the emitted source directory, calls make, and copies out the artifacts.

Commands to continue from there were already in the build.sh script, but I added pre-building the c-extension modules to avoid race conditions when building them in multi-threaded tests. Maybe I should disable the stdlib tests, they take a long time?

xref #40

conda-forge-linter commented 3 years ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

mattip commented 3 years ago

@conda-forge-admin, please rerender

mattip commented 3 years ago

I see there is a problem with macOS, I will push a fix. But before I waste another CI build cycle, is there something that needs to happen so that distutils.ccompiler works on linux? The linepypy3 -c "import _testcapi" tries to call

    from distutils.ccompiler import new_compiler
    from distutils import log
    log.set_verbosity(3)

    compiler = new_compiler()
    compiler.output_dir = output_dir
    # Compile .c file
    include_dir = os.path.join(thisdir, '..', 'include')
    if sys.platform == 'win32':
        ccflags = ['-D_CRT_SECURE_NO_WARNINGS']
    else:
        ccflags = ['-fPIC', '-Wimplicit-function-declaration']
    res = compiler.compile([os.path.join(thisdir, csource)],
                           include_dirs=[include_dir],
                           extra_preargs=ccflags,
                          )

and fails with

cc -fPIC -Wimplicit-function-declaration -I$PREFIX/lib_pypy/../include -c $PREFIX/lib_pypy/_testcapimodule.c -o /tmp/testcapi_d96dc44b6b6ae973$PREFIX/lib_pypy/_testcapimodule.o
unable to execute 'cc': No such file or directory
isuruf commented 3 years ago

Yes, you need to call distutils.sysconfig.customize_compiler(compiler) before running .compile

mattip commented 3 years ago

thanks

isuruf commented 3 years ago

Thanks

mattip commented 3 years ago

let me know how the aarch64 build goes

isuruf commented 3 years ago

Build went fine, but at conda-build packaging step I got the error OSError: [Errno 26] Text file busy: $PREFIX/bin/pypy3. Re-running now.

mattip commented 3 years ago

Hmm, that sounds like a problem with either symlinks or some strange file ownership problems?