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

Update Earl Grey build.sh #51324

Merged
merged 4 commits into from
Oct 11, 2024
Merged

Update Earl Grey build.sh #51324

merged 4 commits into from
Oct 11, 2024

Conversation

TobyBaril
Copy link
Contributor

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 11, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request includes changes to the build.sh script and the meta.yaml file for the EarlGrey package. In build.sh, specific checks related to the conda environment name for earlGrey, earlGreyLibConstruct, and earlGreyAnnotationOnly executables have been removed. The script has been updated to use a more universal sed command format for compatibility with both Linux and macOS. Additionally, the -pa parameter has been removed from the RepeatClassifier command, and the -t parameter has been removed from the sa-ssr command to resolve multithreading issues on macOS. The SCRIPT_DIR variable is now consistently defined across scripts, and permissions for various files and directories have been explicitly set. A new extraction step for tRNAdb has been added, and activation and deactivation scripts for conda have been created to manage the PERL5LIB environment variable.

In the meta.yaml file, the build number has been incremented from 0 to 1, and the indentation of the sha256 line has been corrected. No other changes to the package's logic or functionality were made.

Possibly related PRs

  • recipe for pgrc #50973: The build.sh script for the PgRC project introduces a new shell script to automate the build process, which may relate to the changes in the build.sh script in the main PR that also focuses on enhancing build processes.
  • pgrc: add linux-aarch64 build #51009: This PR updates the pgrc package to add support for the linux-aarch64 architecture, which aligns with the main PR's focus on improving compatibility and functionality across platforms.
  • updated revision and enabled osx build #51176: The update to the pgrc package in this PR includes enabling macOS builds, which is relevant to the main PR's changes aimed at enhancing cross-platform functionality.
  • Update Earl Grey meta.yaml #51238: The update to the meta.yaml file for the EarlGrey package includes changes to dependencies and build configurations, which may relate to the modifications made in the main PR regarding the meta.yaml file.

Suggested reviewers

  • aliciaaevans

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/earlgrey/build.sh (1)

Line range hint 54-58: Permissions set correctly, but consider restricting write access

The addition of explicit permission settings is a good practice to ensure that all necessary files are executable. However, the chmod a+w ${SCRIPT_DIR}/repeatCraft/example command grants write permissions to all users, which might be overly permissive.

Consider using a more restrictive permission setting for the repeatCraft/example directory, such as:

chmod u+w ${SCRIPT_DIR}/repeatCraft/example

This would grant write permissions only to the owner of the directory, which is typically sufficient and more secure.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8c12e52 and 6deb803.

📒 Files selected for processing (2)
  • recipes/earlgrey/build.sh (1 hunks)
  • recipes/earlgrey/meta.yaml (1 hunks)
🧰 Additional context used
🔇 Additional comments (7)
recipes/earlgrey/meta.yaml (2)

14-14: Build number increment looks good.

The build number has been correctly incremented from 0 to 1. This is the appropriate action when making changes to a package without altering its version number.


Line range hint 1-85: No other changes detected. Verify package integrity.

Apart from the build number increment, no other changes are visible in this file. This is consistent with the PR objectives and AI summary. However, it's always good to verify that the package still builds and functions correctly after any change.

To ensure the package integrity, you can run the following commands:

These commands will help ensure that the package can still be built and installed correctly after the build number change.

recipes/earlgrey/build.sh (5)

50-50: LGTM: Correct path set for STRAIN_SCRIPTS

This change correctly sets the STRAIN_SCRIPTS variable to the appropriate path within the package directory structure. It's consistent with other path updates in the script and should ensure that the TEstrainer script can locate its dependencies correctly.


Line range hint 61-61: LGTM: Proper extraction of tRNAdb

The addition of this line correctly extracts the tRNAdb tarball required for LTR_FINDER functionality. The command is well-structured, extracting to the correct directory and cleaning up the tarball afterward, which is a good practice for managing disk space.


Line range hint 64-64: Clarify the purpose of the disk space check

The addition of df -h seems out of place in this context. It's not clear why a disk space check is necessary at this point in the build process, and the output isn't being used or logged.

Could you please clarify the purpose of this disk space check? If it's not essential, consider removing it. If it is needed, consider adding a comment explaining its purpose or implementing a more comprehensive check that acts on the information. For example:

# Check if there's sufficient disk space for the build process
if [ $(df -P . | awk 'NR==2 {print $4}') -lt 1000000 ]; then
    echo "Error: Insufficient disk space. At least 1GB free space is required."
    exit 1
fi

This would check if there's at least 1GB of free space and exit with an error if not.


Line range hint 67-76: LGTM: Proper management of PERL5LIB environment variable

The addition of activation and deactivation scripts for conda is an excellent practice. These scripts correctly manage the PERL5LIB environment variable, ensuring that the necessary paths for RepeatMasker and RepeatModeler are available when the environment is activated and cleaned up when deactivated.

This approach helps maintain a clean environment and prevents potential conflicts with other Perl installations or packages.


Line range hint 1-81: Overall, the changes improve the build process with one point for clarification

The modifications to this build script generally enhance its functionality and cross-platform compatibility. Key improvements include:

  1. Consistent setting of the SCRIPT_DIR variable.
  2. Explicit permission settings for executables and directories.
  3. Proper extraction of the tRNAdb for LTR_FINDER.
  4. Implementation of conda activation/deactivation scripts for managing the PERL5LIB environment variable.

These changes should result in a more robust and reliable build process. However, the addition of the disk space check (df -h) requires clarification or potential removal if it's not serving a specific purpose.

Please address the comment regarding the disk space check to complete this review.

@TobyBaril
Copy link
Contributor Author

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Oct 11, 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: 0

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

48-52: LGTM: Consistent script directory path updates

These changes ensure that the SCRIPT_DIR variable is consistently set across all relevant scripts, including the newly added earlGreyAnnotationOnly. This improves the overall consistency and maintainability of the package.

Consider using a loop to apply these changes to reduce code duplication:

for script in ${PACKAGE_HOME}/earlGrey ${PACKAGE_HOME}/earlGreyLibConstruct ${PACKAGE_HOME}/earlGreyAnnotationOnly ${SCRIPT_DIR}/rcMergeRepeat* ${SCRIPT_DIR}/headSwap.sh ${SCRIPT_DIR}/autoPie.sh; do
    sed -i.bak "s|SCRIPT_DIR=.*|SCRIPT_DIR=${SCRIPT_DIR}|g" "$script"
done

This approach would make future additions or removals easier to manage.


Line range hint 58-62: LGTM: Consistent permission settings

The addition of permission settings for earlGreyAnnotationOnly and other scripts ensures that all necessary files are executable. This is crucial for the correct functioning of the package.

Consider using a more concise approach to set permissions:

chmod +x ${PACKAGE_HOME}/earlGrey*
chmod +x ${SCRIPT_DIR}/TEstrainer/TEstrainer_for_earlGrey.sh ${SCRIPT_DIR}/* ${SCRIPT_DIR}/bin/LTR_FINDER.x86_64-1.0.7/ltr_finder
chmod a+w ${SCRIPT_DIR}/repeatCraft/example

This approach reduces redundancy and makes it easier to maintain if new scripts are added in the future.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d601431 and e3ac0b6.

📒 Files selected for processing (1)
  • recipes/earlgrey/build.sh (3 hunks)
🧰 Additional context used
🔇 Additional comments (5)
recipes/earlgrey/build.sh (5)

30-30: LGTM: Consistent removal of conda environment name check

This change aligns with the modifications made to other scripts, removing the check for a specific conda environment name. This improves flexibility and allows users to use custom environment names.


33-33: LGTM: Consistent sed command update for cross-platform compatibility

The inclusion of earlGreyAnnotationOnly in the sed command modification ensures consistent behavior across Linux and macOS for all relevant scripts. This change improves the overall robustness of the build process.


85-85: LGTM: Consistent symbolic link creation

The addition of a symbolic link for earlGreyAnnotationOnly in the bin directory is consistent with the treatment of other main scripts. This ensures that the script is easily accessible from the command line, improving the overall usability of the package.


Line range hint 1-85: Please clarify the impact of parameter removals and provide rationale for new additions

  1. The script removes the -pa parameter from RepeatClassifier and the -t parameter from sa-ssr. Could you please explain the reasoning behind these changes and their potential impact on the tool's functionality or performance?

  2. A new extraction step for tRNAdb has been added. Can you provide more context on why this is necessary and how it affects the package's functionality?

  3. The addition of activation and deactivation scripts for conda to manage the PERL5LIB environment variable is a good practice. However, could you confirm if this change is backwards compatible with existing installations?

To ensure these changes don't introduce unintended consequences, please run the following tests:

#!/bin/bash
# Test RepeatClassifier without -pa parameter
RepeatClassifier -h | grep "\-pa"

# Test sa-ssr without -t parameter
sa-ssr -h | grep "\-t"

# Verify tRNAdb extraction
ls ${SCRIPT_DIR}/bin/LTR_FINDER.x86_64-1.0.7/tRNAdb*

# Test PERL5LIB setting
source ${PREFIX}/etc/conda/activate.d/${PKG_NAME}_activate.sh
echo $PERL5LIB
source ${PREFIX}/etc/conda/deactivate.d/${PKG_NAME}_deactivate.sh
echo $PERL5LIB

Line range hint 1-85: Security considerations for file permissions and tarball extraction

While the script appears to handle permissions and symbolic links appropriately, please consider the following security-related suggestions:

  1. Ensure that the permissions set on files and directories are as restrictive as possible while still allowing the package to function correctly.

  2. For the tarball extraction, consider adding safeguards against potential security risks:

    tar --strip-components=1 -C ${SCRIPT_DIR}/bin/LTR_FINDER.x86_64-1.0.7 -zxf ${SCRIPT_DIR}/bin/LTR_FINDER.x86_64-1.0.7/tRNAdb.tar.gz

    This approach limits the extraction to a specific directory and removes the top-level directory from the archive, reducing the risk of unintended file placement.

  3. Verify the integrity of the tRNAdb.tar.gz file before extraction, if possible, by checking its checksum against a known good value.

To ensure proper file permissions, please run the following command after the build process:

Review the output to confirm that no files or directories have overly permissive settings (e.g., world-writable).

Copy link
Contributor

@mencian mencian left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @TobyBaril!

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

Successfully merging this pull request may close these issues.

3 participants