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

automatic build requires for macros.meson #14001

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

solomoncyj
Copy link

@solomoncyj solomoncyj commented Dec 11, 2024

TODO :

  • i noticed that this is not platform-specific.eg, for vlc, there is a dep named CFNetwork which is only needed for osx building, but not for linux. is there a way to filter dependencies by platform?

@solomoncyj solomoncyj requested a review from jpakkane as a code owner December 11, 2024 15:40
data/buildreq.py Fixed Show fixed Hide fixed
mesongenbuildreq.py Fixed Show fixed Hide fixed
Copy link
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

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

mesongenbuildreq.py should definitely not be in the repository root. If its goal is to ship with the rpm macros then maybe put it in data/ instead (and rpm packages for meson can install both at the same time).

As a general rule of thumb please squash all changes into one commit per logical change intended for integration, rather than one commit per text editor session.

data/macros.meson Outdated Show resolved Hide resolved
Comment on lines 4 to 6
deps_json = json.loads(subprocess.run([sys.argv[0], "introspect", "--dependencies", "meson.build"], capture_output=True).stdout)
deps = dict(zip([x['name'] for x in deps_json],[x['version'] for x in deps_json]))
deps.pop('', None)
Copy link
Member

Choose a reason for hiding this comment

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

Note that dependencies can be optional (e.g. required: false) but I guess the goal is to build-time-only require things that are plausibly needed even if not necessarily used by a given build (collecting runtime dependencies can be done by tracing DT_NEEDED tags)?

@solomoncyj solomoncyj force-pushed the patch-1 branch 2 times, most recently from 0d7f04b to aa84752 Compare December 12, 2024 01:47
data/mesongenbuildreq.py Fixed Show fixed Hide fixed
data/mesongenbuildreq.py Fixed Show fixed Hide fixed
@solomoncyj
Copy link
Author

one problen i noticed that this is not platfor-specific.eg, for vlc, there is a dep named CFNetwork which is only needed for osx building, but not for linux. is there a way to filter dependencies by platform?

data/mesongenbuildreq.py Outdated Show resolved Hide resolved
data/macros.meson Outdated Show resolved Hide resolved
data/macros.meson Outdated Show resolved Hide resolved
data/mesongenbuildreq.py Outdated Show resolved Hide resolved
data/macros.meson Outdated Show resolved Hide resolved
Comment on lines +7 to +9
deps = {}
for lib in list(unsorted_deps.keys()) :
deps[lib] = unsorted_deps[lib]
Copy link
Member

Choose a reason for hiding this comment

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

This isn't sorting anything, just making an unsorted copy.

deps = dict(sorted(unsorted_deps.items(), key=lambda x: x[0])))

should created a sorted dictionary based on the unsorted deps above.

Although, looking at the code you don't even really need to make it a dictionary, you can just used the deps = sorted(...), and then just iterate for lib, version in deps:

@@ -2,8 +2,11 @@
import json
import sys
deps_json = json.loads(subprocess.run([sys.argv[1], "introspect", "--dependencies", "meson.build"], capture_output=True).stdout)
deps = dict(sorted(zip([x['name'] for x in deps_json],[x['version'] for x in deps_json])))
deps.pop('', None)
unsorted_deps = dict(zip([x['name'] for x in deps_json],[x['version'] for x in deps_json]))
Copy link
Member

Choose a reason for hiding this comment

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

While you're changing this, can you add a space after the coma? deps_json], [x['version']

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

Successfully merging this pull request may close these issues.

6 participants