-
Notifications
You must be signed in to change notification settings - Fork 147
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: don't build longhorn-manager twice before packaging #3226
Conversation
WalkthroughThe changes in the pull request involve modifying a script to update the condition for checking the existence of the Changes
Assessment against linked issues
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
scripts/package (1)
12-14
: Approve changes with suggestions for further improvementThe modification addresses the issue of redundant builds by checking for the existence of both amd64 and arm64 binaries before initiating the build process. This change aligns with the PR objectives and should help reduce build times in cases where the binaries are already present.
However, to further optimize the build process and address the concerns raised in issue #8744, consider the following suggestions:
- Implement architecture-specific build options to allow building for a single architecture when needed.
- Add a flag to force rebuilding even if binaries exist, which could be useful for development and testing.
Example implementation:
ARCH=${ARCH:-"both"} FORCE_BUILD=${FORCE_BUILD:-false} build_binary() { echo "Building longhorn-manager binary for $1 architecture" ARCH=$1 ./scripts/build } if [ "$ARCH" = "both" ]; then if [ ! -e ./bin/longhorn-manager-amd64 ] || [ ! -e ./bin/longhorn-manager-arm64 ] || [ "$FORCE_BUILD" = true ]; then build_binary amd64 build_binary arm64 fi elif [ "$ARCH" = "amd64" ]; then if [ ! -e ./bin/longhorn-manager-amd64 ] || [ "$FORCE_BUILD" = true ]; then build_binary amd64 fi elif [ "$ARCH" = "arm64" ]; then if [ ! -e ./bin/longhorn-manager-arm64 ] || [ "$FORCE_BUILD" = true ]; then build_binary arm64 fi else echo "Invalid architecture specified. Use 'amd64', 'arm64', or 'both'." exit 1 fiThese changes would provide more flexibility and potentially further reduce build times when working with a single architecture.
Longhorn 8744 Signed-off-by: Derek Su <derek.su@suse.com>
@mergify backport v1.7.x v1.6.x |
✅ Backports have been created
|
Which issue(s) this PR fixes:
Issue longhorn/longhorn#8744
What this PR does / why we need it:
Special notes for your reviewer:
Additional documentation or context