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

Publish ci #30

Closed
wants to merge 2 commits into from
Closed

Publish ci #30

wants to merge 2 commits into from

Conversation

fujiisoup
Copy link
Owner

Adding a CI to publish wheels to PyPI, according to the comment #27 (comment)

@fujiisoup
Copy link
Owner Author

It is still failing, saying

+ python -m pip wheel 'D:\a\py3nj\py3nj' '--wheel-dir=C:\Users\runneradmin\AppData\Local\Temp\cibw-run-2eznju6f\cp38-win32\built_wheel' --no-deps
  Processing d:\a\py3nj\py3nj
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error
    
    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [12 lines of output]
        + meson setup D:\a\py3nj\py3nj D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build\meson-python-native-file.ini
        The Meson build system
        Version: 1.2.1
        Source dir: D:\a\py3nj\py3nj
        Build dir: D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build
        Build type: native build
        Project name: py3nj
        Project version: 0.2.2
        
        ..\..\meson.build:1:0: ERROR: Executables created by fortran compiler gfortran are not runnable.
        
        A full log can be found at D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build\meson-logs\meson-log.txt
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed
  
  × Encountered error while generating package metadata.
  ╰─> See above for output.
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  Error: Command ['python', '-m', 'pip', 'wheel', 'D:\\a\\py3nj\\py3nj', '--wheel-dir=C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-2eznju6f\\cp38-win32\\built_wheel', '--no-deps'] failed with code 1. None

Looks like it fails in compilation / installation.

@kalekundert
Copy link
Contributor

I think the issue is that the wheels need to be built in the same environment that the tests are run in, i.e. with ninja and a working fortran compiler installed.

I made a branch (kalekundert/py3nj:cibuildwheel) that refactors the build environment setup steps into their own action, so that they can easily be used in both the test and publish workflows. That avoids the above error, but runs into two more errors:

  • On Linux/Mac, all of the wheels except for python 3.12 build successfully. The issue with 3.12 is still that pip install numpy doesn't work yet, and there's nothing we can do about that, so I just skip 3.12 for now.
  • On Windows, I get the following error:
    + python -m pip wheel 'D:\a\py3nj\py3nj' '--wheel-dir=C:\Users\runneradmin\AppData\Local\Temp\cibw-run-jhmb54rw\cp38-win32\built_wheel' --no-deps
      Processing d:\a\py3nj\py3nj
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error
        
        × Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [22 lines of output]
            + meson setup D:\a\py3nj\py3nj D:\a\py3nj\py3nj\.mesonpy-wstaee9t\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=D:\a\py3nj\py3nj\.mesonpy-wstaee9t\build\meson-python-native-file.ini
            The Meson build system
            Version: 1.2.1
            Source dir: D:\a\py3nj\py3nj
            Build dir: D:\a\py3nj\py3nj\.mesonpy-wstaee9t\build
            Build type: native build
            Project name: py3nj
            Project version: 0.2.2
            Fortran compiler for the host machine: gfortran (gcc 11.2.0 "GNU Fortran (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0")
            Fortran linker for the host machine: gfortran ld.bfd 2.37
            C compiler for the host machine: gcc (gcc 11.2.0 "gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0")
            C linker for the host machine: gcc ld.bfd 2.37
            Host machine cpu family: x86_64
            Host machine cpu: x86_64
            Program python found: YES (C:\Users\runneradmin\AppData\Local\Temp\cibw-run-jhmb54rw\cp38-win32\build\venv\Scripts\python.exe)
            Run-time dependency OpenMP found: YES 4.5
            Need python for x86_64, but found x86
            Run-time dependency python found: NO (tried sysconfig)
            
            ..\..\meson.build:38:3: ERROR: Python dependency not found
            
            A full log can be found at D:\a\py3nj\py3nj\.mesonpy-wstaee9t\build\meson-logs\meson-log.txt
            [end of output]
    
    Build failures using meson-python 0.11.0 with cibuildwheel mesonbuild/meson-python#222 might be relevant. I'm suspicious that the static linking is the problem, and that using delvewheel might be a solution. But for now I just configured the workflow to not make wheels for windows. We already know that the source installation works, so providing a wheel is a convenience rather than a necessity.

@fujiisoup
Copy link
Owner Author

Taken over by #31

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 this pull request may close these issues.

2 participants