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

perl-convert-binary-c: add aarch64/arm64 build #51107

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

martin-g
Copy link
Contributor

@martin-g martin-g commented Oct 2, 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 build process for the perl-convert-binary-c package, allowing for parallel execution.
    • Introduced support for additional platforms: linux-aarch64 and osx-arm64.
  • Bug Fixes
    • Corrected indentation in the meta.yaml file for better readability.
  • Version Update
    • Updated the build version from 0 to 1.

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@martin-g martin-g added aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Oct 2, 2024
Copy link

coderabbitai bot commented Oct 2, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to two files: build.sh and meta.yaml within the perl-convert-binary-c recipe. The build.sh script is updated to include debugging features and enable parallel execution during the build process. The meta.yaml file reflects a version increment and introduces additional platform specifications, specifically for linux-aarch64 and osx-arm64, while correcting indentation for the sha256 line.

Changes

File Change Summary
recipes/perl-convert-binary-c/build.sh Added set -xe for debugging; updated make command to use -j ${CPU_COUNT} for parallel execution.
recipes/perl-convert-binary-c/meta.yaml Updated build number from 0 to 1; added extra.additional-platforms for linux-aarch64 and osx-arm64; corrected indentation of sha256.

Possibly related PRs

Suggested reviewers

  • bgruening: Suggested reviewer for the changes made in this pull request.

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.

@martin-g
Copy link
Contributor Author

martin-g commented Oct 2, 2024

@BiocondaBot please fetch artifacts

@BiocondaBot
Copy link
Collaborator

Package(s) built are ready for inspection:

Arch Package Zip File / Repodata CI Instructions
linux-64 perl-convert-binary-c-0.85-pl5321h4ac6f70_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>
osx-64 perl-convert-binary-c-0.85-pl5321hac4f329_1.tar.bz2 OSXArtifacts.zip Azure
showYou may also use conda to install after downloading and extracting the zip file. From the OSXArtifacts directory: conda install -c ./packages <package name>
osx-arm64 perl-convert-binary-c-0.85-pl5321h6aa7127_1.tar.bz2 repodata.json CircleCI
showYou may also use conda to install:conda install -c https://output.circle-artifacts.com/output/job/85d50014-2f15-4f45-981a-a2f292267c41/artifacts/0/tmp/artifacts/packages <package name>
linux-aarch64 perl-convert-binary-c-0.85-pl5321h78569d1_1.tar.bz2 repodata.json CircleCI
showYou may also use conda to install:conda install -c https://output.circle-artifacts.com/output/job/e34b78a5-6fd9-4ab6-8284-c2bcfc1d5b38/artifacts/0/tmp/artifacts/packages <package name>

Docker image(s) built:

Package Tag CI Install with docker
perl-convert-binary-c 0.85--pl5321h4ac6f70_1 Azure
showImages for Azure are in the LinuxArtifacts zip file above.gzip -dc LinuxArtifacts/images/perl-convert-binary-c:0.85--pl5321h4ac6f70_1.tar.gz | docker load

@martin-g
Copy link
Contributor Author

martin-g commented Oct 2, 2024

mgrigorov in 🌐 euler-arm-22 in /tmp/p-c-b via 🅒 test123 took 2s 
❯ tar xvf perl-convert-binary-c-0.85-pl5321h78569d1_1.tar.bz2                                                                                                                                              (test123) 
info/run_exports.json
info/hash_input.json
info/files
info/index.json
info/recipe/build.sh
info/recipe/meta.yaml.template
info/test/run_test.pl
info/has_prefix
info/recipe/meta.yaml
info/paths.json
info/recipe/conda_build_config.yaml
info/about.json
info/git
lib/perl5/5.32/site_perl/auto/Convert/Binary/C/.packlist
man/man3/Convert::Binary::C::Cached.3
man/man3/Convert::Binary::C.3
bin/ccconfig
man/man1/ccconfig.1
lib/perl5/5.32/site_perl/Convert/Binary/C/Cached.pm
lib/perl5/5.32/site_perl/Convert/Binary/C.pm
lib/perl5/5.32/site_perl/auto/Convert/Binary/C/C.so

mgrigorov in 🌐 euler-arm-22 in /tmp/p-c-b via 🅒 test123 
❯ file bin/*                                                                                                                                                                                               (test123) 
bin/ccconfig: Perl script text executable

mgrigorov in 🌐 euler-arm-22 in /tmp/p-c-b via 🅒 test123 
❯ file lib/perl5/5.32/site_perl/auto/Convert/Binary/C/C.so                                                                                                                                                 (test123) 
lib/perl5/5.32/site_perl/auto/Convert/Binary/C/C.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, with debug_info, not stripped

LGTM!

@martin-g
Copy link
Contributor Author

martin-g commented Oct 2, 2024

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Oct 2, 2024
Copy link

@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/perl-convert-binary-c/build.sh (1)

15-15: Great optimization with parallel make!

The addition of -j ${CPU_COUNT} to the make command enables parallel execution, which can significantly speed up the build process, especially on multi-core systems. This is an excellent optimization.

For added robustness, consider adding a fallback in case ${CPU_COUNT} is not set:

-    make -j ${CPU_COUNT}
+    make -j ${CPU_COUNT:-1}

This ensures the build will proceed even if ${CPU_COUNT} is not defined, defaulting to single-threaded execution in such cases.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5ca5963 and bdf188c.

📒 Files selected for processing (2)
  • recipes/perl-convert-binary-c/build.sh (2 hunks)
  • recipes/perl-convert-binary-c/meta.yaml (2 hunks)
🔇 Additional comments (6)
recipes/perl-convert-binary-c/build.sh (2)

3-3: Excellent addition of set -xe!

This change enhances the script's robustness and debuggability:

  • -x enables debugging by printing each command before execution.
  • -e ensures the script exits immediately if any command fails, preventing cascading errors.

These options are particularly beneficial in a build context, making it easier to identify and diagnose issues.


Line range hint 1-22: Overall, the build script is well-structured and follows best practices.

The script appropriately handles both Build.PL and Makefile.PL scenarios, which is common for Perl module builds. The unchanged parts of the script, including the conditional logic and the final chmod command, are correct and necessary.

The chmod command at the end is particularly important as it ensures the ccconfig binary is executable after installation.

To ensure the build script is compatible with the package structure, let's verify the presence of either Build.PL or Makefile.PL:

✅ Verification successful

Build Script Verification Successful

The presence of Build.PL or Makefile.PL was confirmed as expected, ensuring that the build script can function correctly in either scenario.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the presence of Build.PL or Makefile.PL
if fd -t f -e PL '^(Build|Makefile)\.PL$' recipes/perl-convert-binary-c; then
    echo "Build.PL or Makefile.PL found as expected."
else
    echo "Warning: Neither Build.PL nor Makefile.PL found in the package directory."
fi

Length of output: 165

recipes/perl-convert-binary-c/meta.yaml (4)

14-14: 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, especially when adding support for new platforms.


Line range hint 1-40: Summary: Changes look good, verification recommended.

The modifications to add aarch64/arm64 build support are appropriate and well-implemented. The build number has been correctly incremented, and the additional platforms have been specified in the 'extra' section. The existing configuration, including the 'run_exports' section, aligns well with the PR objectives and Bioconda guidelines.

To ensure a smooth integration of these changes, please:

  1. Verify that the build system recognizes the new platforms as suggested.
  2. Confirm the availability of all dependencies for the ARM64 architectures.
  3. If possible, perform test builds on the new architectures to catch any unforeseen issues.

Once these verifications are complete, this PR should be ready for merging.


Line range hint 1-35: Verify dependencies for new architectures.

The existing configuration looks good, particularly:

  • The 'run_exports' section is correctly implemented, which helps maintain ABI compatibility as mentioned in the PR description.
  • The package version remains at 0.85, which is appropriate when adding new platform support without changing the underlying code.

However, it's important to ensure that all dependencies, especially those in the 'build' and 'host' sections, are available and function correctly on the new ARM64 architectures (linux-aarch64 and osx-arm64).

To verify the availability of dependencies, you can run:

#!/bin/bash
# Description: Check availability of dependencies for new architectures

# Test: Verify availability of build and host dependencies for ARM64 platforms
for dep in make perl; do
  echo "Checking $dep for linux-aarch64:"
  conda search --platform linux-aarch64 $dep
  echo "Checking $dep for osx-arm64:"
  conda search --platform osx-arm64 $dep
done

# Note: Replace 'gcc' with the appropriate compiler package for ARM64 if different
echo "Checking C++ compiler for linux-aarch64:"
conda search --platform linux-aarch64 gcc
echo "Checking C++ compiler for osx-arm64:"
conda search --platform osx-arm64 clangxx

This script will help ensure that all necessary dependencies are available for the new architectures. If any dependencies are missing, they may need to be built or sourced for these platforms before this package can be successfully built.


37-40: LGTM: Additional platforms correctly specified.

The addition of 'linux-aarch64' and 'osx-arm64' to the 'additional-platforms' list is correct and aligns with the PR objective of adding aarch64/arm64 build support. This change will enable the package to be built for these ARM64 architectures on both Linux and macOS.

To ensure the build process recognizes these new platforms, you can run the following command:

This command should output build paths for all supported platforms, including the newly added ARM64 architectures.

✅ Verification successful

LGTM: Additional platforms correctly specified.

The addition of 'linux-aarch64' and 'osx-arm64' to the 'additional-platforms' list is correct and aligns with the PR objective of adding aarch64/arm64 build support. This change will enable the package to be built for these ARM64 architectures on both Linux and macOS.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the additional platforms are recognized in the build process

# Test: Check if the additional platforms are listed in the build matrix
conda build --variant-config-files .ci_support/linux_64_.yaml .ci_support/osx_64_.yaml .ci_support/osx_arm64_.yaml .ci_support/linux_aarch64_.yaml recipes/perl-convert-binary-c --output

Length of output: 1203


Script:

#!/bin/bash
# Description: Check if conda is installed and available in the PATH

which conda

# If conda is available, attempt to verify the build matrix again
if [ $? -eq 0 ]; then
  echo "Conda is installed. Retrying build verification..."
  conda build --variant-config-files .ci_support/linux_64_.yaml .ci_support/osx_64_.yaml .ci_support/osx_arm64_.yaml .ci_support/linux_aarch64_.yaml recipes/perl-convert-binary-c --output
else
  echo "Conda is not installed. Skipping build verification."
fi

Length of output: 221


Script:

#!/bin/bash
# Description: Verify that 'linux-aarch64' and 'osx-arm64' are listed under 'additional-platforms' in meta.yaml

# Define the file to check
FILE="recipes/perl-convert-binary-c/meta.yaml"

# Check if the file exists
if [ ! -f "$FILE" ]; then
  echo "File $FILE does not exist."
  exit 1
fi

# Check for 'additional-platforms' section
grep -A 2 "additional-platforms:" "$FILE" | grep -q "linux-aarch64" && grep -A 2 "additional-platforms:" "$FILE" | grep -q "osx-arm64"

if [ $? -eq 0 ]; then
  echo "Both 'linux-aarch64' and 'osx-arm64' are correctly listed under 'additional-platforms'."
  exit 0
else
  echo "One or both of the platforms ('linux-aarch64', 'osx-arm64') are missing from 'additional-platforms'."
  exit 1
fi

Length of output: 525

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 osx-arm64 Related to adding osx-arm64 support please review & merge set to ask for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants