question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose an option to turn off mangling

See original GitHub issue

Hey! I chatted a bit with @MatrixFrog, and he asked me to file an issue.

We recently started using GCC for building React and are loving it! Unfortunately, we can only use GCC for the open source builds, and not the ones we use at Facebook.

For the Facebook builds, we could only use GCC if there was an option to turn off name mangling in simple mode. We have our own minifier, and we can’t check in minified code into the repository as it makes debugging traces very difficult. Even if we checked in sourcemaps, those wouldn’t work with our internal tooling.

Currently, we use Uglify for internal builds. It provides a mangle: false option that keeps dead code elimination and other optimizations, but doesn’t transform the names. I am asking to provide a similar option for GCC so that we can use excellent other GCC optimizations while keeping the production build source human-readable. Our ideal setup right now would be GCC in simple mode with turned off mangling + Prettier for formatting the output nicely.

I recognize options are a huge maintenance burden and totally understand if that’s not something you would consider. We would very much appreciate even an “unofficial” flag though.

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ChadKillingsworthcommented, Oct 30, 2017

I believe parsing is considerably slower. Stack traces from compiler crashes are not great. All the core devs work with the Java version.

The JS version is definitely viewed as experimental. While it’s the same core code base that gets transpiled down, there is logic that cannot be shared. Particularly the logic around flags and starting a compile job. It’s always just the last piece that gets attention.

There are also advanced features (such as restricting code patterns) that are simply not available in JS version.

0reactions
gaearoncommented, Nov 10, 2017

Fixed via #2707.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The extern "C" specifier disables C++ mangling, but that ...
To disable name mangling either use a .def file (EXPORTS keyword) or declare the function as extern “C”. This is an understandable ...
Read more >
how to stop name mangling in Qt class? - Stack Overflow
'MyClass' will be mangled into a C++ name, and there isn't really any way to expose 'SomeFunction' as a member of MyClass, without...
Read more >
SE-0262: Demangle Function - Proposal Reviews - Swift Forums
I'm not sure how swift_demangle is used internally, but it could make sense to expose some of these options as flags.
Read more >
Overriding the Create-React-App Webpack Configuration ...
If you have access to the Webpack configuration, disabling name mangling is just a matter of changing 2 lines of code: // in...
Read more >
2603-rust-symbol-name-mangling-v0 - The Rust RFC Book
Make <binder> optional in <fn-sig> and <dyn-bounds> productions. Extend <const-data> to include bool values, char values, and negative integer values. Remove ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found