8000 BUG: recently added f2py test (`test_gh25784`) is failing in macOS wheel builds · Issue #26810 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: recently added f2py test (test_gh25784) is failing in macOS wheel builds #26810

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

Closed
rgommers opened this issue Jun 28, 2024 · 0 comments · Fixed by #26812
Closed

BUG: recently added f2py test (test_gh25784) is failing in macOS wheel builds #26810

rgommers opened this issue Jun 28, 2024 · 0 comments · Fixed by #26812

Comments

@rgommers
Copy link
Member

Example CI log: link. It's failing consistently on all macOS wheel build jobs, which is preventing nightly wheels from being uploaded.

I haven't looked in more detail at what the problem is. If we can't fix it right now, we should disable the test.

  _________________________________ test_gh25784 _________________________________
  [gw3] darwin -- Python 3.12.4 /private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/bin/python
  
      @pytest.mark.slow
      @pytest.mark.skipif(platform.system() not in ['Linux', 'Darwin'], reason='Unsupported on this platform for now')
      def test_gh25784():
          # Compile dubious file using passed flags
          try:
  >           aa = util.build_module(
                  [util.getpath("tests", "src", "regression", "f77fixedform.f95")],
                  options=[
                      # Meson will collect and dedup these to pass to fortran_args:
                      "--f77flags='-ffixed-form -O2'",
                      "--f90flags=\"-ffixed-form -Og\"",
                  ],
                  module_name="Blah",
              )
  
  
  ../venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/tests/test_regression.py:131: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  ../venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/tests/util.py:84: in wrapper
      memo[key] = func(*a, **kw)
          a          = ([PosixPath('/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/tests/src/regression/f77fixedform.f95')],)
          func       = <function build_module at 0x117847600>
          key        = '(([PosixPath(\'/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-te...],), {\'options\': ["--f77flags=\'-ffixed-form -O2\'", \'--f90flags="-ffixed-form -Og"\'], \'module_name\': \'Blah\'})'
          kw         = {'module_name': 'Blah', 'options': ["--f77flags='-ffixed-form -O2'", '--f90flags="-ffixed-form -Og"']}
          memo       = {'(([PosixPath(\'/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-t...ub"...\n          output1,output2 = testsub(input1,input2)\n    Wrote C/API module "Blah" to file "./Blahmodule.c"\n')}
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  source_files = [PosixPath('/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/tests/src/regression/f77fixedform.f95')]
  options = ["--f77flags='-ffixed-form -O2'", '--f90flags="-ffixed-form -Og"']
  skip = [], only = [], module_name = 'Blah'
  
      @_memoize
      def build_module(source_files, options=[], skip=[], only=[], module_name=None):
          """
          Compile and import a f2py module, built from the given files.
      
          """
      
          code = f"import sys; sys.path = {sys.path!r}; import numpy.f2py; numpy.f2py.main()"
      
          d = get_module_dir()
      
          # Copy files
          dst_sources = []
          f2py_sources = []
          for fn in source_files:
              if not os.path.isfile(fn):
                  raise RuntimeError("%s is not a file" % fn)
              dst = os.path.join(d, os.path.basename(fn))
              shutil.copyfile(fn, dst)
              dst_sources.append(dst)
      
              base, ext = os.path.splitext(dst)
              if ext in (".f90", ".f95", ".f", ".c", ".pyf"):
                  f2py_sources.append(dst)
      
          assert f2py_sources
      
          # Prepare options
          if module_name is None:
              module_name = get_temp_module_name()
          f2py_opts = ["-c", "-m", module_name] + options + f2py_sources
          f2py_opts += ["--backend", "meson"]
          if skip:
              f2py_opts += ["skip:"] + skip
          if only:
              f2py_opts += ["only:"] + only
      
          # Build
          cwd = os.getcwd()
          try:
              os.chdir(d)
              cmd = [sys.executable, "-c", code] + f2py_opts
              p = subprocess.Popen(cmd,
                                   stdout=subprocess.PIPE,
                                   stderr=subprocess.STDOUT)
              out, err = p.communicate()
              if p.returncode != 0:
  >               raise RuntimeError("Running f2py failed: %s\n%s" %
                                     (cmd[4:], asunicode(out)))
  E                                  RuntimeError: Running f2py failed: ['-m', 'Blah', "--f77flags='-ffixed-form -O2'", '--f90flags="-ffixed-form -Og"', '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95', '--backend', 'meson']
  E                                  The Meson build system
  E                                  Version: 1.4.1
  E                                  Source dir: /private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpn58zcbj3
  E                                  Build dir: /private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpn58zcbj3/bbdir
  E                                  Build type: native build
  E                                  Project name: Blah
  E                                  Project version: 0.1
  E                                  
  E                                  meson.build:1:0: ERROR: Unknown compiler(s): [['gfortran'], ['flang'], ['nvfortran'], ['pgfortran'], ['ifort'], ['ifx'], ['g95']]
  E                                  The following exception(s) were encountered:
  E                                  Running `gfortran --version` gave "[Errno 2] No such file or directory: 'gfortran'"
  E                                  Running `gfortran -V` gave "[Errno 2] No such file or directory: 'gfortran'"
  E                                  Running `flang --version` gave "[Errno 2] No such file or directory: 'flang'"
  E                                  Running `flang -V` gave "[Errno 2] No such file or directory: 'flang'"
  E                                  Running `nvfortran --version` gave "[Errno 2] No such file or directory: 'nvfortran'"
  E                                  Running `nvfortran -V` gave "[Errno 2] No such file or directory: 'nvfortran'"
  E                                  Running `pgfortran --version` gave "[Errno 2] No such file or directory: 'pgfortran'"
  E                                  Running `pgfortran -V` gave "[Errno 2] No such file or directory: 'pgfortran'"
  E                                  Running `ifort --version` gave "[Errno 2] No such file or directory: 'ifort'"
  E                                  Running `ifort -V` gave "[Errno 2] No such file or directory: 'ifort'"
  E                                  Running `ifx --version` gave "[Errno 2] No such file or d
8000
irectory: 'ifx'"
  E                                  Running `ifx -V` gave "[Errno 2] No such file or directory: 'ifx'"
  E                                  Running `g95 --version` gave "[Errno 2] No such file or directory: 'g95'"
  E                                  Running `g95 -V` gave "[Errno 2] No such file or directory: 'g95'"
  E                                  
  E                                  A full log can be found at /private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpn58zcbj3/bbdir/meson-logs/meson-log.txt
  E                                  Traceback (most recent call last):
  E                                    File "<string>", line 1, in <module>
  E                                    File "/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 769, in main
  E                                      run_compile()
  E                                    File "/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 741, in run_compile
  E                                      builder.compile()
  E                                    File "/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/_backends/_meson.py", line 193, in compile
  E                                      self.run_meson(self.build_dir)
  E                                    File "/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/_backends/_meson.py", line 186, in run_meson
  E                                      self._run_subprocess_command(setup_command, build_dir)
  E                                    File "/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/_backends/_meson.py", line 182, in _run_subprocess_command
  E                                      subprocess.run(command, cwd=cwd, check=True)
  E                                    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
  E                                      raise CalledProcessError(retcode, process.args,
  E                                  subprocess.CalledProcessError: Command '['meson', 'setup', 'bbdir']' returned non-zero exit status 1.
  E                                  Using meson backend
  E                                  Will pass --lower to f2py
  E                                  See https://numpy.org/doc/stable/f2py/buildtools/meson.html
  E                                  Reading fortran codes...
  E                                  	Reading file '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95' (format:free)
  E                                  Line #2 in /var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95:"      subroutine mwe( "
  E                                  	analyzeline: No name/args pattern found for line.
  E                                  Post-processing...
  E                                  	Block: Blah
  E                                  			Block: unknown_subroutine
  E                                  Applying post-processing hooks...
  E                                    character_backward_compatibility_hook
  E                                  Post-processing (stage 2)...
  E                                  Building modules...
  E                                      Building module "Blah"...
  E                                      Generating possibly empty wrappers"
  E                                      Maybe empty "Blah-f2pywrappers.f"
  E                                          Constructing wrapper function "unknown_subroutine"...
  E                                            unknown_subroutine()
  E                                      Wrote C/API module "Blah" to file "./Blahmodule.c"
  
  base       = '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform'
  cmd        = ['/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/bin/...x86_64/venv-test-x86_64/lib/python3.12/site-packages']; import numpy.f2py; numpy.f2py.main()", '-c', '-m', 'Blah', ...]
  code       = "import sys; sys.path = ['/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh', '/private/var/folders/n0/93pm...run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages']; import numpy.f2py; numpy.f2py.main()"
  cwd        = '/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/test_cwd'
  d          = '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh'
  dst        = '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95'
  dst_sources = ['/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95']
  err        = None
  ext        = '.f95'
  f2py_opts  = ['-c', '-m', 'Blah', "--f77flags='-ffixed-form -O2'", '--f90flags="-ffixed-form -Og"', '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95', ...]
  f2py_sources = ['/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95']
  fn         = '/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpbpgg9tdh/f77fixedform.f95'
  module_name = 'Blah'
  only       = []
  options    = ["--f77flags='-ffixed-form -O2'", '--f90flags="-ffixed-form -Og"']
  out        = b'The Meson build system\nVersion: 1.4.1\nSource dir: /private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/tmpn58z...tion "unknown_subroutine"...\n          unknown_subroutine()\n    Wrote C/API module "Blah" to file "./Blahmodule.c"\n'
  p          = <Popen: returncode: 1 args: ['/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxr...>
  skip       = []
  source_files = [PosixPath('/private/var/folders/n0/93pmqpw54kn_g2qbs9kqxrxh0000gn/T/cibw-run-z256dk15/cp312-macosx_x86_64/venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/tests/src/regression/f77fixedform.f95')]
  
  ../venv-test-x86_64/lib/python3.12/site-packages/numpy/f2py/tests/util.py:149: RuntimeError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0