-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
centrifuge-core: add linux-aarch64 build #51517
Conversation
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces modifications to two files: In Possibly related PRs
Suggested labels
Suggested reviewers
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
CodeRabbit Configuration File (
|
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: 3
🧹 Outside diff range and nitpick comments (1)
recipes/centrifuge-core/meta.yaml (1)
37-43
: LGTM: Metadata improvements enhance package information.The changes in the 'about' section are well-considered:
- The updated home URL now points to the official project page.
- The license specification is more precise (GPL-3.0-only) and includes a license file, which is excellent.
- The addition of dev_url and doc_url provides valuable resources for users and developers.
These updates improve the package's metadata and align with best practices.
Consider adding a brief description to the
summary
field to provide more context about the package's functionality.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- recipes/centrifuge-core/build.sh (1 hunks)
- recipes/centrifuge-core/meta.yaml (2 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/centrifuge-core/build.sh
[warning] 15-15: Quotes/backslashes will be treated literally. Use an array.
(SC2089)
[warning] 22-22: Quotes/backslashes in this variable will not be respected.
(SC2090)
🔇 Additional comments (4)
recipes/centrifuge-core/build.sh (2)
3-3
: Improved script robustness and debuggability.The addition of
set -xe
is a good practice. It enables command tracing (-x
) for easier debugging and ensures the script exits immediately if any command fails (-e
), preventing cascading errors.
1-24
: Approve overall structure and completeness of the build script.The build script has been successfully enhanced to support architecture-specific compilation, particularly for linux-aarch64. The overall structure is logical, and the script is complete with necessary steps for building and installing the package.
The script now:
- Sets up the environment
- Detects the architecture and sets appropriate flags
- Modifies the Makefile
- Builds and installs the package
These changes align well with the PR objective of adding linux-aarch64 build support.
🧰 Tools
🪛 Shellcheck
[warning] 15-15: Quotes/backslashes will be treated literally. Use an array.
(SC2089)
[warning] 22-22: Quotes/backslashes in this variable will not be respected.
(SC2090)
recipes/centrifuge-core/meta.yaml (2)
9-9
: LGTM: Build number increment is appropriate.The build number has been correctly incremented from 0 to 1. This is the expected practice when modifying a package without changing its version, which aligns with the addition of linux-aarch64 support.
Line range hint
9-47
: Summary: Well-implemented changes enhancing package metadata and platform support.The modifications to this meta.yaml file are comprehensive and align well with the PR objectives:
- The build number increment reflects the changes made to the package.
- The 'about' section updates improve the accuracy and completeness of the package metadata.
- The addition of linux-aarch64 to the 'additional-platforms' list extends the package's compatibility.
These changes enhance the package's documentation and usability while preparing it for broader platform support.
recipes/centrifuge-core/build.sh
Outdated
sed "/^GCC/d;/^CC =/d;/^CPP =/d;/^CXX =/d" < Makefile > Makefile.new | ||
mv Makefile.new Makefile | ||
cat Makefile | ||
make CC=$CC CXX=$CXX RELEASE_FLAGS="$CXXFLAGS" | ||
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS} |
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.
Update make command to use ARCH_FLAGS array.
The use of ${ARCH_FLAGS} in the make command is correct, but it needs to be updated if ARCH_FLAGS is changed to an array as suggested earlier.
Update the make command as follows:
-make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS}
+make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}"
This change ensures that the array elements of ARCH_FLAGS are properly expanded and passed to the make command.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS} | |
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}" |
🧰 Tools
🪛 Shellcheck
[warning] 22-22: Quotes/backslashes in this variable will not be respected.
(SC2090)
additional-platforms: | ||
- linux-aarch64 |
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.
💡 Codebase verification
Issue Detected: Incomplete aarch64 Handling in build.sh
While linux-aarch64
has been added to the additional-platforms
in meta.yaml
, the build.sh
script does not appear to include specific environment configurations, dependency installations, or build commands for aarch64
. This may result in build failures or incomplete support for the linux-aarch64
architecture.
- File:
recipes/centrifuge-core/build.sh
- Action Needed: Implement
aarch64
-specific environment variables, dependency installations, and build commands to ensure proper support.
🔗 Analysis chain
LGTM: Addition of linux-aarch64 support.
The inclusion of linux-aarch64 in the 'additional-platforms' list aligns with the PR objective of adding support for this architecture.
To ensure complete implementation, let's verify that the build.sh script properly handles the aarch64 architecture:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that build.sh handles aarch64 architecture
# Test: Check if build.sh contains aarch64-specific logic
rg -i 'aarch64|arm64' recipes/centrifuge-core/build.sh
Length of output: 77
Script:
#!/bin/bash
# Description: Verify comprehensive handling of aarch64 in build.sh
# Check for aarch64-specific environment variables
rg -i 'export.*aarch64' recipes/centrifuge-core/build.sh
# Check for aarch64 in dependency installations
rg -i 'aarch64' recipes/centrifuge-core/build.sh | grep -i 'install\|depend'
# Check for aarch64 in build commands
rg -i 'aarch64' recipes/centrifuge-core/build.sh | grep -i 'build\|compile'
Length of output: 211
Script:
#!/bin/bash
# Description: Verify comprehensive handling of linux-aarch64 in build.sh
# Check for linux-aarch64-specific environment variables
rg -i 'export.*linux-aarch64' recipes/centrifuge-core/build.sh
# Check for linux-aarch64 in dependency installations
rg -i 'linux-aarch64' recipes/centrifuge-core/build.sh | grep -i 'install\|depend'
# Check for linux-aarch64 in build commands
rg -i 'linux-aarch64' recipes/centrifuge-core/build.sh | grep -i 'build\|compile'
# Additionally, verify any references to 'linux-aarch64' in conditional statements
rg -i 'linux-aarch64' recipes/centrifuge-core/build.sh | grep -i 'if\|case'
Length of output: 305
a715c84
to
7c65adb
Compare
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: 2
🧹 Outside diff range and nitpick comments (1)
recipes/centrifuge-core/build.sh (1)
10-17
: Consider adding a comment to explain architecture-specific flags.While the implementation of architecture-specific flags is good, it would be helpful to add a brief comment explaining why these specific flags are needed for aarch64/arm64 architectures. This would improve the maintainability of the script and help future contributors understand the rationale behind these changes.
For example, you could add:
# For aarch64/arm64, disable POPCNT and use signed char to ensure compatibility
This additional context will be valuable for future maintenance and updates to the build script.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- recipes/centrifuge-core/build.sh (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
recipes/centrifuge-core/build.sh (2)
2-3
: Excellent addition of error handling and debugging.The addition of
set -xe
is a great improvement. It will cause the script to exit immediately if any command fails (-e
) and print each command before execution (-x
), enhancing error handling and debugging capabilities.
1-24
: Summary of review and next stepsThe changes to
build.sh
successfully introduce support for linux-aarch64 architecture, aligning with the PR objectives. The additions improve error handling, introduce architecture-specific compilation flags, and update the build process accordingly.To finalize these changes:
- Implement the suggested modifications to
ARCH_FLAGS
to use an array.- Update the
make
command to properly expand theARCH_FLAGS
array.- Consider adding a comment to explain the rationale behind the architecture-specific flags.
Once these changes are made, the script will be more robust, maintainable, and aligned with best practices for shell scripting.
sed "/^GCC/d;/^CC =/d;/^CPP =/d;/^CXX =/d" < Makefile > Makefile.new | ||
mv Makefile.new Makefile | ||
cat Makefile | ||
make CC=$CC CXX=$CXX RELEASE_FLAGS="$CXXFLAGS" | ||
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}" |
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.
Update make command to use ARCH_FLAGS array.
Once you've implemented the change to make ARCH_FLAGS
an array, please update the make
command to properly expand the array:
-make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS}
+make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}"
This change ensures that the array elements of ARCH_FLAGS
are properly expanded and passed to the make
command.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}" | |
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}" |
7c65adb
to
eef7230
Compare
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- recipes/centrifuge-core/build.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/centrifuge-core/build.sh
[warning] 15-15: Quotes/backslashes will be treated literally. Use an array.
(SC2089)
[error] 22-22: Double quote array expansions to avoid re-splitting elements.
(SC2068)
[warning] 22-22: Quotes/backslashes in this variable will not be respected.
(SC2090)
🔇 Additional comments (2)
recipes/centrifuge-core/build.sh (2)
2-3
: Approve addition ofset -xe
The addition of
set -xe
is a good practice. It enables debugging (-x
) and causes the script to exit immediately if any command fails (-e
), which can help catch and diagnose issues early.
1-24
: Overall changes align well with PR objectivesThe modifications to this build script effectively add support for the linux-aarch64 architecture, which is in line with the PR objective of introducing a build for the linux-aarch64 architecture for the centrifuge-core package. The script now detects the machine architecture and applies appropriate compilation flags, particularly for aarch64/arm64 platforms.
Once the suggested changes regarding the use of arrays for
ARCH_FLAGS
are implemented, this script will provide robust support for building on different architectures, including linux-aarch64.Great job on implementing these changes! They significantly contribute to achieving the PR's goals.
🧰 Tools
🪛 Shellcheck
[warning] 15-15: Quotes/backslashes will be treated literally. Use an array.
(SC2089)
[error] 22-22: Double quote array expansions to avoid re-splitting elements.
(SC2068)
[warning] 22-22: Quotes/backslashes in this variable will not be respected.
(SC2090)
recipes/centrifuge-core/build.sh
Outdated
sed "/^GCC/d;/^CC =/d;/^CPP =/d;/^CXX =/d" < Makefile > Makefile.new | ||
mv Makefile.new Makefile | ||
cat Makefile | ||
make CC=$CC CXX=$CXX RELEASE_FLAGS="$CXXFLAGS" | ||
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS[@]} |
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.
Update make command to use ARCH_FLAGS array correctly
The current usage of ${ARCH_FLAGS[@]}
in the make command is incorrect, as ARCH_FLAGS
is not yet defined as an array. Once you've implemented the change to make ARCH_FLAGS
an array as suggested in the previous comment, update the make
command to properly expand the array:
-make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS[@]}
+make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}"
This change ensures that the array elements of ARCH_FLAGS
are properly expanded and passed to the make
command, resolving the static analysis warnings.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX ${ARCH_FLAGS[@]} | |
make -j"${CPU_COUNT}" CC=$CC CXX=$CXX "${ARCH_FLAGS[@]}" |
🧰 Tools
🪛 Shellcheck
[error] 22-22: Double quote array expansions to avoid re-splitting elements.
(SC2068)
[warning] 22-22: Quotes/backslashes in this variable will not be respected.
(SC2090)
recipes/centrifuge-core/build.sh
Outdated
case $(uname -m) in | ||
aarch64 | arm64) | ||
ARCH_FLAGS="POPCNT_CAPABILITY=0 RELEASE_FLAGS=\"${CXXFLAGS} -fsigned-char\"" | ||
;; | ||
*) | ||
ARCH_FLAGS="RELEASE_FLAGS=\"${CXXFLAGS}\"" | ||
;; | ||
esac |
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.
Use an array for ARCH_FLAGS to improve robustness
The addition of architecture-specific compilation flags is good and aligns with the PR objective. However, using a string for ARCH_FLAGS
can lead to issues with spaces and special characters. Let's implement an array as suggested in previous comments:
case $(uname -m) in
aarch64 | arm64)
- ARCH_FLAGS="POPCNT_CAPABILITY=0 RELEASE_FLAGS=\"${CXXFLAGS} -fsigned-char\""
+ ARCH_FLAGS=(POPCNT_CAPABILITY=0 "RELEASE_FLAGS=${CXXFLAGS} -fsigned-char")
;;
*)
- ARCH_FLAGS="RELEASE_FLAGS=\"${CXXFLAGS}\""
+ ARCH_FLAGS=("RELEASE_FLAGS=${CXXFLAGS}")
;;
esac
This change uses an array for ARCH_FLAGS
, which will properly handle spaces and special characters in the CXXFLAGS
variable and resolve the static analysis warning.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
case $(uname -m) in | |
aarch64 | arm64) | |
ARCH_FLAGS="POPCNT_CAPABILITY=0 RELEASE_FLAGS=\"${CXXFLAGS} -fsigned-char\"" | |
;; | |
*) | |
ARCH_FLAGS="RELEASE_FLAGS=\"${CXXFLAGS}\"" | |
;; | |
esac | |
case $(uname -m) in | |
aarch64 | arm64) | |
ARCH_FLAGS=(POPCNT_CAPABILITY=0 "RELEASE_FLAGS=${CXXFLAGS} -fsigned-char") | |
;; | |
*) | |
ARCH_FLAGS=("RELEASE_FLAGS=${CXXFLAGS}") | |
;; | |
esac |
🧰 Tools
🪛 Shellcheck
[warning] 15-15: Quotes/backslashes will be treated literally. Use an array.
(SC2089)
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
eef7230
to
de109ea
Compare
Describe your pull request here
Please read the guidelines for Bioconda recipes before opening a pull request (PR).
General instructions
@BiocondaBot please add label
command.@bioconda/core
in a comment.Instructions for avoiding API, ABI, and CLI breakage issues
Conda is able to record and lock (a.k.a. pin) dependency versions used at build time of other recipes.
This way, one can avoid that expectations of a downstream recipe with regards to API, ABI, or CLI are violated by later changes in the recipe.
If not already present in the meta.yaml, make sure to specify
run_exports
(see here for the rationale and comprehensive explanation).Add a
run_exports
section like this:with
...
being one of:{{ pin_subpackage("myrecipe", max_pin="x") }}
{{ pin_subpackage("myrecipe", max_pin="x.x") }}
{{ pin_subpackage("myrecipe", max_pin="x.x") }}
(in such a case, please add a note that shortly mentions your evidence for that){{ pin_subpackage("myrecipe", max_pin="x.x.x") }}
(in such a case, please add a note that shortly mentions your evidence for that){{ pin_subpackage("myrecipe", max_pin=None) }}
while replacing
"myrecipe"
with eithername
if aname|lower
variable is defined in your recipe or with the lowercase name of the package in quotes.Bot commands for PR management
Please use the following BiocondaBot commands:
Everyone has access to the following BiocondaBot commands, which can be given in a comment:
@BiocondaBot please update
@BiocondaBot please add label
please review & merge
label.@BiocondaBot please fetch artifacts
You can use this to test packages locally.
Note that the
@BiocondaBot please merge
command is now depreciated. Please just squash and merge instead.Also, the bot watches for comments from non-members that include
@bioconda/<team>
and will automatically re-post them to notify the addressed<team>
.