-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Add build option to enable MP1 and MP2 support in minimp3 #72729
Conversation
I don't know if it makes sense to add even 3.5k to the export template to support one game. Couldn't you transcode these audio files or maintain a separate export template? 3.5k doesn't seem like much but for web games where it's common to strip down the export template via a custom build, every kb counts. |
The difference in HTML5 export templates is likely smaller (since these use |
We're talking about a feature that likely only one person will ever use, though. And it seems like @Ithamar is more than capable of making their own export templates. I know 3.5k is practically nothing, but I still don't think this is a valuable feature for the mainline engine to have, and I think guidance is still to refuse-by-default to keep the engine small, right? https://godotengine.org/article/will-your-contribution-be-merged-heres-how-tell/ |
@ellenhp would a build-time option be acceptable? Or are you suggesting I maintain a fork? |
I'll stick my nose in here to say that, were the mp2/mp1 branch be too big in html builds and considering that these formats are completely unused outside of remakes, a build flag would be perfect IMO, since it's basically a three line patch. |
A build time option would be fine by me! I'm not opposed to this feature existing especially considering how little code maintenance burden it is for us (it's all in minimp3) but I just think that when someone goes to create a stripped-down web export for their game by removing every node that they don't use, that web export shouldn't have to know how to decode MP2. :) |
@ellenhp thinking about it, are there some benchmarks about template size in relation to available features? I think that there might be lots of similar cases of "mostly unused thing that could be hidden behind a switch" that we could get rid of. While this is a bit OT, #50148 might come useful in this regard, but as I said we should probably move into another thread if there exists one. |
Sorry for the "redo everything" review, at least I suggested a lot of changes, so you should be able to just apply them if you agree. BTW Don't forget to squash everything once you're done! |
No problem, its not like it is a lot of code, so even if I do it manually it is not a lot of work ;)
Ah, Github does not do that automagically? I'm more used to Gitlab which has an PR option to do this at merge time. |
Nope.
I doubt that most of us use this platform out of favour :P |
Actually, turns out Github has the option too, it might be an idea to simply enforce this for PRs if it is the expected behaviour anyway...... |
We don't use this option on the main repo, because it doesn't create merge commits. |
I made https://github.com/Calinou/godot-size-benchmarks a few years ago, but I also had another script that invidiaully compiled Godot with each module disabled and found that |
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.
Other than a teeny tiny issue (which is also my fault), this looks like a great lil' patch!
18faeb9
to
728cb09
Compare
So I updated this PR to current master again, is there anything else I can do to help get this merged? |
This looks fine overall as an option, but there's a problem with the implementation, as it's not self-contained. Modules are meant to be self-contained so the module-specific config can't modify Thankfully there's a way to register new options from the module itself, I just tested it locally so I'll push an update to your PR directly with this change. |
Ah, I was not aware of that.
Awesome, I'll take a look at your changes to see how it is done in case I need something similar in the future. Thanks very much! |
Seems like I don't have permission to push changes to the PR branch, so I pushed changes in my fork: akien-mga@e75da97 This is making use of If you can push this commit to your fork's branch to update this PR, it should be good to go. |
a92d84f
to
8719f7f
Compare
Enabling this adds 3.5k to the template size (Win/64bits). Co-authored-by: Riteo <riteo@posteo.net> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
8719f7f
to
36ff059
Compare
@@ -375,6 +375,8 @@ for name, path in modules_detected.items(): | |||
else: | |||
enabled = False | |||
|
|||
opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled)) |
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.
For context, I moved this so that the module_<name>_enabled
option would come before the options specific to that module in scons --help
. It shouldn't impact any of the logic otherwise (unless some custom modules rely on this being undefined in get_opts
, but I doubt it :)).
Thanks! And congrats for your first merged Godot contribution 🎉 |
Thank you for helping getting it over the line! Also, is there a contributors file that I need to send a PR on, as this actually my 3rd (merged) contribution (see #71394 and #65717) and every time I get congratulated for my first merged issue (not complaining, just wondering why 😛 ) |
This means that your commits are not linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. Despite this third merge, you're still shown like this: |
This adds only 3.5k to the template size (Win/64bits).
fixes #72688