Page MenuHomeFreeBSD

devel/meson: flavourise
Needs ReviewPublic

Authored by vishwin on Mar 9 2023, 7:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Unknown Object (File)
Jan 27 2024, 8:19 AM
Subscribers

Details

Summary

Needed for devel/meson-python to function on non-default Python flavours/distributions.

Test Plan

Need to figure out how to include python.mk variables, but not the dependencies, here, so meson-only consumers have the correct default FLAVOR specified.Existing consumers build as expected. Need to verify a couple specific cases of individual Python ports using this (and not meson-python) to build.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 50300
Build 47192: arc lint + arc unit

Event Timeline

meson.mk: FLAVOR was apparently not needed here

meson.mk: use entry point in dependency specifier, PKGNAME changes when not default FLAVOR

devel/meson-python: adjust dependency lines

This revision was not accepted when it landed; it landed in state Needs Review.Mar 11 2023, 4:37 PM
This revision was automatically updated to reflect the committed changes.
mandree added a subscriber: mandree.

this isn't working properly. Reopening

mandree requested changes to this revision.Mar 12 2023, 9:07 AM
mandree added a subscriber: jbeich.

@jbeich wrote to the mailing lists:

Charlie Li <vishwin@FreeBSD.org> writes:

-BUILD_DEPENDS= meson>=0.63.3:devel/meson \
+BUILD_DEPENDS= meson:devel/meson@${PY_FLAVOR} \

Looks non-deterministic as "meson" maybe provided by default flavor
instead of the requested (via FLAVOR + USES=python -> PY_FLAVOR) e.g.,

$ pkg install meson
$ make clean all FLAVOR=py310 BUILD_ALL_PYTHON_FLAVORS=y -C devel/meson-python
[...]
===>  Building for py310-meson-python-0.12.1
* Getting build dependencies for wheel...

ERROR Missing dependencies:
        meson>=0.63.3
*** Error code 1

+.if ${PYTHON_VER} != ${PYTHON_DEFAULT}
+PKGNAMESUFFIX= ${PYTHON_PKGNAMESUFFIX}
+.endif

Avoiding USE_PYTHON=concurrent without hiding non-module files?

$ pkg install meson
$ pkg install meson-py311
[...]
Checking integrity... done (1 conflicting)
  - meson-py311-1.0.1 conflicts with meson-1.0.1 on /usr/local/bin/meson
Checking integrity... done (0 conflicting)
The following 4 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        meson: 1.0.1
[...]
This revision now requires changes to proceed.Mar 12 2023, 9:07 AM

@vishwin please fix this up and after that also D34739, before working on any new stuff.

add USE_PYTHON=concurrent and remove polkit action, as it file conflicts and doesn't work properly here anyway

Note that python variables cannot be used in meson.mk, at all.

devel/meson: bump PORTREVISION for package change

Doing it this way, when building meson-python on a non-default Python, fails because literally bin/meson is expected, not bin/meson-${PYTHON_VER}.

Don't even think about un-flavouring everything, near future consumers need to use this with all supported Python.

devel/meson-python: add BINARY_ALIAS

Gets around the "hardcoded" subcommand invocation.

devel/meson-python/Makefile
24

Why not patch the source instead? BINARY_ALIAS has no impact on RUN_DEPENDS, so won't help devel/meson-python consumers.

Doing it this way, when building meson-python on a non-default Python, fails because literally bin/meson is expected, not bin/meson-${PYTHON_VER}.

Don't even think about un-flavouring everything, near future consumers need to use this with all supported Python.

So the default-python based package can additionally install everything under plain names, or there can be another package that depends on the default python's and adds symlinks to the relevant entry points, commands, documentation, without all those 39 and -3.9 names.

devel/meson-python: patch out hardcoded meson invocations

Bump PORTREVISION for package change

This and consumers now execute the correct meson entry point.

So the default-python based package can additionally install everything under plain names, or there can be another package that depends on the default python's and adds symlinks to the relevant entry points, commands, documentation, without all those 39 and -3.9 names.

Not tenable since meson-python has to operate under the same Python version/distribution, which is checked and enforced during the build process.

add USE_PYTHON=concurrent and remove polkit action, as it file conflicts and doesn't work properly here anyway

Looks incomplete. patch-setup.py was adjusting manpage location, obsoleted by 003a571d1d65. To fix polkit action may require either expanding USES=uniquefiles:dirs (implied by USE_PYTHON=concurrent) to handle the conflicting file/directory or adjusting ${TMPPLIST} from post-patch gated by PKGNAMESUFFIX.

$ pkg install meson
$ pkg install meson-py311
[...]
Checking integrity... done (1 conflicting)
  - meson-py311-1.0.1_1 conflicts with meson-1.0.1_1 on /usr/local/share/polkit-1/actions/com.mesonbuild.install.policy
Checking integrity... done (0 conflicting)
The following 4 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        meson: 1.0.1_1
[...]
devel/meson-python/Makefile
40

tests/ files are unused due to missing USE_PYTHON=pytest + TEST_DEPENDS=${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}

Looks incomplete. patch-setup.py was adjusting manpage location, obsoleted by 003a571d1d65. To fix polkit action may require either expanding USES=uniquefiles:dirs (implied by USE_PYTHON=concurrent) to handle the conflicting file/directory or adjusting ${TMPPLIST} from post-patch gated by PKGNAMESUFFIX.

The action itself is effectively a sudo make install wrapper for those who did not already temporarily elevate their privileges. The referenced paths, which are hardcoded as /usr, are wrong for us. Port builds don't use this at all.

devel/meson-python/Makefile
40

I plan to hook this in a separate change.