-
Notifications
You must be signed in to change notification settings - Fork 0
fix release build #355
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
fix release build #355
Conversation
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.
The changes introduce a workaround to fix the release build by disabling compiler optimizations. This will negatively impact performance and should be addressed by finding the root cause of the build failure rather than shipping unoptimized code.
| # Build Swift release binary with our static libraries | ||
| swift build -c release \ | ||
| swift build -c release -Xswiftc -Onone -Xswiftc -whole-module-optimization -Xswiftc -package-cmo -Xswiftc -unavailable-decl-optimization=complete \ |
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.
Disabling Swift compiler optimizations with -Xswiftc -Onone for a release build is a significant concern. While it may resolve the immediate build failure, it will result in a binary with substantially worse performance. The underlying code or dependency issue that causes failures with optimization should be investigated and fixed, rather than shipping an unoptimized release artifact.
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.
| WORKDIR /boka/Boka | ||
|
|
||
| RUN swift build -c release | ||
| RUN swift build -c release -Xswiftc -Onone -Xswiftc -whole-module-optimization -Xswiftc -package-cmo -Xswiftc -unavailable-decl-optimization=complete |
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.
Similar to the workflow change, this disables Swift compiler optimizations (-Onone) for the Docker release build. This will negatively impact the performance of the application running in the container. The root cause of the optimization-related build failure should be identified to allow for a properly optimized release build.
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.
There are inconsistency between debug and release build behavior (release build cannot pass tests), and disabling some optimization in release build makes it work