Skip to content
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

bayestyper: add arm64/aarch64 builds #52076

Merged
merged 5 commits into from
Nov 12, 2024
Merged

bayestyper: add arm64/aarch64 builds #52076

merged 5 commits into from
Nov 12, 2024

Conversation

mencian
Copy link
Contributor

@mencian mencian commented Nov 12, 2024

Describe your pull request here


Please read the guidelines for Bioconda recipes before opening a pull request (PR).

General instructions

  • If this PR adds or updates a recipe, use "Add" or "Update" appropriately as the first word in its title.
  • New recipes not directly relevant to the biological sciences need to be submitted to the conda-forge channel instead of Bioconda.
  • PRs require reviews prior to being merged. Once your PR is passing tests and ready to be merged, please issue the @BiocondaBot please add label command.
  • Please post questions on Gitter or ping @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:

build:
  run_exports:
    - ...

with ... being one of:

Case run_exports statement
semantic versioning {{ pin_subpackage("myrecipe", max_pin="x") }}
semantic versioning (0.x.x) {{ pin_subpackage("myrecipe", max_pin="x.x") }}
known breakage in minor versions {{ pin_subpackage("myrecipe", max_pin="x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
known breakage in patch versions {{ pin_subpackage("myrecipe", max_pin="x.x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
calendar versioning {{ pin_subpackage("myrecipe", max_pin=None) }}

while replacing "myrecipe" with either name if a name|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 Merge the master branch into a PR.
@BiocondaBot please add label Add the please review & merge label.
@BiocondaBot please fetch artifacts Post links to CI-built packages/containers.
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>.

@mencian mencian added aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Nov 12, 2024
Copy link
Contributor

coderabbitai bot commented Nov 12, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces significant updates to the build-fail-blacklist, which now includes a detailed list of recipes that have been identified as problematic due to various issues. The changes primarily involve adding entries to the blacklist for recipes that fail to build, experience excessive resource usage, have compatibility issues, lack maintenance, or encounter unresolved errors during the build process. Additionally, the pull request modifies the CMakeLists.txt and other related files for the bayestyper project, enhancing the configuration for Boost libraries, improving header file inclusions, and refining the build script to utilize modern CMake features. The meta.yaml file has also been updated to use Jinja2 templating for dynamic package naming and versioning, increment the build number, and add new fields for licensing and documentation. Overall, the changes aim to streamline the build process and improve compatibility across different systems and configurations.

Possibly related PRs

  • update d4tools and d4binding #48077: This PR also updates the build-fail-blacklist, adding problematic recipes similar to the main PR's focus on identifying and excluding recipes that fail to build.
  • pepnovo: add aarch64/arm64 build #51206: This PR includes updates to the build-fail-blacklist and addresses problematic recipes, aligning with the main PR's objective of managing build failures.
  • d4binding: add aarch64/arm64 builds #51598: This PR adds ARM architecture support for the d4binding package, which may relate to the main PR's focus on managing build failures and compatibility issues, particularly for recipes requiring migration or updates.
  • Sentieon add ARM support #51837: This PR adds ARM support for the sentieon package, which is relevant to the main PR's emphasis on addressing build issues and compatibility across different architectures.
  • mutyper: add aarch64/arm64 builds #51905: This PR introduces builds for the aarch64/arm64 architecture for the mutyper package, which aligns with the main PR's focus on managing problematic recipes and ensuring compatibility across architectures.

Suggested labels

please review & merge


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (6)
recipes/bayestyper/meta.yaml (1)

43-50: Consider enhancing test coverage while platform additions look good

The addition of arm64 platforms aligns with the PR objectives. However, the test commands could be more comprehensive.

Consider adding these additional test aspects:

  • Version number verification
  • Basic functionality tests
  • Help command verification

Example enhancement:

  commands:
    - bayesTyper | grep "BayesTyper"
    - bayesTyperTools | grep "BayesTyperTools"
+   - bayesTyper --version | grep "{{ version }}"
+   - bayesTyper --help
+   - bayesTyperTools --help
recipes/bayestyper/bayestyper.patch (1)

24-25: Consider making debug messages conditional.

While these debug messages are helpful for troubleshooting build issues (especially during arm64 port), consider making them conditional:

-message(STATUS "======= DEBUG Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
-message(STATUS "======= DEBUG Boost_LIB_DIRS: " ${Boost_LIB_DIRS})
+if(CMAKE_DEBUG_OUTPUT)
+  message(STATUS "Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
+  message(STATUS "Boost_LIB_DIRS: " ${Boost_LIB_DIRS})
+endif()
recipes/bayestyper/0001-CMakeLists.patch (3)

10-17: LGTM! Good handling of Boost path configuration.

The added logic properly handles user-specified Boost paths, which is crucial for cross-compilation scenarios like arm64/aarch64. The conditions appropriately check both direct variables and environment variables.

For arm64/aarch64 builds, ensure that the Boost libraries are available in the build environment and their paths are correctly specified through these variables.


26-28: Consider conditionally enabling debug output.

The build options are well-configured, particularly the use of dynamic libraries which is appropriate for conda packages. However, consider making the debug output conditional.

 set( Boost_USE_STATIC_LIBS OFF )   
 set( Boost_USE_MULTITHREADED TRUE )
-set( Boost_DEBUG ON )
+option(BOOST_DEBUG "Enable Boost debug output" OFF)
+set( Boost_DEBUG ${BOOST_DEBUG} )

1-45: Well-structured CMake configuration for cross-compilation.

The overall approach to Boost configuration is robust and well-suited for cross-compilation scenarios. The combination of path handling, build options, and diagnostic output provides a solid foundation for arm64/aarch64 builds.

Consider adding a CI job specifically for testing arm64/aarch64 builds to catch any architecture-specific issues early. This could be implemented using GitHub Actions with arm64 runners or QEMU-based emulation.

recipes/bayestyper/build.sh (1)

5-9: Simplify environment variable settings for CMake builds

The variables INCLUDES, CPLUS_INCLUDE_PATH, and LIBPATH may not be necessary for CMake builds. CMake uses CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to locate headers and libraries. Consider setting these CMake variables directly or verify if these environment variables are required for this build.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 543f722 and 140b364.

📒 Files selected for processing (7)
  • build-fail-blacklist (0 hunks)
  • recipes/bayestyper/0001-CMakeLists.patch (1 hunks)
  • recipes/bayestyper/bayestyper.patch (1 hunks)
  • recipes/bayestyper/build.sh (1 hunks)
  • recipes/bayestyper/kmer_defs.patch (1 hunks)
  • recipes/bayestyper/meta.yaml (2 hunks)
  • recipes/bayestyper/stdafx.patch (1 hunks)
💤 Files with no reviewable changes (1)
  • build-fail-blacklist
✅ Files skipped from review due to trivial changes (1)
  • recipes/bayestyper/stdafx.patch
🧰 Additional context used
🪛 yamllint
recipes/bayestyper/meta.yaml

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (9)
recipes/bayestyper/kmer_defs.patch (1)

9-15: LGTM! Proper compiler-specific header handling for arm64 support.

The change correctly implements cross-compiler compatibility by:

  • Using standard <algorithm> for Clang which is common on arm64
  • Maintaining GCC support with <ext/algorithm> and explicit copy_n import

Let's verify the compiler detection works as expected:

recipes/bayestyper/meta.yaml (4)

17-20: LGTM! Good use of run_exports for ABI compatibility

The addition of run_exports with appropriate pinning helps maintain ABI compatibility across different architectures.


Line range hint 22-31: LGTM! Requirements are properly structured

The requirements are well-organized with appropriate separation between build, host, and run dependencies.


34-39: LGTM! Enhanced package metadata

Good improvements to the metadata section with additional URLs and proper license information.


11-15: Verify the necessity and impact of the added patches

The addition of multiple patches, especially platform-specific ones for OSX, warrants verification of their necessity and impact.

recipes/bayestyper/bayestyper.patch (2)

9-12: LGTM! Improved include statements for better cross-platform compatibility.

The change from quoted includes to angle brackets for Boost headers is a good practice for external dependencies and will help with consistent path resolution across different platforms, including arm64.


23-26: Verify arm64 build requirements.

While these changes improve build system portability, please verify:

  1. That Boost libraries are correctly detected on arm64 platforms
  2. Whether any additional platform-specific configurations are needed for arm64 support
recipes/bayestyper/0001-CMakeLists.patch (2)

30-41: Verify Boost version requirement for arm64/aarch64.

The Boost version requirement (1.71.0) needs verification for arm64/aarch64 compatibility. The configuration output is comprehensive and will help with debugging build issues.

Let's verify the Boost version availability in the conda-forge channel for arm64:

✅ Verification successful

Boost version requirement verified for arm64/aarch64.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Boost version availability in conda-forge
curl -s https://conda.anaconda.org/conda-forge/linux-aarch64/repodata.json | \
  jq -r '.packages | to_entries[] | select(.key | contains("boost-")) | .value.version' | \
  sort -V | uniq

Length of output: 430


19-24: LGTM! Proper handling of specific Boost path variables.

The use of OLD-style Boost lookup is appropriate here as it respects BOOST_INCLUDEDIR and BOOST_LIBRARYDIR variables, which is essential for cross-compilation scenarios.

Let's verify if there are any other CMake files that might need similar adjustments:

Comment on lines 26 to 29
chmod 0755 bin/*
mv bin/bayesTyper ${PREFIX}/bin
mv bin/bayesTyperTools ${PREFIX}/bin
cp -f src/bayesTyperTools/scripts/* ${PREFIX}/bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Correct the paths to the binaries and set permissions

Since the build directory is specified as build, the binaries are likely located in build/bin/ rather than bin/. Update the paths accordingly to ensure the binaries are correctly moved. Additionally, set execute permissions for all files in ${PREFIX}/bin.

Apply this diff to fix the paths and permissions:

-chmod 0755 bin/*
-mv bin/bayesTyper ${PREFIX}/bin
-mv bin/bayesTyperTools ${PREFIX}/bin
+chmod 0755 build/bin/*
+mv build/bin/bayesTyper ${PREFIX}/bin
+mv build/bin/bayesTyperTools ${PREFIX}/bin
 cp -f src/bayesTyperTools/scripts/* ${PREFIX}/bin
+chmod 0755 ${PREFIX}/bin/*
📝 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.

Suggested change
chmod 0755 bin/*
mv bin/bayesTyper ${PREFIX}/bin
mv bin/bayesTyperTools ${PREFIX}/bin
cp -f src/bayesTyperTools/scripts/* ${PREFIX}/bin
chmod 0755 build/bin/*
mv build/bin/bayesTyper ${PREFIX}/bin
mv build/bin/bayesTyperTools ${PREFIX}/bin
cp -f src/bayesTyperTools/scripts/* ${PREFIX}/bin
chmod 0755 ${PREFIX}/bin/*

Comment on lines +18 to +23
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DBOOST_ROOT="${PREFIX}" \
"${CONFIG_ARGS}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unnecessary quotes around ${CONFIG_ARGS}

Enclosing ${CONFIG_ARGS} in quotes can lead to issues when the variable is empty or contains multiple arguments. This can cause CMake to interpret it incorrectly. Remove the quotes to allow proper argument expansion.

Apply this diff to fix the issue:

 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
 	-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
 	-DCMAKE_CXX_COMPILER="${CXX}" \
 	-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
 	-DBOOST_ROOT="${PREFIX}" \
-	"${CONFIG_ARGS}"
+	${CONFIG_ARGS}
📝 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.

Suggested change
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DBOOST_ROOT="${PREFIX}" \
"${CONFIG_ARGS}"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DBOOST_ROOT="${PREFIX}" \
${CONFIG_ARGS}

@mencian mencian closed this Nov 12, 2024
@mencian mencian reopened this Nov 12, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
recipes/bayestyper/build.sh (1)

11-16: Reconsider blanket warning suppression on Darwin

Suppressing -Wno-deprecated-declarations and -Wno-unused-command-line-argument might hide important issues. Consider handling these warnings properly instead of suppressing them.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 140b364 and c725184.

📒 Files selected for processing (2)
  • recipes/bayestyper/bayestyper.patch (1 hunks)
  • recipes/bayestyper/build.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/bayestyper/bayestyper.patch
🔇 Additional comments (3)
recipes/bayestyper/build.sh (3)

18-23: Remove quotes around ${CONFIG_ARGS}

This issue was previously identified in a past review. The quotes around ${CONFIG_ARGS} can cause issues with argument expansion.


26-28: Update binary paths and permissions

This issue was previously identified in a past review. The binaries are likely in build/bin/ instead of bin/, and proper permissions need to be set.


18-24: Add arm64/aarch64-specific build configurations

Since this PR aims to add arm64/aarch64 builds, consider:

  1. Adding CPU feature detection for arm64-specific optimizations
  2. Verifying CMake toolchain settings for cross-compilation
  3. Testing with different optimization levels on arm64 hardware

Comment on lines +5 to +9
export INCLUDES="-I${PREFIX}/include"
export CPLUS_INCLUDE_PATH="${PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -O3 -std=c++14 -I${PREFIX}/include"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Make -O3 optimization configurable for arm64 builds

Currently, -O3 is hardcoded in CXXFLAGS for arm64/aarch64 builds in recipes/bayestyper/build.sh. Consider using -O2 for better stability or making the optimization level configurable based on the target architecture.

🔗 Analysis chain

Consider architecture-specific optimizations for arm64

The hardcoded -O3 optimization level might be too aggressive for arm64/aarch64 builds. Consider using -O2 for better stability or making it configurable based on the target architecture.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if there are any existing arm64 builds using O3 optimization
rg -l 'CXXFLAGS.*-O3' recipes/*/build.sh | xargs rg 'host.*aarch64|arm64'

Length of output: 192942

@mencian mencian merged commit b4149c7 into master Nov 12, 2024
6 checks passed
@mencian mencian deleted the bayestyper branch November 12, 2024 22:35
@mencian mencian removed aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant