meson-python icon indicating copy to clipboard operation
meson-python copied to clipboard

Release 0.18.0

Open dnicolodi opened this issue 10 months ago • 2 comments

Is there anything else that we want to include in the 0.18.0 release?

Both #551 and #713 could be nice to have, but not a requisite for a release, IMO. #551 could be relatively easy to land. #713 requires more work.

dnicolodi avatar Jan 31 '25 14:01 dnicolodi

I'd be fine with either doing a release now, or getting one or both of those PRs in if there's energy to push on that. I'm pretty keen to see #551 merged, and I'd be happy to review - but I have 2 weeks of holiday planned for the second half of February, so realistically I probably won't be able to do much more than review/test.

rgommers avatar Jan 31 '25 16:01 rgommers

I'll try to get #551 ready for review in the next couple of days. It should be almost finished. The main thing left to do is probably adjusting the documentation.

dnicolodi avatar Feb 03 '25 14:02 dnicolodi

Presumably, that planned 0.18 release would fix the incompatibility found in 0.17 vs meson 1.8.0, right?

[   68s] FAILED tests/test_options.py::test_ndebug[-Dbuildtype=debug] - AssertionError...
[   68s] FAILED tests/test_wheel.py::test_limited_api_bad - Failed: DID NOT RAISE <cla...
[   68s] FAILED tests/test_wheel.py::test_limited_api_disabled - AssertionError: asser...
[   68s] =========== 3 failed, 108 passed, 11 skipped, 1 deselected in 55.22s ===========

DimStar77 avatar Apr 30 '25 05:04 DimStar77

There are no changes in Meson 1.8.0 that intentionally modify any Meson behavior that may affect meson-python. The tests did not fail with Meson 1.8.0rc2. Presumably, you identified what changed between Meson release 1.7.0 and 1.8.0 that causes the test to fail and can provide useful insight for resolving the problem, right?

dnicolodi avatar Apr 30 '25 07:04 dnicolodi

I cannot reproduce the test failures with meson-python 0.17.1 or git main and Meson 1.8.0.

dnicolodi avatar Apr 30 '25 08:04 dnicolodi

Hi, sadly I do not know why the tests fail. They were passing with meson 1.7.1, but as we rebuild everything as part of the testing, the errors could come from incompatibilities in other packages caused by build with meson 1.8.0. As you are certainly more knowledgeable regarding the meson ecosystem than ~us~ me, could you please take a look and provide some insight?

Full error log:

[   68s] =================================== FAILURES ===================================
[   68s] ________________________ test_ndebug[-Dbuildtype=debug] ________________________
[   68s] 
[   68s] package_purelib_and_platlib = PosixPath('/home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib')
[   68s] tmp_path = PosixPath('/tmp/pytest-of-abuild/pytest-0/test_ndebug__Dbuildtype_debug_0')
[   68s] args = ['-Dbuildtype=debug'], expected = False
[   68s] 
[   68s]     @pytest.mark.skipif(NINJA_VERSION < (1, 10), reason='Ninja version too old')
[   68s]     @pytest.mark.parametrize(
[   68s]         ('args', 'expected'),
[   68s]         [
[   68s]             ([], True),
[   68s]             (['-Dbuildtype=release'], True),
[   68s]             (['-Dbuildtype=debug'], False),
[   68s]         ],
[   68s]         ids=['', '-Dbuildtype=release', '-Dbuildtype=debug'],
[   68s]     )
[   68s]     def test_ndebug(package_purelib_and_platlib, tmp_path, args, expected):
[   68s]         with mesonpy._project({'setup-args': args}) as project:
[   68s]             command = subprocess.run(
[   68s]                 # Ask ninja what is the command that would be used to
[   68s]                 # compile a C source file (the trailing ^ is used to
[   68s]                 # specify the target that is the first output of the rule
[   68s]                 # containing the specified source file).
[   68s]                 ['ninja', '-C', os.fspath(project._build_dir), '-t', 'commands', '../plat.c^'],
[   68s]                 stdout=subprocess.PIPE, check=True).stdout
[   68s] >           assert (b'-DNDEBUG' in command) == expected
[   68s] E           AssertionError: assert (b'-DNDEBUG' in b'cc -Iplat.cpython-311-x86_64-linux-gnu.so.p -I. -I.. -I/usr/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -fPIC -MD -MQ plat.cpython-311-x86_64-linux-gnu.so.p/plat.c.o -MF plat.cpython-311-x86_64-linux-gnu.so.p/plat.c.o.d -o plat.cpython-311-x86_64-linux-gnu.so.p/plat.c.o -c ../plat.c\n') == False
[   68s] 
[   68s] /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/test_options.py:37: AssertionError
[   68s] ----------------------------- Captured stdout call -----------------------------
[   68s] + meson setup --reconfigure /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib/build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dbuildtype=debug --native-file=/home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib/build/meson-python-native-file.ini
[   68s] The Meson build system
[   68s] Version: 1.8.0
[   68s] Source dir: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib
[   68s] Build dir: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib/build
[   68s] Build type: native build
[   68s] Project name: purelib-and-platlib
[   68s] Project version: 1.0.0
[   68s] C compiler for the host machine: cc (gcc 14.2.1 "cc (SUSE Linux) 14.2.1 20250220 [revision 9ffecde121af883b60bbe60d00425036bc873048]")
[   68s] C linker for the host machine: cc ld.bfd 2.43.1.20241209-7
[   68s] Host machine cpu family: x86_64
[   68s] Host machine cpu: x86_64
[   68s] Program python found: YES (/usr/bin/python3.11)
[   68s] Build targets in project: 1
[   68s] 
[   68s] purelib-and-platlib 1.0.0
[   68s] 
[   68s]   User defined options
[   68s]     Native files: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/purelib-and-platlib/build/meson-python-native-file.ini
[   68s]     b_ndebug    : if-release
[   68s]     b_vscrt     : md
[   68s]     buildtype   : debug
[   68s] 
[   68s] Found ninja-1.12.1 at /usr/bin/ninja
[   68s] _____________________________ test_limited_api_bad _____________________________
[   68s] 
[   68s] package_limited_api = PosixPath('/home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api')
[   68s] tmp_path = PosixPath('/tmp/pytest-of-abuild/pytest-0/test_limited_api_bad0')
[   68s] 
[   68s]     @pytest.mark.skipif(MESON_VERSION < (1, 2, 99), reason='Meson version too old')
[   68s]     @pytest.mark.skipif(NOGIL_BUILD, reason='Free-threaded CPython does not support the limited API')
[   68s]     @pytest.mark.xfail('__pypy__' in sys.builtin_module_names, reason='PyPy does not use special modules suffix for stable ABI')
[   68s]     def test_limited_api_bad(package_limited_api, tmp_path):
[   68s] >       with pytest.raises(mesonpy.BuildError, match='The package declares compatibility with Python limited API but '):
[   68s] E       Failed: DID NOT RAISE <class 'mesonpy.BuildError'>
[   68s] 
[   68s] /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/test_wheel.py:307: Failed
[   68s] ----------------------------- Captured stdout call -----------------------------
[   68s] + meson setup --reconfigure /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dextra=true --native-file=/home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build/meson-python-native-file.ini
[   68s] Cleaning... 0 files.
[   68s] The Meson build system
[   68s] Version: 1.8.0
[   68s] Source dir: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api
[   68s] Build dir: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build
[   68s] Build type: native build
[   68s] WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead
[   68s] Project name: limited-api
[   68s] Project version: 1.0.0
[   68s] C compiler for the host machine: cc (gcc 14.2.1 "cc (SUSE Linux) 14.2.1 20250220 [revision 9ffecde121af883b60bbe60d00425036bc873048]")
[   68s] C linker for the host machine: cc ld.bfd 2.43.1.20241209-7
[   68s] Host machine cpu family: x86_64
[   68s] Host machine cpu: x86_64
[   68s] Program python found: YES (/usr/bin/python3.11)
[   68s] ../meson.build:9: WARNING: Project does not target a minimum version but uses feature introduced in '1.3.0': limited_api arg in python.extension_module.
[   68s] Build targets in project: 1
[   68s] WARNING: Project specifies no minimum version but uses features which were added in versions:
[   68s]  * 1.1: {'meson.options file'}
[   68s]  * 1.3.0: {'limited_api arg in python.extension_module'}
[   68s] 
[   68s] limited-api 1.0.0
[   68s] 
[   68s]   User defined options
[   68s]     Native files: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build/meson-python-native-file.ini
[   68s]     b_ndebug    : if-release
[   68s]     b_vscrt     : md
[   68s]     buildtype   : release
[   68s]     extra       : true
[   68s] 
[   68s] Found ninja-1.12.1 at /usr/bin/ninja
[   68s] + /usr/bin/ninja
[   68s] ninja: no work to do.
[   68s] [1/1] /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build/module.abi3.so
[   68s] __________________________ test_limited_api_disabled ___________________________
[   68s] 
[   68s] package_limited_api = PosixPath('/home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api')
[   68s] tmp_path = PosixPath('/tmp/pytest-of-abuild/pytest-0/test_limited_api_disabled0')
[   68s] 
[   68s]     @pytest.mark.skipif(MESON_VERSION < (1, 2, 99), reason='Meson version too old')
[   68s]     def test_limited_api_disabled(package_limited_api, tmp_path):
[   68s]         filename = mesonpy.build_wheel(tmp_path, {'setup-args': ['-Dpython.allow_limited_api=false']})
[   68s]         artifact = wheel.wheelfile.WheelFile(tmp_path / filename)
[   68s]         name = artifact.parsed_filename
[   68s]         assert name.group('pyver') == INTERPRETER
[   68s] >       assert name.group('abi') == ABI
[   68s] E       AssertionError: assert 'abi3' == 'cp311'
[   68s] E         
[   68s] E         - cp311
[   68s] E         + abi3
[   68s] 
[   68s] /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/test_wheel.py:319: AssertionError
[   68s] ----------------------------- Captured stdout call -----------------------------
[   68s] + meson setup --reconfigure /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dpython.allow_limited_api=false --native-file=/home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build/meson-python-native-file.ini
[   68s] Cleaning... 0 files.
[   68s] The Meson build system
[   68s] Version: 1.8.0
[   68s] Source dir: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api
[   68s] Build dir: /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build
[   68s] Build type: native build
[   68s] WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead
[   68s] Project name: limited-api
[   68s] Project version: 1.0.0
[   68s] C compiler for the host machine: cc (gcc 14.2.1 "cc (SUSE Linux) 14.2.1 20250220 [revision 9ffecde121af883b60bbe60d00425036bc873048]")
[   68s] C linker for the host machine: cc ld.bfd 2.43.1.20241209-7
[   68s] Host machine cpu family: x86_64
[   68s] Host machine cpu: x86_64
[   68s] Program python found: YES (/usr/bin/python3.11)
[   68s] ../meson.build:9: WARNING: Project does not target a minimum version but uses feature introduced in '1.3.0': limited_api arg in python.extension_module.
[   68s] Build targets in project: 1
[   68s] WARNING: Project specifies no minimum version but uses features which were added in versions:
[   68s]  * 1.1: {'meson.options file'}
[   68s]  * 1.3.0: {'limited_api arg in python.extension_module'}
[   68s] 
[   68s] limited-api 1.0.0
[   68s] 
[   68s]   User defined options
[   68s]     Native files            : /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build/meson-python-native-file.ini
[   68s]     b_ndebug                : if-release
[   68s]     b_vscrt                 : md
[   68s]     buildtype               : release
[   68s]     extra                   : true
[   68s]     python.allow_limited_api: false
[   68s] 
[   68s] Found ninja-1.12.1 at /usr/bin/ninja
[   68s] + /usr/bin/ninja
[   68s] ninja: no work to do.
[   68s] [1/1] /home/abuild/rpmbuild/BUILD/python-meson-python-0.17.1-build/meson_python-0.17.1/tests/packages/limited-api/build/module.abi3.so
[   68s] =========================== short test summary info ============================
[   68s] SKIPPED [1] tests/test_project.py:204: Requires MSVC
[   68s] SKIPPED [3] tests/test_project.py:216: macOS specific test
[   68s] SKIPPED [2] tests/test_project.py:233: macOS specific test
[   68s] SKIPPED [1] tests/test_tags.py:47: macOS specific test
[   68s] SKIPPED [1] tests/test_tags.py:59: macOS specific test
[   68s] SKIPPED [1] tests/test_tags.py:69: macOS specific test
[   68s] SKIPPED [2] tests/test_wheel.py:251: macOS specific test
[   68s] FAILED tests/test_options.py::test_ndebug[-Dbuildtype=debug] - AssertionError...
[   68s] FAILED tests/test_wheel.py::test_limited_api_bad - Failed: DID NOT RAISE <cla...
[   68s] FAILED tests/test_wheel.py::test_limited_api_disabled - AssertionError: asser...
[   68s] =========== 3 failed, 108 passed, 11 skipped, 1 deselected in 55.22s ===========
[   68s] error: Bad exit status from /var/tmp/rpm-tmp.IPPPF1 (%check)

MeggyCal avatar Apr 30 '25 08:04 MeggyCal

As reported, these test failures cannot be reproduced. Meson has no dependencies outside the Python standard library, thus just upgrading Meson to 1.8.0 should not bring any other change that may affect the tests. The test failures you report are all related to project option handling in Meson. Meson 1.8.0 had a large refactoring of this area. Are you sure that what you think is Meson 1.8.0 is really it as released upstream?

dnicolodi avatar Apr 30 '25 10:04 dnicolodi

There are some changes in the openSUSE package, but I cannot say whether they could be related to the failures or not. @DimStar77, what is your view?

MeggyCal avatar Apr 30 '25 10:04 MeggyCal

Well, the issue does not reproduce with Meson 1.8.0 from upstream, thus it is very likely that the openSUSE specific changes are at fault here.

As you are certainly more knowledgeable regarding the meson ecosystem than ~us~ me, could you please take a look and provide some insight?

This is impossible without knowing what these changes are. Is there a public repository with the openSUSE package sources?

dnicolodi avatar Apr 30 '25 11:04 dnicolodi

This is impossible without knowing what these changes are. Is there a public repository with the openSUSE package sources?

Certainly: https://build.opensuse.org/package/show/devel:tools:building/meson

DimStar77 avatar Apr 30 '25 12:04 DimStar77

You won't believe it, but the difference is that when we build an RPM package, with the goal of reproducible builds, there is an env variable set, like:

SOURCE_DATE_EPOCH=1732060800 (value can vary, of course)

Removing that var inside the build env 'solves' it - setting that var outside of the buildenv results in the failure. That is quite unexpected

DimStar77 avatar Apr 30 '25 13:04 DimStar77

... And that only reproduces with meson 1.8.0, not meson 1.7.0?

(Btw as an aside: meson has release candidates, if you can package them and run reverse dependency tests in some sort of "proposed updates" or "testing" repository we'd be happy to resolve these issues before final release.)

eli-schwartz avatar Apr 30 '25 14:04 eli-schwartz

... And that only reproduces with meson 1.8.0, not meson 1.7.0?

Last package update I had was meson 1.7.1, where this did not show

(Btw as an aside: meson has release candidates, if you can package them and run reverse dependency tests in some sort of "proposed updates" or "testing" repository we'd be happy to resolve these issues before final release.)

I know, I'm usually (but had to skip 1.8rc due to time constraints) packaging meson release candidates and rebuild the GNOME stack against it. The meson-python bindings are so far not part of those tests, but I guess I can start including them.

DimStar77 avatar Apr 30 '25 14:04 DimStar77

Thanks for tracking this down. But I still cannot reproduce the issue. Setting SOURCE_DATE_EPOCH=1732060800 or any other value while running the meson-pyhton tests has no effect on the outcome for me. Can you please provide the detailed steps necessary to reproduce the issue?

dnicolodi avatar Apr 30 '25 14:04 dnicolodi

0.18.0 is up on PyPI now, so closing.

rgommers avatar May 05 '25 10:05 rgommers