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

Build dialign2 on OSX #51262

Closed
wants to merge 1 commit into from
Closed

Build dialign2 on OSX #51262

wants to merge 1 commit into from

Conversation

mencian
Copy link
Contributor

@mencian mencian commented Oct 8, 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>.

Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

📝 Walkthrough

Walkthrough

The pull request includes modifications to the build.sh script for the dialign2 package, which now exports new environment variables INCLUDE_PATH and LIBRARY_PATH, pointing to directories within the ${PREFIX} path. The CFLAGS variable is updated to include optimization flags and a conditional adjustment for macOS to suppress specific warnings. The script also updates a sed command to modify the path in the strcpy function within dialign.c, replacing a hardcoded string with a dynamic path derived from ${PREFIX}. Additionally, the make command is adjusted to utilize the updated CFLAGS.

The meta.yaml file is updated with a new HTTPS source URL, an incremented build number, and a new doc_url field. Minor formatting changes are made to the test commands and summary text. Lastly, the patchdialign.txt file comments out code that checks for the DIALIGN2_DIR environment variable, effectively disabling its validation and associated error handling.

Possibly related PRs

  • recipe for pgrc #50973: The build.sh script in this PR also involves exporting environment variables and configuring the build process, similar to the changes made in the main PR's build.sh.
  • gxf2bed: add aarch64/arm64 builds #51120: This PR adds support for osx-arm64, which aligns with the conditional modifications for macOS in the main PR's build.sh.
  • longreadsum: add aarch64/arm64 builds #51121: The addition of linux-aarch64 and osx-arm64 builds in this PR relates to the overall enhancements in architecture support seen in the main PR's changes.
  • r-cobrar: add aarch64/arm64 builds #51203: Similar to the main PR, this PR introduces additional platform support, specifically for linux-aarch64 and osx-arm64, which is relevant to the changes made in the main PR.

Suggested labels

please review & merge, osx-arm64

Suggested reviewers

  • martin-g

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

🧹 Outside diff range and nitpick comments (3)
recipes/dialign2/build.sh (2)

8-10: LGTM with a minor suggestion.

The addition of INCLUDE_PATH and LIBRARY_PATH exports is good practice. The optimization flag in CFLAGS is also appropriate for release builds. However, including the library path in CFLAGS is redundant since LIBRARY_PATH is already set.

Consider removing the redundant library path from CFLAGS:

-export CFLAGS="${CFLAGS} -O3 -L${PREFIX}/lib"
+export CFLAGS="${CFLAGS} -O3"

12-16: Good addition for macOS compatibility, with a minor improvement.

The macOS-specific flags to suppress implicit function declaration warnings are a good addition for cross-platform compatibility. However, the else case is unnecessary as it doesn't modify CFLAGS.

Consider simplifying the conditional block by removing the unnecessary else case:

 if [[ `uname` == "Darwin" ]]; then
 	export CFLAGS="${CFLAGS} -Wno-implicit-int -Wno-implicit-function-declaration"
-else
-	export CFLAGS="${CFLAGS}"
 fi
recipes/dialign2/meta.yaml (1)

13-13: Remove trailing space

There is a trailing space at the end of line 13. While this doesn't affect functionality, it's good practice to remove trailing spaces for consistency and to avoid potential issues in some systems.

Please remove the trailing space at the end of this line:

-  patches:
+  patches:
🧰 Tools
🪛 yamllint

[error] 13-13: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1f7e295 and 85f5fb8.

📒 Files selected for processing (3)
  • recipes/dialign2/build.sh (1 hunks)
  • recipes/dialign2/meta.yaml (2 hunks)
  • recipes/dialign2/patches/patchdialign.txt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • recipes/dialign2/patches/patchdialign.txt
🧰 Additional context used
🪛 Shellcheck
recipes/dialign2/build.sh

[warning] 20-20: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)

🪛 yamllint
recipes/dialign2/meta.yaml

[error] 13-13: trailing spaces

(trailing-spaces)

🔇 Additional comments (9)
recipes/dialign2/build.sh (3)

23-23: Excellent improvements to the make command.

The changes to the make command are all positive:

  1. Using ${CC} allows for flexibility in choosing the compiler.
  2. Including ${CFLAGS} ensures that the previously set flags are used during compilation.
  3. The -j"${CPU_COUNT}" flag enables parallel build, which can significantly speed up the build process on multi-core systems.

These modifications enhance the build process's flexibility and efficiency.


24-24: LGTM: Proper file permissions and location.

The chmod command correctly sets the executable permission for the dialign2-2 binary, which is crucial for its proper functioning. Moving the binary to ${PREFIX}/bin ensures it's in the correct location for conda to manage it. These are both good practices in package management.


Line range hint 1-24: Summary: Successful implementation of OSX support with room for minor improvements.

The changes in this build script successfully address the PR objective of building dialign2 on OSX (macOS). The modifications enhance cross-platform compatibility, improve build flexibility, and increase build efficiency. Key improvements include:

  1. Addition of necessary environment variables.
  2. OS-specific compiler flags for macOS.
  3. More flexible installation paths.
  4. Improved make command with parallel build support.

While the changes are generally good, there are a few minor suggestions for improvement:

  1. Remove the redundant library path from CFLAGS.
  2. Simplify the conditional block for OS-specific flags.
  3. Fix the quoting issue in the sed command.

These minor adjustments will further refine the build process. Overall, this PR successfully achieves its goal of adding OSX support for dialign2.

🧰 Tools
🪛 Shellcheck

[warning] 20-20: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)

recipes/dialign2/meta.yaml (6)

9-9: LGTM: Updated to HTTPS URL

Updating the source URL to use HTTPS is a good security practice. This change ensures that the package is downloaded over an encrypted connection.


15-17: LGTM: Build number increment and run_exports addition

  1. The build number increment is correct, as it reflects the changes made to the package.
  2. The addition of the run_exports section with {{ pin_subpackage('dialign2', max_pin="x") }} is a good practice. This ensures that when dialign2 is used as a dependency in other packages, the correct version constraints are automatically applied. The max_pin="x" allows for minor version updates but prevents major version changes, which helps maintain compatibility.

These changes improve the package's versioning and dependency management.


26-26: LGTM: Improved formatting in test command

The addition of a space before the grep command in the test section improves readability and consistency in the YAML file. This is a minor but positive change that doesn't affect functionality.


29-33: LGTM: Improved metadata in the about section

The changes in the about section enhance the package metadata:

  1. Updating the home URL to HTTPS improves security.
  2. Adding quotation marks around string values improves YAML consistency.
  3. Adding a period at the end of the summary improves readability.
  4. The new doc_url field provides users with a direct link to the package documentation, which is very helpful.

These changes improve the overall quality and user-friendliness of the package metadata.


37-38: LGTM: Updated and added identifiers

The changes in the identifiers section improve the package's metadata:

  1. Changing the DOI format to lowercase (doi:10.1093/nar/gkt283) aligns with the more commonly used and preferred format for DOIs.
  2. Adding the biotools:dialign identifier provides an additional reference to the Bio.tools registry, which is valuable for bioinformatics tools.

These updates enhance the discoverability and cross-referencing of the package across different platforms and registries.


Line range hint 1-38: Overall LGTM: Improved package metadata and configuration

The changes made to this meta.yaml file significantly improve the dialign2 package:

  1. Enhanced security by updating URLs to HTTPS.
  2. Improved version management with the build number increment and run_exports addition.
  3. Better metadata with updated and additional identifiers.
  4. Increased consistency in YAML formatting.
  5. Added documentation URL for improved user reference.

These updates align well with Conda packaging best practices and enhance the overall quality of the package. Great job on these improvements!

else
export CFLAGS="${CFLAGS}"
fi

cd src

sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \""${PREFIX}"/share/dialign2\" );|g" dialign.c
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

Good improvement for installation flexibility, but watch out for quoting.

The use of ${PREFIX} in the sed command allows for a more flexible installation path, which is good practice and aligns with conda build conventions.

However, the static analysis tool flagged a potential issue with quoting. The surrounding quotes are actually unquoting the inner quotes, which may lead to unexpected behavior. To fix this, you can escape the inner quotes:

-sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \""${PREFIX}"/share/dialign2\" );|g" dialign.c
+sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \"${PREFIX}/share/dialign2\" );|g" dialign.c
📝 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
sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \""${PREFIX}"/share/dialign2\" );|g" dialign.c
sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \"${PREFIX}/share/dialign2\" );|g" dialign.c
🧰 Tools
🪛 Shellcheck

[warning] 20-20: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)

@mencian mencian closed this Oct 8, 2024
@mencian mencian deleted the dialign2 branch October 8, 2024 21:37
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