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

Update most dependencies to latest (2024-06) #318

Merged
merged 26 commits into from
Jun 18, 2024
Merged

Conversation

dhermes
Copy link
Owner

@dhermes dhermes commented Jun 17, 2024

Still sorting out some issues with NumPy 2.0 (I'll do this in another PR to keep the diffs separate / cleaner)

@@ -67,6 +68,10 @@
RELEASE_SESSION_NAME = "libbezier-release"
INSTALL_PREFIX_ENV = "BEZIER_INSTALL_PREFIX"
EXTRA_DLL_ENV = "BEZIER_EXTRA_DLL"
_OS_MAKEDIRS_EXIST_OK = functools.partial(os.makedirs, exist_ok=True)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session.run() has deprecated the use of kwargs passing through to callables

session.run_always(print, "Using pre-installed ``cmake``")
session.run_always("cmake", "--version", external=cmake_external)
session.run_install(print, "Using pre-installed ``cmake``")
session.run_install("cmake", "--version", external=cmake_external)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_always() is now just an alias for run_install()

@dhermes
Copy link
Owner Author

dhermes commented Jun 17, 2024

For an example of the errors relating to NumPy 2.0:

      src/python/bezier/_speedup.c:40168:75: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’
      40168 |   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_6bezier_8_speedup_SEGMENT_DTYPE->elsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
            |     

@@ -30,7 +30,7 @@ on:

jobs:
ci:
runs-on: macos-latest
runs-on: macos-13
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temporary!

See: actions/setup-python#547

In particular, the architecture on macos-latest (macos-14) machines means that mixed-architecture dylibs are produced by gcc.

See for example a failed build:

...
Successfully built bezier
nox > delocate-wheel --wheel-dir /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/tmpraciqawj --verbose /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/tmpizrl0uv3/bezier-2023.7.29.dev1-cp311-cp311-macosx_10_9_universal2.whl
Fixing: /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/tmpizrl0uv3/bezier-2023.7.29.dev1-cp311-cp311-macosx_10_9_universal2.whl
Traceback (most recent call last):
  File "/Users/runner/work/bezier/bezier/.nox/doctest/bin/delocate-wheel", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/cmd/delocate_wheel.py", line 110, in main
    copied = delocate_wheel(
             ^^^^^^^^^^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/delocating.py", line 971, in delocate_wheel
    copied_libs = delocate_path(
                  ^^^^^^^^^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/delocating.py", line 509, in delocate_path
    lib_dict = tree_libs_from_directory(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/libsana.py", line 377, in tree_libs_from_directory
    return _tree_libs_from_libraries(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/libsana.py", line 304, in _tree_libs_from_libraries
    for depending_path, install_name in get_dependencies(
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/libsana.py", line 102, in get_dependencies
    for install_name in get_install_names(lib_fname):
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/tools.py", line 559, in get_install_names
    names_data = _check_ignore_archs(_parse_otool_install_names(otool.stdout))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/bezier/bezier/.nox/doctest/lib/python3.11/site-packages/delocate/tools.py", line 413, in _check_ignore_archs
    raise NotImplementedError(
NotImplementedError: This function does not support separate values per-architecture: {'x86_64': [('/usr/lib/libSystem.B.dylib', '1.0.0', '1336.0.0')], 'arm64': [('@rpath/libbezier.2023.dylib', '2023.0.0', '2023.7.28'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1336.0.0')]}
nox > Command delocate-wheel --wheel-dir /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/tmpraciqawj --verbose /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/tmpizrl0uv3/bezier-2023.7.29.dev1-cp311-cp311-macosx_10_9_universal2.whl failed with exit code 1
...

Tag Type Name/Value
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../bezier.libs]
0x0000000000000001 (NEEDED) Shared library: [libbezier-631d8eda.so.2023.7.28]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000c (INIT) 0x6000
0x000000000000000d (FINI) 0x7ef80
0x000000000000000d (FINI) 0x7f630
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected when Cython generated code gets updated

"numpy": "numpy >= 1.25.2",
"pycobertura": "pycobertura >= 3.2.1",
"matplotlib": "matplotlib >= 3.9.0",
"numpy": "numpy >= 1.26.4, < 2",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling 2.0 in another PR

Comment on lines +294 to +295
"python",
"-m",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this when debugging (I was worried something was wrong in pip resolution). I didn't end up needing this change but python -m pip is more canonical so keeping it.

Comment on lines +670 to +671
if IS_MACOS:
build_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=13.0")
Copy link
Owner Author

@dhermes dhermes Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temporary! The default value used by CMake is whatever the current version is on the machine. Here that's 13.6 as of https://github.com/actions/runner-images/blob/3793317199f7f1eebff21ae96c77878546f06389/images/macos/macos-13-Readme.md.

However, only 13.0 is allowed, e.g.:

$ python3.11 -m pip debug --verbose | grep cp311-cp311-macosx_13
  cp311-cp311-macosx_13_0_x86_64
  cp311-cp311-macosx_13_0_intel
  cp311-cp311-macosx_13_0_fat64
  cp311-cp311-macosx_13_0_fat32
  cp311-cp311-macosx_13_0_universal2
  cp311-cp311-macosx_13_0_universal

@dhermes dhermes merged commit 62d62cd into main Jun 18, 2024
11 checks passed
@dhermes dhermes deleted the dhermes/latest-deps-2024-06 branch June 18, 2024 05:04
@dhermes
Copy link
Owner Author

dhermes commented Jun 18, 2024

I hope I can ditch the cobbled together tooling and use cibuildwheel when installing from a wheel in doctests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant