Skip to content

Conversation

@Stuonts
Copy link
Contributor

@Stuonts Stuonts commented Feb 22, 2022

No description provided.

@Stuonts Stuonts force-pushed the js_functions_mergeinto_check_collisions branch from f597e26 to f936a5b Compare February 23, 2022 13:20
@sbc100
Copy link
Collaborator

sbc100 commented Feb 23, 2022

I think it might be good to add a test.

What is more, I think we have a test the deliberately overrides some system library, so I'm surprised that that test is not now failing.

@Stuonts
Copy link
Contributor Author

Stuonts commented Mar 29, 2022

I think it might be good to add a test.

What is more, I think we have a test the deliberately overrides some system library, so I'm surprised that that test is not now failing.

Test case have been added. Previous tests with rewriting don't fail because of optional flag by default in mergeInto (still rewrites functions by default)

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

@juj are you OK with this being an error? Or would you rather see it be warning? I think you are the only user of the symbol overriding that I know of.

@sbc100
Copy link
Collaborator

sbc100 commented Mar 29, 2022

It looks like some of the test failures are because you need to merge (or rebase) with origin/main.

@Stuonts
Copy link
Contributor Author

Stuonts commented Mar 29, 2022

@juj are you OK with this being an error? Or would you rather see it be warning? I think you are the only user of the symbol overriding that I know of.

It's better to have error rather than warning for us because:

  1. we have large project that can have immense console output, also we use build system that can hide console output

  2. basically, we have a lot of libraries and we add .js files associated with particular libraries. All end targets using libraries include .js files in the end and it creates risk of functions redefinitions (it could be mitigated by function names mangling, but we want something more reliable)

@sbc100
Copy link
Collaborator

sbc100 commented Mar 29, 2022

@juj are you OK with this being an error? Or would you rather see it be warning? I think you are the only user of the symbol overriding that I know of.

It's better to have error rather than warning for us because:

  1. we have large project that can have immense console output, also we use build system that can hide console output
  2. basically, we have a lot of libraries and we add .js files associated with particular libraries. All end targets using libraries include .js files in the end and it creates risk of functions redefinitions (it could be mitigated by function names mangling, but we want something more reliable)

Its possible we could add it as a warning and have -Werror honored in this context which would give the us flexibiity.

On the other hand I agree it would be simpler if we could just stick to and error (and force library authors to opt in with allowOverride)... It really depends how easy it will be for @juj to add allowOverride=true everywhere he needs it?

@Stuonts
Copy link
Contributor Author

Stuonts commented Mar 30, 2022

Another suggestion - to add function
mergeIntoNoOverride, so function won't have flags, it might be simpler to maintain for emscripten users

@juj
Copy link
Collaborator

juj commented Jun 4, 2022

@juj are you OK with this being an error? Or would you rather see it be warning? I think you are the only user of the symbol overriding that I know of.

On the other hand I agree it would be simpler if we could just stick to and error (and force library authors to opt in with allowOverride)... It really depends how easy it will be for @juj to add allowOverride=true everywhere he needs it?

Thanks for looking out and accommodating.. it does sound ok to me to make this an error, we should be able to adjust our libraries, and with a clear error message like it is now, it does guide users to what kind of modification they need to do to their code if the override is intentional.

One thing that comes to mind is it seems that now the filename that causes the error is not printed? That would be great to see. Although don't want to rope extra work from @Stuonts if we don't have that facility available now. (at a quick glance to utility.js and compiler.js I'm not sure if we do)

Another way might be to make it a warning and enable the -Werror=override-js-function style of diagnostics directives. Although either way is good to me - happy to go with a path that causes less friction to contributing here.

@Stuonts
Copy link
Contributor Author

Stuonts commented Jun 16, 2022

@juj
can try creating separate PR with error displaying - from what file mergeInto causing errors is called

@Stuonts
Copy link
Contributor Author

Stuonts commented Jun 29, 2022

@sbc100 , @kripken , @juj
can you please review?

@sbc100 sbc100 enabled auto-merge (squash) July 11, 2022 21:40
auto-merge was automatically disabled July 11, 2022 22:52

Head branch was pushed to by a user without write access

@Stuonts
Copy link
Contributor Author

Stuonts commented Jul 21, 2022

@sbc100
thanks for review
seems auto merge failed

@sbc100 sbc100 enabled auto-merge (squash) July 21, 2022 18:03
@sbc100 sbc100 merged commit fd71dae into emscripten-core:main Jul 21, 2022
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.

5 participants