apache / royale-compiler

Apache Royale Compiler
https://royale.apache.org/
Apache License 2.0
95 stars 49 forks source link

Binding Data Missing in Debug and Release Builds ~20% of Builds #182

Open brianraymes opened 3 years ago

brianraymes commented 3 years ago

The issue with binding data missing in builds, both release and debug, is starting to seem worse and worse. This is not a new issue, but is now bad enough that it seems to happen in roughly 20% of all builds. In my case, this is with Maven.

When this issue occurs, various UI elements are missing, or authentication with AMF fails as some of those objects may be missing the binding data.

When comparing good and bad builds, this is the header to the missing from the generated javascript:

/**
 * @export
 */
com.some.package.path.prototype._bindings = [
   ...
   ...
   ...
]

This would be less of an issue if this were only isolated to debug builds, but when using release automation, this is starting to be considerably problematic.

greg-dove commented 3 years ago

I was generally aware of the issue you describe, but have not seen this for a long long time, and I use Maven all the time. If it has been getting worse perhaps it is memory-related as your project has grown. Have you tried a generous memory allocation to see if that makes any difference? probably in this case it might be via MAVEN_OPTS. I can't think of anything else offhand.

brianraymes commented 3 years ago

Interesting. My project is fairly large. I will give that a try and report back. Thank you.

brianraymes commented 3 years ago

I believe this has helped for now. My Royale project is roughly at 1,500 files and growing. Haven't seen the issue since increasing the memory. I'll report more findings as I learn more. At the least, this is a suitable workaround.

brianraymes commented 3 years ago

This fix appeared to be short lived, or coincidence. It appears to be happening more and more. I've been tweaking the values, for instance, currently at:

-Xmx6144m -Xms2048m -Djava.awt.headless=true

It's still happening quite a lot.

IMO, build systems should be deterministic. Lack of memory shouldn't change the output, but instead perhaps make it slower to achieve the desired result.

Thoughts?