-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
mesongenbuildreq.py
Outdated
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) |
There was a problem hiding this comment.
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)?
0d7f04b
to
aa84752
Compare
one problen i noticed that this is not platfor-specific.eg, for vlc, there is a dep named |
deps = {} | ||
for lib in list(unsorted_deps.keys()) : | ||
deps[lib] = unsorted_deps[lib] |
There was a problem hiding this comment.
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])) |
There was a problem hiding this comment.
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']
TODO :