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

Add FMSI #51277

Merged
merged 14 commits into from
Oct 16, 2024
Merged

Add FMSI #51277

merged 14 commits into from
Oct 16, 2024

Conversation

OndrejSladky
Copy link
Contributor

This add a recipe for FMSI for indexing k-mer sets with masked superstrings.


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

📝 Walkthrough
📝 Walkthrough

Walkthrough

This pull request introduces several updates to the recipes/fmsi directory. The build.sh script has been modified to include a shebang line for bash, create the installation directory ${PREFIX}/bin, and export the LDFLAGS variable with the library path -L${PREFIX}/lib. It compiles the project using the make command with updated variables for compiler settings and parallel build options. After compilation, it sets permissions for the fmsi executable and moves it to the installation directory.

The meta.yaml file has been updated to version "0.2.4", includes a new SHA256 checksum, and updates the source URL to the latest version's tarball. It introduces sdsl-lite as a new dependency for both host and run environments, alongside existing dependencies. The test command remains unchanged, and additional identifiers and information about the project have been added to the about section.

Changes to the Makefile include using the environment variable ${CXX} for compiler selection, updating optimization flags, and modifying paths to enhance configurability. The src/version file now uses a variable placeholder ${PKG_VERSION} for the version number.

Suggested labels

please review & merge, aarch64, osx-arm64

Possibly related PRs

  • [recipe for pgrc #50973] Recipe for pgrc: The build.sh script in this PR also sets up environment variables and uses the make command, similar to the changes made in the main PR's build.sh.
  • [bambamc: add aarch64/arm64 builds #51067] Bambamc: The build.sh script in this PR includes parallel execution with make, which aligns with the updates made in the main PR's build.sh.
  • [Rebuild breseq #51221] Rebuild breseq: The modifications to the build.sh script in this PR involve setting environment variables and enhancing the build process, which is a common theme with the changes in the main PR.
  • [kmc: add arm64 build #51281] KMC: The build.sh script changes in this PR also focus on improving the build process, similar to the enhancements made in the main PR's build.sh.
  • [add gfainject #51287] Add gfainject: The new build.sh script in this PR automates the build process, akin to the updates in the main PR's build.sh.
  • [Adding the devider recipe  #51365] Adding the devider recipe: The new build.sh script in this PR also automates the build process, which is a focus of the main PR's changes.

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

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

1-5: Overall, the build script is well-structured but could benefit from enhanced error handling.

The script successfully accomplishes its main goals of building and installing the FMSI package. It follows Conda conventions and uses appropriate commands. However, implementing the suggested improvements for quoting, error handling, and existence checking will make the script more robust and reliable, especially in different environments or when debugging build issues.

Consider adding logging or echo statements at key points in the script (e.g., before and after the make command, and during installation) to provide more visibility into the build process. This can be helpful for troubleshooting in CI/CD pipelines or when users encounter issues.

recipes/fmsi/meta.yaml (6)

4-10: LGTM: Package and source information are correctly defined.

The package name, version, source URL, and SHA256 checksum are all properly set. The use of Jinja2 variables for version and checksum in the URL and sha256 fields is a good practice.

Consider adding a license_family field in the about section to make it easier for users to filter packages based on license compatibility.


12-15: LGTM: Build section is correctly configured.

The build number is properly set to 0 for a new package. The use of run_exports with pin_subpackage is a good practice for managing package dependencies.

Consider adding a skip condition if the package is not intended to be built on certain platforms. For example:

build:
  number: 0
  skip: True  # [win]
  run_exports:
    - {{ pin_subpackage('fmsi', max_pin="x.x") }}

This would skip building on Windows if the package is not compatible.


18-27: LGTM: Requirements are well-defined.

The build, host, and run requirements are appropriately specified. The use of {{ compiler('cxx') }} and {{ compiler('c') }} is the correct way to specify C++ and C compilers in conda-forge recipes.

Consider pinning the zlib version in the run requirements to ensure compatibility:

run:
  - zlib
  - {{ pin_compatible('zlib') }}

This helps maintain consistency across different environments.


29-31: LGTM: Test command is provided.

The test command checks for the presence and basic functionality of the 'fmsi' command, which is good.

Consider adding more comprehensive tests if possible. For example:

test:
  commands:
    - fmsi -h 2>&1 | grep "FMSI"
    - fmsi --version
    - test -f $PREFIX/bin/fmsi  # [unix]
    - if not exist %LIBRARY_BIN%\\fmsi.exe exit 1  # [win]

This would also check the version output and verify the presence of the executable file.


33-37: LGTM: About section provides essential metadata.

The about section includes the necessary information such as the home URL, license type, license file, and a summary of the package's functionality.

Consider adding the following fields to provide more information to users:

  1. Add a license_family field:
    license_family: MIT
  2. Include a doc_url if documentation is available:
    doc_url: https://github.com/OndrejSladky/fmsi/blob/master/README.md
  3. Add a dev_url pointing to the repository for development:
    dev_url: https://github.com/OndrejSladky/fmsi

These additions would provide users with more resources and make the package more discoverable.


38-38: Minor: Remove extra blank lines at the end of the file.

There are extra blank lines at the end of the file. Consider removing them to adhere to YAML style guidelines.

🧰 Tools
🪛 yamllint

[warning] 38-38: too many blank lines

(1 > 0) (empty-lines)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6011005 and d257279.

📒 Files selected for processing (2)
  • recipes/fmsi/build.sh (1 hunks)
  • recipes/fmsi/meta.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
recipes/fmsi/meta.yaml

[warning] 38-38: too many blank lines

(1 > 0) (empty-lines)


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

(syntax)

🔇 Additional comments (2)
recipes/fmsi/build.sh (1)

1-1: LGTM: Correct shebang for a bash script.

The shebang #!/bin/bash is appropriate for a bash script and ensures portability across different Unix-like systems.

recipes/fmsi/meta.yaml (1)

1-2: LGTM: Version and checksum are correctly defined.

The use of Jinja2 variables for version and checksum is a good practice for maintainability.

🧰 Tools
🪛 yamllint

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

(syntax)

Comment on lines 4 to 5
install -d "${PREFIX}/bin"
install fmsi "${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.

🛠️ Refactor suggestion

Enhance installation process with existence check.

The installation commands are generally good, using the install command and following Conda conventions with ${PREFIX}. However, consider adding a check for the existence of the fmsi executable before attempting to install it.

Here's an improved version of the installation commands:

 install -d "${PREFIX}/bin"
-install fmsi "${PREFIX}/bin/"
+if [ -f fmsi ]; then
+    install fmsi "${PREFIX}/bin/"
+else
+    echo "Error: fmsi executable not found" >&2
+    exit 1
+fi

This change ensures that the fmsi executable exists before attempting to install it, providing better error handling and feedback if the build process fails to produce the executable.

📝 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
install -d "${PREFIX}/bin"
install fmsi "${PREFIX}/bin/"
install -d "${PREFIX}/bin"
if [ -f fmsi ]; then
install fmsi "${PREFIX}/bin/"
else
echo "Error: fmsi executable not found" >&2
exit 1
fi

@@ -0,0 +1,5 @@
#!/bin/bash

make CXX="${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}"
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

Enhance the make command for robustness.

While the current make command is functional, consider the following improvements:

  1. Quote the entire value of CXX to handle potential spaces in paths.
  2. Add error handling to ensure the build process succeeds before proceeding.

Here's an improved version of the make command:

-make CXX="${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}"
+make CXX="${CXX}" CXXFLAGS="${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}" || exit 1

This change separates CXX from the flags and adds error handling. If the make command fails, the script will exit with a non-zero status.

📝 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
make CXX="${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}"
make CXX="${CXX}" CXXFLAGS="${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}" || exit 1

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 (3)
recipes/fmsi/meta.yaml (3)

12-17: LGTM: Build section is correctly configured. Consider removing extra blank line.

The build number and run exports are properly set. The pinning strategy for run exports is correct.

Consider removing the extra blank line at line 17 to maintain consistent formatting:

  run_exports:
    - {{ pin_subpackage('fmsi', max_pin="x.x") }}

-
requirements:

29-31: LGTM: Basic test is provided. Consider adding more comprehensive tests.

The current test checks for the presence and basic functionality of the 'fmsi' command. This is a good start, but consider adding more comprehensive tests if possible.

If feasible, consider adding tests that:

  1. Check for specific expected output or behavior.
  2. Verify the functionality with sample input data.
  3. Test different command-line options.

These additional tests would provide more confidence in the package's functionality.


38-38: Minor: Remove extra blank line at the end of the file.

To adhere to YAML best practices, remove the extra blank line at the end of the file.

  summary: FMSI - memory efficient k-mer set index based on masked superstrings and Burrows-Wheeler transform

-
🧰 Tools
🪛 yamllint

[warning] 38-38: too many blank lines

(1 > 0) (empty-lines)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d257279 and 17125ee.

📒 Files selected for processing (1)
  • recipes/fmsi/meta.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
recipes/fmsi/meta.yaml

[warning] 38-38: too many blank lines

(1 > 0) (empty-lines)


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

(syntax)

🔇 Additional comments (6)
recipes/fmsi/meta.yaml (6)

1-2: LGTM: Version and checksum are correctly defined.

The use of Jinja2 variables for version and SHA256 checksum is a good practice for maintainability.

🧰 Tools
🪛 yamllint

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

(syntax)


4-6: LGTM: Package metadata is correctly defined.

The package name is set to "fmsi", and the version uses the Jinja2 variable, ensuring consistency with the earlier definition.


8-10: LGTM: Source information is correctly defined.

The source URL is properly formatted with the version variable, and the SHA256 checksum is correctly referenced using the Jinja2 variable.


18-27: LGTM: Requirements are correctly specified.

The build, host, and run requirements are appropriately defined for a C++ project. The use of Jinja2 variables for compilers and the inclusion of zlib in both host and run requirements are correct practices.


33-37: LGTM: About section is comprehensive and accurate.

The about section provides all necessary metadata, including the home URL, license information (MIT, as mentioned in the PR objectives), and a concise summary of the tool's functionality.


1-38: Overall: The meta.yaml file is well-structured and follows Conda packaging best practices.

The file includes all necessary sections for a Conda package and is correctly configured. The use of Jinja2 variables, appropriate pinning strategies, and comprehensive metadata demonstrate good packaging practices. The minor formatting suggestions provided earlier will further improve the file's consistency.

Great job on creating this package configuration!

🧰 Tools
🪛 yamllint

[warning] 38-38: too many blank lines

(1 > 0) (empty-lines)


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

(syntax)

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 (4)
recipes/fmsi/meta.yaml (4)

12-15: LGTM: Build section is correct. Consider adding skip directive.

The build number and run_exports section are correctly defined. The use of pin_subpackage with max_pin="x.x" is a good practice for ensuring compatibility.

Consider adding a skip directive to specify which platforms this package can be built on. For example:

build:
  number: 0
  skip: True  # [win]
  run_exports:
    - {{ pin_subpackage('fmsi', max_pin="x.x") }}

This would skip building on Windows if the package is not compatible with that platform.


18-30: LGTM: Requirements updated correctly. Consider pinning sdsl-lite version.

The addition of sdsl-lite to build, host, and run requirements is consistent with the PR objectives. The existing requirements are maintained correctly.

Consider pinning the version of sdsl-lite to ensure reproducibility. For example:

requirements:
  build:
    - sdsl-lite {{ sdsl_lite_version }}
  host:
    - sdsl-lite {{ sdsl_lite_version }}
  run:
    - sdsl-lite {{ sdsl_lite_version }}

Where {{ sdsl_lite_version }} is a Jinja2 variable defined at the top of the file with the specific version of sdsl-lite you want to use.


36-40: LGTM: About section is comprehensive. Consider adding more metadata.

The about section provides essential information including the home URL, license type, license file, and a brief summary of the tool's functionality.

Consider adding more metadata to improve discoverability and provide more information to users. For example:

about:
  home: https://github.com/OndrejSladky/fmsi/
  license: MIT
  license_file: LICENSE
  summary: FMSI - memory efficient k-mer set index based on masked superstrings and Burrows-Wheeler transform
  description: |
    FMSI is a tool for indexing k-mer sets with masked superstrings. It provides a memory-efficient 
    solution for handling large-scale genomic data analysis tasks.
  dev_url: https://github.com/OndrejSladky/fmsi/
  doc_url: https://github.com/OndrejSladky/fmsi/blob/master/README.md

41-41: Minor: Remove extra blank lines at the end of the file.

There are extra blank lines at the end of the file. Consider removing them to adhere to YAML style guidelines.

🧰 Tools
🪛 yamllint

[warning] 41-41: too many blank lines

(1 > 0) (empty-lines)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 17125ee and 093af80.

📒 Files selected for processing (2)
  • recipes/fmsi/build.sh (1 hunks)
  • recipes/fmsi/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/fmsi/build.sh
🧰 Additional context used
🪛 yamllint
recipes/fmsi/meta.yaml

[warning] 41-41: too many blank lines

(1 > 0) (empty-lines)


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

(syntax)

🔇 Additional comments (3)
recipes/fmsi/meta.yaml (3)

1-2: LGTM: Version and checksum updated correctly.

The version has been updated to "0.2.4" and the SHA256 checksum has been updated accordingly. This is consistent with the PR objectives and follows best practices for Conda recipes.

🧰 Tools
🪛 yamllint

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

(syntax)


4-10: LGTM: Package and source information updated correctly.

The package name, version, and source URL have been updated correctly. The use of Jinja2 variables for version and SHA256 checksum is appropriate and follows best practices.


32-34: LGTM: Test command is appropriate.

The test command checks if the fmsi command is available and outputs the expected string. This is a basic but sufficient test to ensure the package is installed correctly.

@OndrejSladky
Copy link
Contributor Author

Hello,

I have been trying to get FMSI to bioconda, but currently I struggle with how to correctly set up the recipe with SDSL-lite as a dependency.

FMSI compiled via make and in the FMSI repository I compile SDSL-lite as a dependency myself. However, this approach fails on the SDSL library compilation on Mac (see https://github.com/bioconda/bioconda-recipes/runs/31352485908). Since this normally works on my Mac, I do not know where the error can lie.

Next, I tried to get inspired by other recipes which use SDSL-lite as a dependency (namely hypo), but I was unable to get this working (see the last CI run) and unfortunately I do not know how this could be fixed.

Would it be possible to ask someone for help with getting this resolved?

I am pinging @bioconda/core as in the instructions.

Thank you very much!

Ondrej

@BiocondaBot
Copy link
Collaborator

Reposting for @OndrejSladky to enable pings (courtesy of the BiocondaBot):

Hello,

I have been trying to get FMSI to bioconda, but currently I struggle with how to correctly set up the recipe with SDSL-lite as a dependency.

FMSI compiled via make and in the FMSI repository I compile SDSL-lite as a dependency myself. However, this approach fails on the SDSL library compilation on Mac (see https://github.com/bioconda/bioconda-recipes/runs/31352485908). Since this normally works on my Mac, I do not know where the error can lie.

Next, I tried to get inspired by other recipes which use SDSL-lite as a dependency (namely hypo), but I was unable to get this working (see the last CI run) and unfortunately I do not know how this could be fixed.

Would it be possible to ask someone for help with getting this resolved?

I am pinging @bioconda/core as in the instructions.

Thank you very much!

Ondrej

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/fmsi/meta.yaml (2)

17-26: LGTM: Requirements updated with sdsl-lite

The addition of sdsl-lite to both host and run requirements is correct and aligns with the PR objectives. This should address the dependency issues mentioned in the PR comments.

Consider adding a version constraint for sdsl-lite to ensure compatibility:

host:
  - sdsl-lite >=2.1.1
run:
  - sdsl-lite >=2.1.1

This helps maintain consistency across different environments and prevents potential issues with future incompatible versions.


28-30: Consider enhancing the test section

While the current test command verifies the basic functionality of the fmsi command, it might be beneficial to add more comprehensive tests.

Consider adding the following improvements:

  1. Test for the correct version number:
    - fmsi --version | grep "{{ version }}"
  2. Test a basic functionality of the tool (if possible with a small example):
    - fmsi [example_command] [example_input] | grep [expected_output]

These additional tests would provide more confidence in the correct installation and functionality of the package.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 093af80 and a639e5e.

📒 Files selected for processing (2)
  • recipes/fmsi/build.sh (1 hunks)
  • recipes/fmsi/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/fmsi/build.sh
🧰 Additional context used
🪛 yamllint
recipes/fmsi/meta.yaml

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

(syntax)

🔇 Additional comments (5)
recipes/fmsi/meta.yaml (5)

1-10: LGTM: Package metadata updated correctly

The package version has been updated to 0.2.4, and the corresponding SHA256 checksum and source URL have been updated accordingly. These changes are consistent with the PR objectives.

🧰 Tools
🪛 yamllint

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

(syntax)


12-15: LGTM: Build section is correct

The build number is set to 0, which is appropriate for a new version. The run_exports section is correctly configured to pin the subpackage version, ensuring compatibility for downstream dependencies.


32-39: LGTM: About section is comprehensive

The about section provides all necessary information including home page, license details, summary, development URL, and documentation URL. The use of templating for the documentation URL ensures it always points to the correct version.


1-2: Note on yamllint warning: False positive

The yamllint tool reported a syntax error for the '%' character at the beginning of the file. This is a false positive as the '%' is part of the Jinja2 templating syntax, which is valid and commonly used in Conda recipe files. No action is required to address this warning.

🧰 Tools
🪛 yamllint

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

(syntax)


41-44: Verify the relevance of the added DOI identifiers

The addition of DOI identifiers is valuable for academic citation and tracking. However, it's important to ensure that these DOIs are directly related to the FMSI project.

Please confirm that both DOIs (10.1101/2024.03.06.583483 and 10.1101/2023.02.01.526717) are directly related to the FMSI project. You can verify this by checking the content of these DOIs:

If both DOIs are confirmed to be directly related to FMSI, no further action is needed. If not, please remove any unrelated DOIs.

✅ Verification successful

DOI Relevance Confirmed

The added DOIs are directly related to the FMSI project based on their titles:

  • 10.1101/2024.03.06.583483: Function-Assigned Masked Superstrings as a Versatile and Compact Data Type for k-Mer Sets | bioRxiv
  • 10.1101/2023.02.01.526717: Masked superstrings as a unified framework for textual k-mer set representations | bioRxiv
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Fetch and display the titles of the DOIs
echo "DOI: 10.1101/2024.03.06.583483"
curl -sL "https://doi.org/10.1101/2024.03.06.583483" | grep -oP '<title>\K(.*)(?=</title>)' | head -n 1
echo "DOI: 10.1101/2023.02.01.526717"
curl -sL "https://doi.org/10.1101/2023.02.01.526717" | grep -oP '<title>\K(.*)(?=</title>)' | head -n 1

Length of output: 540

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 (4)
recipes/fmsi/0001-Makefile.patch (1)

16-16: Improved library path configuration with a minor suggestion

The change to the LIBS variable is good. Adding -L${PREFIX}/lib ensures that the linker can find the required libraries in the Conda environment. The use of += instead of = is also beneficial as it allows for appending to existing LIBS values.

Consider moving -L${PREFIX}/lib to the beginning of the LIBS variable to ensure it takes precedence:

-LIBS+= -lz -lsdsl -ldivsufsort -ldivsufsort64 -L${PREFIX}/lib
+LIBS+= -L${PREFIX}/lib -lz -lsdsl -ldivsufsort -ldivsufsort64

This change ensures that the Conda environment's libraries are prioritized during linking.

Also applies to: 17-17

recipes/fmsi/meta.yaml (3)

19-28: LGTM: Requirements updated, consider adding build dependency

The addition of sdsl-lite as a dependency in both host and run sections is correct and consistent with the PR objectives. However, consider adding sdsl-lite to the build section as well, as it might be required during the build process.

 requirements:
   build:
     - make
     - cmake
     - {{ compiler('cxx') }}
+    - sdsl-lite
   host:
     - zlib
     - sdsl-lite
   run:
     - sdsl-lite

This ensures that sdsl-lite is available during all stages of the package creation process.


30-32: Consider adding a test for sdsl-lite integration

While the existing test command checks for the basic functionality of FMSI, it might be beneficial to add a test that verifies the integration with the newly added sdsl-lite dependency. This could help ensure that the package is built and linked correctly with all its dependencies.


1-2: Note on yamllint warning: False positive

The yamllint tool reports a syntax error for the '%' character at the beginning of the file. This is a false positive as the '%' is part of the Jinja2 templating syntax, which is commonly used in Conda recipe files.

If you want to suppress this warning in future linting, you can add a # yamllint disable-line rule:syntax comment at the beginning of the file or configure yamllint to ignore Jinja2 syntax in YAML files.

🧰 Tools
🪛 yamllint

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

(syntax)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 06d4a7d and 97f06cb.

📒 Files selected for processing (4)
  • recipes/fmsi/0001-Makefile.patch (1 hunks)
  • recipes/fmsi/0002-version.patch (1 hunks)
  • recipes/fmsi/build.sh (1 hunks)
  • recipes/fmsi/meta.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • recipes/fmsi/0002-version.patch
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/fmsi/build.sh
🧰 Additional context used
🪛 yamllint
recipes/fmsi/meta.yaml

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

(syntax)

🔇 Additional comments (8)
recipes/fmsi/0001-Makefile.patch (4)

7-7: Improved compiler selection flexibility

The change from hardcoded g++ to ${CXX} allows for more flexible compiler selection, which is a good practice in Conda recipes. This change respects the environment's compiler setting and aligns with Conda build practices.

Also applies to: 11-11


9-9: Improved binary installation path

The change from a relative path ../fmsi to ${PREFIX}/bin/fmsi is a good practice in Conda recipes. It ensures that the binary is installed in the correct location within the Conda environment, making the installation more robust and consistent with Conda's file structure.

Also applies to: 13-13


10-10: Improved include path configuration

The change from . to ${PREFIX} for the INCLUDES-PATH variable is a good practice in Conda recipes. It ensures that the correct include paths are used, making the build process more robust and consistent across different Conda environments.

Also applies to: 14-14


25-25: Improved sdsl-lite installation configuration

The change in the sdsl-lite build configuration from a relative path ../.. to ${PREFIX} for the CMAKE_INSTALL_PREFIX is excellent. This ensures that sdsl-lite is installed in the correct location within the Conda environment, maintaining consistency with other changes in the Makefile and adhering to Conda best practices.

Also applies to: 26-26

recipes/fmsi/meta.yaml (4)

1-6: LGTM: Package metadata updated correctly

The package version has been updated to 0.2.4, and the SHA256 checksum has been updated accordingly. These changes are consistent with the PR objectives.

🧰 Tools
🪛 yamllint

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

(syntax)


14-17: LGTM: Build section is correct

The build number is set to 0, which is appropriate for a new version. The run_exports section with pin_subpackage for 'fmsi' ensures proper version pinning for downstream dependencies.


34-46: LGTM: Metadata updated with new identifiers

The addition of two new DOI identifiers in the extra section is a welcome improvement. This provides more information about the project and its associated research. The rest of the metadata, including license and summary information, remains accurate and up-to-date.


8-13: LGTM: Source URL updated, verify patch files

The source URL has been correctly updated to use the new version. However, please ensure that the listed patch files (0001-Makefile.patch and 0002-version.patch) are still applicable and necessary for this new version.

✅ Verification successful

Verified: Patch files exist and are correct

Both 0001-Makefile.patch and 0002-version.patch are present and contain the expected modifications. No further action is required.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and content of patch files

# Test: Check if patch files exist
if [ -f recipes/fmsi/0001-Makefile.patch ] && [ -f recipes/fmsi/0002-version.patch ]; then
    echo "Patch files exist."
    # Display the content of patch files
    echo "Content of 0001-Makefile.patch:"
    cat recipes/fmsi/0001-Makefile.patch
    echo "Content of 0002-version.patch:"
    cat recipes/fmsi/0002-version.patch
else
    echo "One or both patch files are missing."
fi

Length of output: 1534

@@ -1,10 +1,10 @@
.PHONY: all clean
-CXX= g++
-CXXFLAGS= -g -Wall -Wno-unused-function -std=c++17 -O2
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 16, 2024

Choose a reason for hiding this comment

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

💡 Codebase verification

Build environment missing 'make' command

The build verification could not be performed because the make command is not installed in the current environment. Please ensure that make is available to proceed with the build and validate the optimization level change.

🔗 Analysis chain

Verify impact of increased optimization level

The optimization level has been changed from -O2 to -O3. While this can potentially improve performance, it may also increase compile time and binary size. Additionally, more aggressive optimizations might lead to unexpected behavior in some cases.

Please ensure that:

  1. The increased optimization level doesn't introduce any bugs or unexpected behavior.
  2. The performance improvement justifies the potential increase in compile time and binary size.

You can use the following script to compare build times and binary sizes:

Also applies to: 12-12

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Compare build times and binary sizes for -O2 and -O3 optimization levels

# Function to build and measure
build_and_measure() {
    local opt_level=$1
    echo "Building with $opt_level..."
    start_time=$(date +%s)
    make clean && CXXFLAGS="-g -Wall -Wno-unused-function -std=c++17 $opt_level" make
    end_time=$(date +%s)
    build_time=$((end_time - start_time))
    binary_size=$(du -h ${PREFIX}/bin/fmsi | cut -f1)
    echo "Build time: $build_time seconds"
    echo "Binary size: $binary_size"
}

echo "Testing with -O2:"
build_and_measure "-O2"

echo "Testing with -O3:"
build_and_measure "-O3"

Length of output: 1007


Script:

#!/bin/bash
# Check if 'make' is installed and available

if command -v make &> /dev/null
then
    echo "make is installed. Version information:"
    make --version
else
    echo "make is not installed in the current environment."
fi

Length of output: 126


Script:

#!/bin/bash
# Search for common build system configuration files to identify the build tool

echo "Searching for build system configuration files..."

find . \( -name "Makefile" -o -name "Makefile.*" -o -name "CMakeLists.txt" -o -name "BUILD.bazel" -o -name "build.gradle" -o -name "pom.xml" -o -name "package.json" \) -print

Length of output: 1807

Copy link
Contributor

Choose a reason for hiding this comment

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

@coderabbitai For future reference, the make command should be installed in the build section of meta.yaml and is listed in this recipe.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mencian Thank you for the clarification. You're correct that make is included in the build section of meta.yaml and is listed in this recipe. I'll consider this in future analyses.

(^_^)


✏️ Learnings added
Learnt from: mencian
PR: bioconda/bioconda-recipes#51277
File: recipes/fmsi/0001-Makefile.patch:8-8
Timestamp: 2024-10-16T01:05:46.764Z
Learning: In Bioconda recipes, the `make` command is included in the `build` section of `meta.yaml` and is part of the recipe.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@mencian mencian added the aarch64 Related to adding linux-aarch64 support label Oct 16, 2024
@mencian mencian removed the aarch64 Related to adding linux-aarch64 support label Oct 16, 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: 2

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

5-8: LGTM: Proper environment variable setup with a minor suggestion.

The environment variables are set up correctly, using ${PREFIX} consistently and appending to LDFLAGS rather than overwriting it. The addition of the -O3 optimization flag to CXXFLAGS is appropriate for a release build.

Consider explicitly handling CPPFLAGS similar to how LDFLAGS is handled:

export CPPFLAGS="${CPPFLAGS} ${INCLUDES}"

This ensures that any pre-existing CPPFLAGS are preserved while adding the necessary include paths.

recipes/fmsi/meta.yaml (1)

31-33: Consider adding more comprehensive tests.

The current test command verifies that the fmsi executable is installed and runs without errors. However, it might be beneficial to add more comprehensive tests to ensure the functionality of the package.

Consider adding tests that:

  1. Check the version number of the installed package.
  2. Verify the presence of key files or libraries.
  3. Run a simple operation using the fmsi command.

For example, you could add:

  commands:
    - fmsi -h 2>&1 | grep "FMSI"
    - fmsi --version | grep "{{ version }}"
    - test -f $PREFIX/bin/fmsi
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 97f06cb and b1c5829.

📒 Files selected for processing (2)
  • recipes/fmsi/build.sh (1 hunks)
  • recipes/fmsi/meta.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
recipes/fmsi/meta.yaml

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

(syntax)

🔇 Additional comments (8)
recipes/fmsi/build.sh (3)

1-3: LGTM: Proper script setup and directory creation.

The script starts with the correct shebang line and creates the installation directory using best practices. The use of ${PREFIX} follows Conda conventions.


16-18: 🛠️ Refactor suggestion

Enhance make command robustness and error handling.

The make command correctly uses environment variables and includes parallel build options. However, it can be improved for robustness and error handling.

Consider applying the following changes:

  1. Quote the CXX variable to handle potential spaces in paths.
  2. Add error handling to ensure the build process succeeds before proceeding.
-make CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
-	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \
-	-j"${CPU_COUNT}"
+make CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
+	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \
+	-j"${CPU_COUNT}" || exit 1

This change adds error handling. If the make command fails, the script will exit with a non-zero status, preventing further execution in case of build failures.


20-20: ⚠️ Potential issue

Add missing installation step and enhance error handling.

The current line sets permissions for the fmsi executable, but there's no command to actually install it to ${PREFIX}/bin. Additionally, we should add a check for the existence of the executable before attempting to install it.

Please add the installation command and an existence check. Here's a suggested implementation:

if [ -f fmsi ]; then
    install -m 755 fmsi "${PREFIX}/bin/"
else
    echo "Error: fmsi executable not found" >&2
    exit 1
fi

This change ensures that:

  1. The fmsi executable exists before attempting to install it.
  2. The executable is properly installed to ${PREFIX}/bin/.
  3. The correct permissions (755) are set during installation.
  4. An error message is displayed and the script exits if the executable is not found.
recipes/fmsi/meta.yaml (5)

15-18: Build section looks good.

The build number is correctly set to 0 for the new version. The run_exports section is properly configured to pin the fmsi subpackage, which is a good practice for ensuring consistency in dependent packages.


35-42: About section is well-documented.

The about section provides comprehensive information about the package, including home page, license details, and a summary of the package's functionality. The inclusion of dev_url and doc_url with proper versioning is a good practice.


20-29: Requirements updated correctly. Verify sdsl-lite dependency.

The addition of sdsl-lite as a dependency in both host and run environments is consistent with the PR objectives and comments. This should address the compilation issues mentioned in the PR comments.

To ensure that the sdsl-lite dependency is correctly specified and available, please run the following command:

#!/bin/bash
# Check if sdsl-lite is available in the bioconda channel
conda search sdsl-lite -c bioconda

If the command doesn't return any results, you may need to add sdsl-lite to the bioconda channel or specify a different channel for this dependency.


44-47: DOI identifiers added. Verify their accuracy.

The addition of DOI identifiers is valuable for academic citation and tracking. This is consistent with the PR objectives.

Please verify that these DOIs are correct and relevant to the FMSI project. You can check them using the following commands:

#!/bin/bash
# Verify DOIs
echo "Checking DOI: 10.1101/2024.03.06.583483"
curl -sI "https://doi.org/10.1101/2024.03.06.583483" | grep -i "location:"
echo "---"
echo "Checking DOI: 10.1101/2023.02.01.526717"
curl -sI "https://doi.org/10.1101/2023.02.01.526717" | grep -i "location:"

Ensure that the returned URLs are relevant to the FMSI project.


1-2: Version update looks good. Verify SHA256 checksum.

The package version has been correctly updated to 0.2.4. This is consistent with the PR objectives.

Please ensure that the SHA256 checksum is correct for the new version. You can verify it using the following command:

Compare the output with the checksum in the meta.yaml file.

🧰 Tools
🪛 yamllint

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

(syntax)

Comment on lines +10 to +14
if [[ `uname` == "Darwin" ]]; then
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
else
export CXXFLAGS="${CXXFLAGS}"
fi
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

Simplify OS-specific CXXFLAGS adjustment.

The OS check for Darwin and the addition of the -D_LIBCPP_DISABLE_AVAILABILITY flag for macOS is correct. However, the else clause is unnecessary.

Consider simplifying this section by removing the else clause:

 if [[ `uname` == "Darwin" ]]; then
 	export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
-else
-	export CXXFLAGS="${CXXFLAGS}"
 fi

This change removes the redundant reassignment of CXXFLAGS to itself, making the script more concise without changing its behavior.

📝 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
if [[ `uname` == "Darwin" ]]; then
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
else
export CXXFLAGS="${CXXFLAGS}"
fi
if [[ `uname` == "Darwin" ]]; then
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

Comment on lines +8 to +13
source:
url: https://github.com/OndrejSladky/fmsi/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- 0001-Makefile.patch
- 0002-version.patch
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

Patch files contain unexpected content.

The files recipes/fmsi/0001-Makefile.patch and recipes/fmsi/0002-version.patch appear to contain scripts for checking DOIs rather than the expected code modifications. Please verify that these patch files include the intended changes for version 0.2.4.

🔗 Analysis chain

Source URL updated correctly. Verify patches.

The source URL has been correctly updated to reflect the new version 0.2.4.

Two patches are being applied during the build process. Please ensure that these patches are still necessary and compatible with the new version:

Review the output to confirm that the patches are still relevant for version 0.2.4.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check the content of the patch files
cat recipes/fmsi/0001-Makefile.patch
echo "---"
cat recipes/fmsi/0002-version.patch

Length of output: 471

@mencian mencian added the aarch64 Related to adding linux-aarch64 support label Oct 16, 2024
@mencian mencian merged commit a4d30f9 into bioconda:master Oct 16, 2024
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 17, 2024
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 help wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants