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

pgrc: add linux-aarch64 build #51009

Merged
merged 5 commits into from
Sep 30, 2024
Merged

pgrc: add linux-aarch64 build #51009

merged 5 commits into from
Sep 30, 2024

Conversation

martin-g
Copy link
Contributor

@martin-g martin-g commented Sep 27, 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>.

Summary by CodeRabbit

  • New Features
    • Enhanced compatibility by adding support for linux-aarch64 and osx-arm64 platforms.
    • Introduced a new dev_url linking to the project's GitHub repository.
  • Chores
    • Incremented the package build number to indicate a new version.
    • Updated license formatting for clarity.

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@martin-g martin-g added the aarch64 Related to adding linux-aarch64 support label Sep 27, 2024
Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Warning

Rate limit exceeded

@mencian has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between d280039 and d541e83.

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces modifications to the build.sh script and the meta.yaml file for the pgrc package. The build.sh script has been restructured to improve its functionality, including updates to environment variables and build commands. The meta.yaml file has been updated with an incremented build number, additional platform support, and new fields for better package identification and compatibility.

Changes

File Change Summary
recipes/pgrc/build.sh - Corrected shebang line.
- Removed directory navigation commands.
- Updated environment variable declarations.
- Added OS conditional for CONFIG_ARGS.
- Modified cmake command for clarity.
recipes/pgrc/meta.yaml - Build number updated from 0 to 1.
- Added llvm-openmp for macOS and libgomp for Linux.
- Added dev_url linking to GitHub.
- Adjusted license field formatting.
- Added linux-aarch64 and osx-arm64 under extra.
- Added DOI reference in identifiers.

Possibly related PRs

  • recipe for pgrc #50973: The changes in build.sh for the new recipe introduce a similar script structure and functionality, focusing on setting up the build environment and using cmake, which relates directly to the modifications made in the main PR's build.sh.

Suggested reviewers

  • gbayarri

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: 0

🧹 Outside diff range and nitpick comments (1)
recipes/pgrc/meta.yaml (1)

36-37: Approve addition of linux-aarch64, but suggest build section modification.

The addition of linux-aarch64 as an additional platform aligns with the PR objectives and is correctly placed in the extra section. However, to fully enable building for this platform, a modification to the build section is necessary.

Consider modifying the build section to remove the skip directive for non-OSX platforms. Apply this diff to the build section:

 build:
-  skip: True  # [osx]
+  skip: True  # [osx or win]
   number: 1
   run_exports:
     - {{ pin_subpackage('pgrc', max_pin="x") }}

This change will allow building for linux-aarch64 while still skipping OSX and Windows builds.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c681322 and 4b33ef1.

📒 Files selected for processing (1)
  • recipes/pgrc/meta.yaml (2 hunks)
🔇 Additional comments (2)
recipes/pgrc/meta.yaml (2)

10-10: LGTM: Build number increment is appropriate.

The build number has been correctly incremented from 0 to 1. This is the expected practice when making changes to a package without altering its version, which aligns with the addition of a new platform support.


Line range hint 1-38: LGTM: Overall changes and structure are appropriate.

The modifications to this Conda recipe align well with the PR objectives of adding a linux-aarch64 build. The build number has been correctly incremented, and the new platform has been added to the extra section. The overall structure and content of the recipe follow Conda packaging best practices.

Once the suggested modification to the build section is implemented, this recipe should successfully enable builds for the linux-aarch64 platform while maintaining the existing functionality for other supported platforms.

@martin-g
Copy link
Contributor Author

@BiocondaBot please fetch artifacts

@BiocondaBot
Copy link
Collaborator

Package(s) built are ready for inspection:

Arch Package Zip File / Repodata CI Instructions
linux-64 pgrc-2.0-h4ac6f70_1.tar.bz2 LinuxArtifacts.zip Azure
showYou may also use conda to install after downloading and extracting the zip file. From the LinuxArtifacts directory: conda install -c ./packages <package name>
linux-aarch64 pgrc-2.0-h78569d1_1.tar.bz2 repodata.json CircleCI
showYou may also use conda to install:conda install -c https://output.circle-artifacts.com/output/job/44fc0b7a-8f0e-411a-942b-9877e2f353af/artifacts/0/tmp/artifacts/packages <package name>

Docker image(s) built:

Package Tag CI Install with docker
pgrc 2.0--h4ac6f70_1 Azure
showImages for Azure are in the LinuxArtifacts zip file above.gzip -dc LinuxArtifacts/images/pgrc:2.0--h4ac6f70_1.tar.gz | docker load

@martin-g
Copy link
Contributor Author

mgrigorov in 🌐 euler-arm-22 in /tmp/pgrc via 🅒 kleidiai-env took 6s 
❯ tar xvf pgrc-2.0-h78569d1_1.tar.bz2                                                                                                                                                                 (kleidiai-env) 
info/files
info/run_exports.json
info/test/run_test.sh
info/hash_input.json
info/paths.json
info/recipe/build.sh
info/index.json
info/recipe/meta.yaml.template
info/recipe/meta.yaml
info/recipe/conda_build_config.yaml
info/about.json
info/licenses/LICENSE
info/git
bin/PgRC

mgrigorov in 🌐 euler-arm-22 in /tmp/pgrc via 🅒 kleidiai-env 
❯ file bin/*                                                                                                                                                                                          (kleidiai-env) 
bin/PgRC: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, with debug_info, not stripped

mgrigorov in 🌐 euler-arm-22 in /tmp/pgrc via 🅒 kleidiai-env 
❯ ./bin/PgRC                                                                                                                                                                                          (kleidiai-env) 
./bin/PgRC: Expected 1 argument after options (found 0)
try './bin/PgRC -h' for more information

LGTM!

@martin-g
Copy link
Contributor Author

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Sep 27, 2024
@mencian
Copy link
Contributor

mencian commented Sep 27, 2024

@martin-g mind if I hop in here and try to get this package to build on osx?

@martin-g
Copy link
Contributor Author

@mencian Sure! Go ahead!

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: 4

🧹 Outside diff range and nitpick comments (2)
recipes/pgrc/meta.yaml (1)

22-27: LGTM: Improved cross-platform compatibility.

The addition of llvm-openmp for macOS and libgomp for Linux in both host and run requirements improves cross-platform compatibility. This change supports the PR objective of adding a linux-aarch64 build and potentially improves macOS compatibility.

Consider consolidating the repeated entries for host and run requirements to reduce redundancy:

requirements:
  host:
    - {{ compiler('cxx') }}
    - cmake >=3.5
    - make
    - llvm-openmp  # [osx]
    - libgomp      # [linux]
  run:
    - {{ pin_compatible('llvm-openmp', max_pin='x')  }}  # [osx]
    - {{ pin_compatible('libgomp', max_pin='x')  }}      # [linux]

This approach uses Conda's pinning expressions to ensure compatibility between build and runtime versions.

recipes/pgrc/build.sh (1)

5-6: Remove unused INCLUDES and LIBPATH variables.

The variables INCLUDES and LIBPATH are defined but not used later in the script. Removing them will simplify the script and avoid confusion.

Apply this diff to remove the unused variables:

-export INCLUDES="-I${PREFIX}/include"
-export LIBPATH="-L${PREFIX}/lib"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4b33ef1 and d280039.

📒 Files selected for processing (2)
  • recipes/pgrc/build.sh (1 hunks)
  • recipes/pgrc/meta.yaml (2 hunks)
🔇 Additional comments (5)
recipes/pgrc/meta.yaml (5)

9-9: LGTM: Build number increment is correct.

Incrementing the build number from 0 to 1 is appropriate when making changes to the package without changing the version. This aligns with the PR objective of adding a linux-aarch64 build.


35-35: LGTM: Improved metadata in the about section.

The changes in the about section enhance the package metadata:

  1. The license field now uses quotes, which is a good practice for string values in YAML.
  2. Adding a period at the end of the summary improves readability.
  3. The new dev_url field provides a direct link to the project's GitHub repository, which is valuable for users and contributors.

These improvements align with best practices for Conda package metadata.

Also applies to: 38-39


47-48: LGTM: Added DOI for improved academic referencing.

The addition of the identifiers section with a DOI (Digital Object Identifier) is a valuable improvement:

  1. It enables proper academic citation of the software.
  2. It enhances the package's discoverability in academic contexts.
  3. It provides a persistent link to the research associated with this software.

This change aligns with best practices for scientific software packaging.


42-44: LGTM: Extended platform support.

The addition of linux-aarch64 and osx-arm64 to the additional-platforms list is a positive change:

  1. It aligns with the PR objective of adding a linux-aarch64 build.
  2. The inclusion of osx-arm64 suggests future support for Apple Silicon, which is a forward-thinking addition.

These changes broaden the package's compatibility across different architectures, enhancing its usability.

To ensure the build process is correctly set up for these new platforms, please run the following script:

This script will help identify any platform-specific configurations or patches that might be necessary for the new architectures.


Line range hint 1-48: Overall LGTM: Comprehensive improvements to the pgrc package recipe.

This PR makes several valuable enhancements to the pgrc package recipe:

  1. Incremented build number, reflecting the changes made.
  2. Improved cross-platform compatibility by adding appropriate OpenMP libraries for different operating systems.
  3. Extended platform support to include linux-aarch64 and osx-arm64.
  4. Enhanced metadata in the about section, including a dev_url and improved formatting.
  5. Added a DOI for better academic referencing.

These changes collectively improve the package's usability, compatibility, and discoverability. They align well with the PR objectives and Bioconda guidelines.

To ensure all changes are properly reflected in the build process, please run the following script:

This script will help ensure that all aspects of the recipe are consistent with the changes made and follow best practices.

export LDFLAGS="$LDFLAGS -L$BUILD_PREFIX/lib"
cmake ..
make -j ${CPU_COUNT} PgRC
export INCLUDES="-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.

⚠️ Potential issue

Fix typo in PREFIX variable expansion in INCLUDES.

In line 5, {PREFIX} should be ${PREFIX} to properly expand the variable. This ensures the include path is set correctly.

Apply this diff to fix the typo:

-export INCLUDES="-I{PREFIX}/include"
+export INCLUDES="-I${PREFIX}/include"
📝 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
export INCLUDES="-I{PREFIX}/include"
export INCLUDES="-I${PREFIX}/include"

make -j ${CPU_COUNT} PgRC
export INCLUDES="-I{PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -O3 -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.

🛠️ Refactor suggestion

Avoid hardcoding optimization flags in CXXFLAGS.

Appending -O3 to CXXFLAGS may override optimization levels set by the build environment. It's better to respect the environment's optimization settings to ensure consistent builds across different systems.

Apply this diff to adjust CXXFLAGS:

-export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include"
+export CXXFLAGS="${CXXFLAGS} -I${PREFIX}/include"
📝 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
export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include"
export CXXFLAGS="${CXXFLAGS} -I${PREFIX}/include"

Comment on lines +16 to +19
cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
"${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

Ensure CONFIG_ARGS is correctly passed to cmake.

Including CONFIG_ARGS within quotes may prevent proper argument parsing if it contains multiple flags. To ensure all arguments are correctly recognized, pass CONFIG_ARGS without quotes.

Apply this diff to adjust the cmake command:

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

Comment on lines +10 to +14
if [[ `uname` == "Darwin" ]]; then
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
else
export CONFIG_ARGS=""
fi
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

Update CONFIG_ARGS to Include Cross-Compilation Flags for linux-aarch64

The current configuration sets CONFIG_ARGS to an empty string for non-Darwin systems, which may not accommodate necessary cross-compilation flags for the linux-aarch64 build.

  • Recommendation: Modify the else branch in recipes/pgrc/build.sh to include appropriate cross-compilation flags required for linux-aarch64.
🔗 Analysis chain

Verify that CONFIG_ARGS is set appropriately for cross-compilation.

Since you're adding a linux-aarch64 build, ensure that CONFIG_ARGS handles cross-compilation scenarios correctly. The current script may need adjustments to accommodate cross-compiling to different architectures.

Run the following script to check for cross-compilation flags in CONFIG_ARGS:


Investigate CONFIG_ARGS Configuration for Cross-Compilation

The current execution shows that CONFIG_ARGS is not set. Please verify where and how CONFIG_ARGS is defined and ensure it includes the necessary cross-compilation flags for the linux-aarch64 build.


Further Investigate CONFIG_ARGS Assignments

The previous search did not locate any assignments to CONFIG_ARGS. To ensure all instances are found, please run the following script to search for CONFIG_ARGS assignments across the codebase.


Extract CONFIG_ARGS Assignments in recipes/pgrc/build.sh

Please run the following script to retrieve all instances where CONFIG_ARGS is set in recipes/pgrc/build.sh. This will help verify if the necessary cross-compilation flags for linux-aarch64 are included.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify CONFIG_ARGS for cross-compilation settings.

# Test: Search for cross-compilation flags in CONFIG_ARGS. Expect: Appropriate flags set.
echo "CONFIG_ARGS is: ${CONFIG_ARGS}"

# If targeting a different architecture, CONFIG_ARGS may need additional flags.

Length of output: 42


Script:

#!/bin/bash
# Description: Search for all assignments and modifications of CONFIG_ARGS in the codebase.

fd "CONFIG_ARGS" . --type f | xargs grep -H "CONFIG_ARGS"

Length of output: 55


Script:

#!/bin/bash
# Description: Recursively search for assignments and modifications of CONFIG_ARGS in the codebase.

rg "CONFIG_ARGS\s*=" --files-with-matches

Length of output: 427


Script:

#!/bin/bash
# Description: Extract all assignments to CONFIG_ARGS in recipes/pgrc/build.sh

grep "CONFIG_ARGS\s*=" recipes/pgrc/build.sh

Length of output: 149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aarch64 Related to adding linux-aarch64 support please review & merge set to ask for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants