Skip to content

Deduplicate the make_icu_data method in python#75642

Open
bradc6 wants to merge 1 commit intogodotengine:masterfrom
bradc6:refactor/DeDupMakeICUData
Open

Deduplicate the make_icu_data method in python#75642
bradc6 wants to merge 1 commit intogodotengine:masterfrom
bradc6:refactor/DeDupMakeICUData

Conversation

@bradc6
Copy link
Copy Markdown
Contributor

@bradc6 bradc6 commented Apr 4, 2023

There are multiple copies of the same function and this commit attempts to merge them together. I'm not super excited about the sys,path manipulation so if there is a better way please let me know. :)

Thank you for reviewing

@akien-mga
Copy link
Copy Markdown
Member

akien-mga commented Apr 4, 2023

I understand the wish to reduce code duplication, but given that it's a pretty simple function, I'm not convinced that this is worth the trouble. It makes more sense to me for this code to stay within the modules which use it, instead of making it global.

@bradc6
Copy link
Copy Markdown
Contributor Author

bradc6 commented Apr 4, 2023

I understand the wish to reduce code duplication, but given that it's a pretty simple function, I'm not convinced that this is worth the trouble. It makes more sense to me for this code to stay within the modules which use it, instead of making it global.

My concern would be that it is easy for them to get out of sync since it's possible for someone to expand a feature or fix a bug in one but miss the others. Maintainers/contributors need to ensure that all instances are up to date and they may not be familiar or aware of the duplication. We can imagine one of them getting out of date and could cause implicit and inconsistent build behavior.

Maybe there is a better shared python file location/instance; but ultimately it's up you whether it's worth it or not. I'm not directly blocked by this but noticed it while working through some code

Copy link
Copy Markdown
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

It's a tiny method, specific to the module, and most likely it will never change, so I'm not sure if it worth it.

self.Append(CXXFLAGS=["-w"])


def make_icu_data(target, source, env):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one is completely redundant (fallback TS do not use ICU) and can be removed.

self.Append(CXXFLAGS=["-w"])


def make_icu_data(target, source, env):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Won't work, this copy is for the GDExtension build, which does not include global methods, so Sconstruct in the gdextension_build should have code similar to the changes in SCsub to load it. And I'm not sure it won't conflict with other GDExtension stuff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What would you recommend is the best way to run into this error?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can run GDExtension build by cloning godot-cpp into modules/text_server_adv/gdextension_build and running scons from modules/text_server_adv/gdextension_build.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ty @bruvzg ; I'll get it all working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants