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 odgi to 0.9.0 #51405

Merged
merged 5 commits into from
Oct 16, 2024
Merged

Update odgi to 0.9.0 #51405

merged 5 commits into from
Oct 16, 2024

Conversation

BiocondaBot
Copy link
Collaborator

@BiocondaBot BiocondaBot commented Oct 15, 2024

Update odgi: 0.8.60.9.0

install with bioconda Conda

Info Link or Description
Recipe recipes/odgi (click to view/edit other files)
Summary An optimized dynamic genome/graph implementation.
Home https://github.com/pangenome/odgi
Releases https://github.com/pangenome/odgi/releases
Recipe Maintainer(s) @AndreaGuarracino
Author @pangenome

This pull request was automatically generated (see docs).

@BiocondaBot BiocondaBot added autobump Automatic Version Update new version labels Oct 15, 2024
@mencian mencian added aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Oct 15, 2024
Copy link
Contributor

coderabbitai bot commented Oct 15, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces significant modifications to the odgi package, primarily affecting the build.sh script and the meta.yaml file. In build.sh, environment variable exports have been streamlined, with specific paths consolidated and new variables such as INCLUDES, LIBPATH, LDFLAGS, and CXXFLAGS introduced. The cmake command has been enhanced to include additional parameters for installation prefix and C++ flags, and a conditional check for macOS has been added to adjust build configurations accordingly. The build process now includes a step to create the build directory and install the target using parallel jobs based on the CPU_COUNT variable.

In the meta.yaml file, the version number has been updated from 0.8.6 to 0.9.0, and the SHA256 checksum has been modified. The build section has seen the removal of a macOS skip condition and a reset of the build number. Changes in the requirements section include the relocation of dependencies and the explicit inclusion of jemalloc. New fields have been added in the about section, and the extra section has been expanded with additional identifiers and platforms. Finally, a C++ file src/pythonmodule.cpp has been deleted, which contained bindings for Python using Pybind11.

Possibly related PRs

  • Update Earl Grey build.sh #51324: Modifications to the build.sh script for EarlGrey enhance functionality and compatibility, paralleling the restructuring in the odgi build script.

Suggested labels

please review & merge


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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 65f8c99 and fcef977.

📒 Files selected for processing (3)
  • recipes/odgi/build.sh (1 hunks)
  • recipes/odgi/meta.yaml (1 hunks)
  • recipes/odgi/patch (0 hunks)
💤 Files with no reviewable changes (1)
  • recipes/odgi/patch
🧰 Additional context used
🔇 Additional comments (7)
recipes/odgi/meta.yaml (7)

2-2: Version update looks good.

The package version has been correctly updated to 0.9.0, which aligns with the PR objectives.


13-14: Build section changes look good, but verify macOS compatibility.

The build number has been correctly reset to 0 for the new version. The removal of the macOS skip condition suggests that odgi is now compatible with macOS.

Please confirm that odgi v0.9.0 is indeed compatible with macOS and that it has been tested on this platform.


24-25: Requirements changes look good, but verify jemalloc runtime dependency.

The changes to the requirements section are appropriate:

  1. Moving llvm-openmp and libgomp to the host section is correct as they are needed during the build process.
  2. Adding jemalloc to the run section ensures its availability at runtime.

Please confirm that jemalloc is indeed required as a runtime dependency for odgi v0.9.0. If it's only needed during the build process, consider removing it from the run section.

Also applies to: 31-31, 33-33


41-41: About section improvements look great.

The changes to the about section enhance the package metadata:

  1. The home URL is now properly quoted.
  2. The addition of the license_family field provides clearer licensing information.
  3. The summary now has proper punctuation.
  4. The new dev_url and doc_url fields provide valuable links for users and developers.

These improvements will make it easier for users to find information about the package.

Also applies to: 43-43, 45-47


53-56: Extra section additions enhance package discoverability and suggest expanded compatibility.

The changes to the extra section are beneficial:

  1. The new identifiers (DOI, biotools, and usegalaxy-eu) improve package discoverability and provide additional references.
  2. The additional platforms (linux-aarch64 and osx-arm64) suggest expanded compatibility.

Please confirm that odgi v0.9.0 has been tested and is compatible with the newly added platforms (linux-aarch64 and osx-arm64).

Also applies to: 58-59


1-59: Overall, the updates to meta.yaml look comprehensive and well-structured.

The changes successfully update the odgi package to version 0.9.0, including appropriate modifications to the version, build number, checksum, dependencies, and metadata. The expanded platform support and additional identifiers enhance the package's accessibility and discoverability.

To ensure the accuracy and appropriateness of these changes, please address the following verification points:

  1. Confirm the SHA256 checksum for the v0.9.0 tarball.
  2. Verify odgi v0.9.0's compatibility with macOS.
  3. Confirm that jemalloc is required as a runtime dependency.
  4. Verify compatibility with the newly added platforms (linux-aarch64 and osx-arm64).

Once these verifications are complete, the update should be ready for merging.

🧰 Tools
🪛 yamllint

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

(syntax)


10-10: Verify the SHA256 checksum.

The SHA256 checksum has been updated, which is expected for a new version. However, it's crucial to ensure that this checksum is correct for the v0.9.0 tarball.

Run the following script to verify the SHA256 checksum:

Comment on lines +25 to +26
cp -rf lib/*cpython* "${PREFIX}/lib/python${PYVER}/site-packages"
cp -rf lib/* "${PREFIX}/lib"
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

Use standard installation methods for Python packages

Copying files directly with cp -rf to the site-packages directory can overlook important installation steps and may lead to issues with package discovery or dependencies. It's recommended to use standard Python installation mechanisms to ensure proper setup.

Consider modifying the build process to install the Python modules using a setup script or ensure that CMake handles the installation correctly. For example:

  • Modify CMakeLists.txt to include proper installation commands for Python modules.
  • Use setup.py or pyproject.toml if applicable.


cmake -S . -B build -DCMAKE_BUILD_TYPE=Generic \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-march=sandybridge -Ofast' \
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

Reconsider the use of architecture-specific and aggressive optimization flags

The flag -march=sandybridge targets a specific CPU architecture, which might not be compatible with all users' systems. This could result in binaries that fail to run on older or different CPUs. For broader compatibility, consider using a more generic architecture flag like -march=core2 or omitting the -march flag altogether.

Additionally, the -Ofast optimization level enables aggressive optimizations that may disregard strict compliance with standards, potentially leading to unexpected behavior or instability. It might be safer to use -O2 or -O3 for optimization to balance performance and reliability.

Apply the following changes to address the concerns:

-    -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-march=sandybridge -Ofast' \
+    -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-O3' \
📝 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
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-march=sandybridge -Ofast' \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-O3' \

#python -c "import sys; sys.path.append('./lib'); import odgi_ffi"
#python -c "import sys; sys.path.append('./lib'); import odgi"
mkdir -p "${PREFIX}/lib/python${PYVER}/site-packages"
cp -rf lib/*cpython* "${PREFIX}/lib/python${PYVER}/site-packages"
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

Avoid hardcoding Python implementation-specific patterns

The use of *cpython* in the copy command assumes that the Python implementation is CPython. This may not be compatible with other Python implementations like PyPy.

Consider using a more general pattern or querying Python for the correct paths. For example:

-PYVER=`python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))'`
+PYTHON_SITE_PACKAGES=`python -c 'import site; print(site.getsitepackages()[0])'`

Then adjust the copy command accordingly:

-mkdir -p "${PREFIX}/lib/python${PYVER}/site-packages"
-cp -rf lib/*cpython* "${PREFIX}/lib/python${PYVER}/site-packages"
+mkdir -p "${PYTHON_SITE_PACKAGES}"
+cp -rf lib/* "${PYTHON_SITE_PACKAGES}"

This approach ensures that the modules are placed in the correct directory regardless of the Python implementation.

Committable suggestion was skipped due to low confidence.

@mencian mencian removed aarch64 Related to adding linux-aarch64 support osx-arm64 Related to adding osx-arm64 support labels Oct 15, 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 (1)
recipes/odgi/build.sh (1)

25-25: Consider a more selective library file copy process

Copying all files from the lib directory to ${PREFIX}/lib ensures that all necessary library files are available. However, this approach might have some drawbacks:

  1. It could copy unnecessary files, increasing the package size.
  2. There's a risk of overwriting existing files in the ${PREFIX}/lib directory.

Consider using a more selective copy process. For example:

# Copy only specific library files
cp -rf lib/libodgi.* "${PREFIX}/lib"
# Or use a list of required libraries
for lib in libodgi libhandlegraph; do
    cp -rf lib/${lib}* "${PREFIX}/lib"
done

This approach would ensure that only the necessary library files are copied, reducing the risk of conflicts and keeping the package size optimal.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f357705 and 3c618ba.

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

5-8: LGTM: Improved environment setup

The new environment variable exports provide a more structured and clear way to set up the build environment. Using $PREFIX ensures that the package is built against the correct dependencies in the conda environment. The use of -O3 optimization is a good choice for balancing performance and stability.


10-14: LGTM: Proper handling of macOS-specific configuration

The addition of a conditional check for macOS and setting specific CMAKE flags (-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER) is a good practice. This helps avoid potential issues with macOS frameworks and app bundles during the build process, ensuring better cross-platform compatibility.


16-20: ⚠️ Potential issue

Improved build process, but reconsider optimization flags

The updated cmake command and separate build step provide better control over the build process and can improve build speed with parallel jobs. However, there are concerns about the use of architecture-specific and aggressive optimization flags.

The use of -march=sandybridge and -Ofast flags may cause compatibility and stability issues, as noted in a previous review. Consider using more generic optimization flags for broader compatibility and stability:

-    -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-march=sandybridge -Ofast' \
+    -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXTRA_FLAGS='-O3' \

This change will maintain good optimization while ensuring better compatibility across different systems.


22-24: ⚠️ Potential issue

Improve Python module installation process

The dynamic Python version detection is good for flexibility. However, the current method of copying Python modules has some potential issues:

  1. The use of *cpython* in the copy command assumes CPython, which may not be compatible with other Python implementations.
  2. Directly copying files to the site-packages directory may bypass important installation steps.

Consider using a more robust method for installing Python modules:

  1. Use python -c 'import site; print(site.getsitepackages()[0])' to get the correct site-packages directory.
  2. If possible, use a setup.py or pyproject.toml for proper Python package installation.

Here's a potential improvement:

PYTHON_SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])')
mkdir -p "${PYTHON_SITE_PACKAGES}"
cp -rf lib/* "${PYTHON_SITE_PACKAGES}"

This approach ensures compatibility with different Python implementations and proper module installation.

@AndreaGuarracino
Copy link
Contributor

@mencian, you are a life saver!

@AndreaGuarracino AndreaGuarracino merged commit 5026036 into master Oct 16, 2024
7 checks passed
@AndreaGuarracino AndreaGuarracino deleted the bump/odgi branch October 16, 2024 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autobump Automatic Version Update new version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants