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

ENH: sunos5 support for rpath operations #702

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mtelka
Copy link

@mtelka mtelka commented Nov 4, 2024

This adds support for rpath mangling for sunos5 platform (illumos/Solaris).

Here are test results from OpenIndiana for meson-python 0.17.1 with this change applied:

============================= test session starts ==============================
platform sunos5 -- Python 3.9.20, pytest-8.3.3, pluggy-1.5.0 -- /usr/bin/python3.9
cachedir: .pytest_cache
rootdir: /data/builds/oi-userland/components/python/meson-python/build/amd64-3.9
configfile: pyproject.toml
testpaths: tests
plugins: cov-6.0.0, mock-3.14.0
collecting ... collected 123 items

tests/test_consistency.py::test_pyproject_dependencies PASSED            [  0%]
tests/test_editable.py::test_walk PASSED                                 [  1%]
tests/test_editable.py::test_nodes_tree PASSED                           [  2%]
tests/test_editable.py::test_collect PASSED                              [  3%]
tests/test_editable.py::test_mesonpy_meta_finder PASSED                  [  4%]

[...snip...]

tests/test_tags.py::test_wheel_tag PASSED                                [ 69%]
tests/test_tags.py::test_macos_platform_tag SKIPPED (macOS specific ...) [ 69%]
tests/test_tags.py::test_macos_platform_tag_arm64 SKIPPED (macOS spe...) [ 70%]
tests/test_tags.py::test_python_host_platform SKIPPED (macOS specifi...) [ 71%]
tests/test_tags.py::test_tag_empty_wheel PASSED                          [ 72%]
tests/test_tags.py::test_tag_purelib_wheel PASSED                        [ 73%]
tests/test_tags.py::test_tag_platlib_wheel PASSED                        [ 73%]
tests/test_tags.py::test_tag_stable_abi PASSED                           [ 74%]
tests/test_tags.py::test_tag_mixed_abi PASSED                            [ 75%]
tests/test_wheel.py::test_scipy_like PASSED                              [ 76%]
tests/test_wheel.py::test_purelib_and_platlib PASSED                     [ 77%]
tests/test_wheel.py::test_pure PASSED                                    [ 78%]
tests/test_wheel.py::test_configure_data PASSED                          [ 78%]
tests/test_wheel.py::test_contents_license_file PASSED                   [ 79%]
tests/test_wheel.py::test_contents PASSED                                [ 80%]
tests/test_wheel.py::test_local_lib PASSED                               [ 81%]
tests/test_wheel.py::test_rpath PASSED                                   [ 82%]
tests/test_wheel.py::test_uneeded_rpath PASSED                           [ 82%]
tests/test_wheel.py::test_executable_bit PASSED                          [ 83%]
tests/test_wheel.py::test_detect_wheel_tag_module PASSED                 [ 84%]
tests/test_wheel.py::test_detect_wheel_tag_script PASSED                 [ 85%]
tests/test_wheel.py::test_entrypoints PASSED                             [ 86%]
tests/test_wheel.py::test_top_level_modules PASSED                       [ 86%]
tests/test_wheel.py::test_purelib_platlib_split PASSED                   [ 87%]
tests/test_wheel.py::test_archflags_envvar[x86_64] SKIPPED (macOS sp...) [ 88%]
tests/test_wheel.py::test_archflags_envvar[arm64] SKIPPED (macOS spe...) [ 89%]
tests/test_wheel.py::test_subprojects PASSED                             [ 90%]
tests/test_wheel.py::test_skip_subprojects[--skip-subprojects] PASSED    [ 91%]
tests/test_wheel.py::test_skip_subprojects[--skip-subprojects=dep] PASSED [ 91%] 
tests/test_wheel.py::test_limited_api PASSED                             [ 92%]
tests/test_wheel.py::test_limited_api_bad PASSED                         [ 93%]
tests/test_wheel.py::test_limited_api_disabled PASSED                    [ 94%]
tests/test_wheel.py::test_install_subdir PASSED                          [ 95%]
tests/test_wheel.py::test_vendored_meson PASSED                          [ 95%]
tests/test_wheel.py::test_encoding PASSED                                [ 96%]
tests/test_wheel.py::test_custom_target_install_dir PASSED               [ 97%]
tests/test_wheelfile.py::test_basic PASSED                               [ 98%]
tests/test_wheelfile.py::test_source_date_epoch PASSED                   [ 99%]
tests/test_wheelfile.py::test_compression PASSED                         [100%]

=========================== short test summary info ============================
SKIPPED [1] tests/test_project.py:204: Requires MSVC
SKIPPED [3] tests/test_project.py:216: macOS specific test
SKIPPED [2] tests/test_project.py:233: macOS specific test
SKIPPED [1] tests/test_tags.py:47: macOS specific test
SKIPPED [1] tests/test_tags.py:59: macOS specific test
SKIPPED [1] tests/test_tags.py:69: macOS specific test
SKIPPED [2] tests/test_wheel.py:251: macOS specific test
================= 112 passed, 11 skipped in 189.68s (0:03:09) ==================

Without this change the test results are:

============================= test session starts ==============================
platform sunos5 -- Python 3.9.20, pytest-8.3.3, pluggy-1.5.0 -- /usr/bin/python3.9
cachedir: .pytest_cache
rootdir: /data/builds/oi-userland/components/python/meson-python/build/amd64-3.9
configfile: pyproject.toml
testpaths: tests
plugins: cov-6.0.0, mock-3.14.0
collecting ... collected 123 items

tests/test_consistency.py::test_pyproject_dependencies PASSED            [  0%]
tests/test_editable.py::test_walk PASSED                                 [  1%]
tests/test_editable.py::test_nodes_tree PASSED                           [  2%]
tests/test_editable.py::test_collect PASSED                              [  3%]
tests/test_editable.py::test_mesonpy_meta_finder PASSED                  [  4%]
tests/test_editable.py::test_mesonpy_traversable PASSED                  [  4%]
tests/test_editable.py::test_resources PASSED                            [  5%]
tests/test_editable.py::test_importlib_resources PASSED                  [  6%]
tests/test_editable.py::test_editable_install PASSED                     [  7%]
tests/test_editable.py::test_editble_reentrant PASSED                    [  8%]
tests/test_editable.py::test_editable_pkgutils_walk_packages PASSED      [  8%]

[...snip...]

tests/test_tags.py::test_tag_mixed_abi PASSED                            [ 75%]
tests/test_wheel.py::test_scipy_like PASSED                              [ 76%]
tests/test_wheel.py::test_purelib_and_platlib PASSED                     [ 77%]
tests/test_wheel.py::test_pure PASSED                                    [ 78%]
tests/test_wheel.py::test_configure_data PASSED                          [ 78%]
tests/test_wheel.py::test_contents_license_file PASSED                   [ 79%]
tests/test_wheel.py::test_contents SKIPPED (Not supported on this pl...) [ 80%]
tests/test_wheel.py::test_local_lib SKIPPED (Not supported on this p...) [ 81%]
tests/test_wheel.py::test_rpath SKIPPED (Not supported on this platform) [ 82%]
tests/test_wheel.py::test_uneeded_rpath SKIPPED (Not supported on th...) [ 82%]
tests/test_wheel.py::test_executable_bit SKIPPED (Not supported on t...) [ 83%]
tests/test_wheel.py::test_detect_wheel_tag_module PASSED                 [ 84%]
tests/test_wheel.py::test_detect_wheel_tag_script PASSED                 [ 85%]
tests/test_wheel.py::test_entrypoints PASSED                             [ 86%]
tests/test_wheel.py::test_top_level_modules PASSED                       [ 86%]
tests/test_wheel.py::test_purelib_platlib_split PASSED                   [ 87%]
tests/test_wheel.py::test_archflags_envvar[x86_64] SKIPPED (macOS sp...) [ 88%]
tests/test_wheel.py::test_archflags_envvar[arm64] SKIPPED (macOS spe...) [ 89%]
tests/test_wheel.py::test_subprojects PASSED                             [ 90%]
tests/test_wheel.py::test_skip_subprojects[--skip-subprojects] PASSED    [ 91%]
tests/test_wheel.py::test_skip_subprojects[--skip-subprojects=dep] PASSED [ 91%]
tests/test_wheel.py::test_limited_api PASSED                             [ 92%]
tests/test_wheel.py::test_limited_api_bad PASSED                         [ 93%]
tests/test_wheel.py::test_limited_api_disabled PASSED                    [ 94%]
tests/test_wheel.py::test_install_subdir PASSED                          [ 95%]
tests/test_wheel.py::test_vendored_meson PASSED                          [ 95%]
tests/test_wheel.py::test_encoding PASSED                                [ 96%]
tests/test_wheel.py::test_custom_target_install_dir PASSED               [ 97%]
tests/test_wheelfile.py::test_basic PASSED                               [ 98%]
tests/test_wheelfile.py::test_source_date_epoch PASSED                   [ 99%]
tests/test_wheelfile.py::test_compression PASSED                         [100%]

=========================== short test summary info ============================
SKIPPED [1] tests/test_project.py:204: Requires MSVC
SKIPPED [3] tests/test_project.py:216: macOS specific test
SKIPPED [2] tests/test_project.py:233: macOS specific test
SKIPPED [1] tests/test_tags.py:47: macOS specific test
SKIPPED [1] tests/test_tags.py:59: macOS specific test
SKIPPED [1] tests/test_tags.py:69: macOS specific test
SKIPPED [1] tests/test_wheel.py:143: Not supported on this platform
SKIPPED [1] tests/test_wheel.py:157: Not supported on this platform
SKIPPED [1] tests/test_wheel.py:164: Not supported on this platform
SKIPPED [1] tests/test_wheel.py:178: Not supported on this platform
SKIPPED [1] tests/test_wheel.py:190: Not supported on this platform
SKIPPED [2] tests/test_wheel.py:251: macOS specific test
================= 107 passed, 16 skipped in 175.20s (0:02:55) ==================

@dnicolodi
Copy link
Member

Thanks for your contribution. Do you know if there is any CI service that we could use to test on OpenIndiana? It is difficult to do not have platform specific code to do not break over time if it cannot be tested.

@mtelka
Copy link
Author

mtelka commented Nov 4, 2024

I'm very sorry, but I've no idea. I understand that this code could break, but I believe it is better to have it here with the such a risk than keeping and maintaining our private patch.

BTW, this change is on its way to the official meson-python OpenIndiana package: OpenIndiana/oi-userland#19436

@rgommers rgommers added the enhancement New feature or request label Nov 4, 2024
@rgommers
Copy link
Contributor

rgommers commented Nov 4, 2024

Thanks @mtelka!

I think this makes sense to add to meson-python indeed. Having CI would be much better, but for platforms where public CI is not available it still seems better to accept patches from distros that look reasonable, rather than reject them (CI can never be complete anyway). We do that for example in NumPy, where AIX is supported without CI - some tests or the build break on occasion, and then those that care can fix it. Better than just leaving users and distro packagers with permanent workarounds/patches that they need to maintain (e.g., CPython does that with Cygwin, and it's not pretty). If meson-python is maintained within OpenIndiana, it will be noticed fairly quickly anyway if there's a regression at any point.

For this feature in particular, I believe that we should also aim to support it on Windows as well in the future - it's not very useful for many Python packages otherwise. We can probably do that via optional delvewheel usage.

@rgommers
Copy link
Contributor

rgommers commented Nov 4, 2024

Is elfedit always installed on SunOS 5?

@eli-schwartz
Copy link
Member

Having CI would be much better, but for platforms where public CI is not available it still seems better to accept patches from distros that look reasonable, rather than reject them (CI can never be complete anyway). We do that for example in NumPy, where AIX is supported without CI - some tests or the build break on occasion, and then those that care can fix it. Better than just leaving users and distro packagers with permanent workarounds/patches that they need to maintain (e.g., CPython does that with Cygwin, and it's not pretty).

Yup, and meson has the same policy. CI if it is straightforward to add CI, but patches accepted on the honor system for cases that we can't cover in CI.

The "need to apply hundreds of unofficial patches" scenario is dreadful, especially when it makes it impossible to bisect a CPython regression on those platforms. :( Collaboration with an active userbase is always better.

@mtelka
Copy link
Author

mtelka commented Nov 4, 2024

Is elfedit always installed on SunOS 5?

Short answer: No.

On OpenIndiana (and most of illumos based distros, and maybe Solaris too) it is in a system package named developer/object-file and the package comes directly from the illumos platform (the core part of the OS). It means the package is readily available for all (okay, maybe not all, but definitely most) illumos distros.

For OpenIndiana, the developer/object-file package is required by the build-essential meta-package and this means that all developers already have it installed.

@mtelka
Copy link
Author

mtelka commented Nov 4, 2024

... this reminded me that I forgot to add the explicit dependency on developer/object-file to the OpenIndiana meson-python package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants