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 piscem to 0.10.4 #51799

Merged
merged 4 commits into from
Oct 30, 2024
Merged

Update piscem to 0.10.4 #51799

merged 4 commits into from
Oct 30, 2024

Conversation

BiocondaBot
Copy link
Collaborator

Update piscem: 0.10.30.10.4

install with bioconda Conda

Info Link or Description
Recipe recipes/piscem (click to view/edit other files)
Summary piscem is a next-generation compacted colored de Bruijn Graph-based indexer and mapper
Home https://github.com/COMBINE-lab/piscem
Releases https://github.com/COMBINE-lab/piscem/releases
Author @COMBINE-lab

This pull request was automatically generated (see docs).

@BiocondaBot BiocondaBot added autobump Automatic Version Update new version labels Oct 30, 2024
Copy link
Contributor

coderabbitai bot commented Oct 30, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request updates the meta.yaml file for the piscem package, changing the version number from "0.10.3" to "0.10.4". The SHA256 checksum has also been updated from "5bb7d856e28f7090456bbc9aa81120169cff76b66c47a642916d8d53e35bec8a" to "665d3dc54bf4b9c50c02d190112177e270c1b992e61608f34c3e95b0e4a5b5d6". Additionally, the build.sh script has been modified to include an export statement for macOS systems, specifically setting the MACOSX_SDK_VERSION to 10.15 when the operating system is detected as Darwin. These changes are focused on versioning, checksum verification, and environment configuration for macOS.

Possibly related PRs

Suggested reviewers

  • bgruening: Suggested reviewer for expertise in package management and related updates.

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.

@rob-p
Copy link
Contributor

rob-p commented Oct 30, 2024

@bgruening : Any idea on why the OSX-64 build alone may be failing? It passes fine on our repo's on CI. It's strange that aarch-osx passes (and linux x86-64) but not OSX-64.

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/piscem/build.sh (2)

13-13: LGTM! Consider documenting the SDK version choice.

Setting MACOSX_SDK_VERSION to 10.15 aligns well with the deployment target and provides good compatibility.

Consider adding a comment explaining why 10.15 was chosen as the SDK version, which would help future maintainers understand the rationale.

+ # Use macOS 10.15 SDK for better compatibility across different macOS versions
  export MACOSX_SDK_VERSION=10.15

7-13: Consider documenting these macOS fixes in the Bioconda documentation.

These macOS-specific fixes (SDK version and aligned allocation) might be valuable patterns for other packages facing similar issues. Consider adding them to the Bioconda documentation or troubleshooting guide.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b24aaf1 and 0d90319.

📒 Files selected for processing (1)
  • recipes/piscem/build.sh (1 hunks)
🔇 Additional comments (1)
recipes/piscem/build.sh (1)

7-11: LGTM! The x86_64 macOS specific handling looks appropriate.

This change appears to address the OSX-64 build failure by adding the -D_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC flag, which is a known solution for aligned allocation issues in older macOS SDKs.

Let's verify if this is the only instance where we need this fix:

✅ Verification successful

The x86_64 macOS specific fix is unique and appropriate

The -D_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC flag addition in piscem's build script is specific to addressing aligned allocation issues in older macOS SDKs. While other recipes do have x86_64-specific handling, they address different concerns:

  • centrifuger: adds SSE4.2 optimization
  • t1k and trust4: handle samtools dependency differently

The fix is correctly scoped to piscem and doesn't need to be propagated to other recipes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other recipes that might need similar SDK fixes
rg -l "LIBCPP_HAS_NO_C11_ALIGNED_ALLOC" recipes/

Length of output: 72


Script:

#!/bin/bash
# Let's check if there are other recipes with similar x86_64 macOS specific handling
rg -l "uname -m.*x86_64" recipes/

# Also check for any other recipes that might have macOS SDK version handling
rg -l "MACOSX_SDK_VERSION" recipes/

Length of output: 521


Script:

#!/bin/bash
# Let's check the context of x86_64 handling in other recipes that might have similar build issues
rg "uname -m.*x86_64" recipes/trust4/build.sh recipes/t1k/build.sh recipes/centrifuger/build.sh -A 3 -B 3

# Also check if any of these recipes have similar compiler flag adjustments
rg "CFLAGS|CXXFLAGS" recipes/trust4/build.sh recipes/t1k/build.sh recipes/centrifuger/build.sh

Length of output: 1964

Copy link
Contributor

@rob-p rob-p left a comment

Choose a reason for hiding this comment

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

Works --- Looking for a better way to address the ::aligned_alloc issue on OSX-x86. Ideally, we'd just bump the minimum version to OSX 10.15 (which should be old enough).

@rob-p rob-p merged commit 5f76a44 into master Oct 30, 2024
6 checks passed
@rob-p rob-p deleted the bump/piscem branch October 30, 2024 16:14
@bgruening
Copy link
Member

Thanks @rob-p!

@rob-p
Copy link
Contributor

rob-p commented Oct 30, 2024

Sure thing! For the record, the issue seems to be that the <string> header includes a definition of ::aligned_alloc that isn't valid in OSX pre 10.15 (but the build seems to use the 10.13 SDK). A more desirable solution would be to figure out how to ensure that everything is building on 10.15, but I couldn't figure out how to make that work, so my workaround was to set one of the pre-processor macros that would disable this definition of ::aligned_alloc in favor of the posix alternative.

If there is a suggest of how to address this more centrally, let me know (or if there is a way to force a newer version of OSX that I overlooked).

Thanks,
Rob

@robomics
Copy link
Contributor

I am not an expert on how cargo orchestrates the compilation process, but from a quick look at the recipe it does not seem like you are passing conda's sysroot to the build system. My guess is that cargo is picking up the runner SDK instead of the one installed by conda.

Bioconda recently switched from Azure to GH Actions, which may have caused a change in the SDK used by the runner. This could possibly explain why the problem started occurring just now.

In the C++/CMake world you can pass the appropriate sysroot like so:

if [[ ${HOST} =~ .*darwin.* ]]; then
  cmake -DCMAKE_OSX_SYSROOT="${CONDA_BUILD_SYSROOT}" ...
else
  cmake -DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake" ...
fi

Where cross-linux.cmake contains the following:

# this one is important
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_PLATFORM Linux)
#this one not so much
set(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})

# where is the target environment
set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot)

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

# god-awful hack because it seems to not run correct tests to determine this:
set(__CHAR_UNSIGNED___EXITCODE 1)

Note that on macOS x86 this may not be enough if you depend on somewhat modern C/C++ features. See here for some guidance on how to proceed.

I am not sure how these steps can be adapted to fit cargo's way of doing things, but I hope some of this will be useful to you/other people stumbling on this issue.

@rob-p
Copy link
Contributor

rob-p commented Oct 31, 2024

Thanks @robomics --- the offending code is actually in a C++ submodule (managed with CMake) that is being build by cargo under the hood to produce a statically linked library. Thus, your CMake solution may very well work if I implement it in the underlying submodule (which is also code that we have developed in the lab / control). We do rely very heavily on C++17 (at a minimum), and so that is a hard requirement for us for build. I just wish there was an easier way to tell conda / bioconda to only provide a newer SDK by default at the conda / CI level (rather than having to pass a bunch of specific variables to the individual build systems). Our CMake and build.rs files are already laden with special behavior and variables set for bioconda builds in general.

To build C++ code, Rust uses build.rs which is arbitrary rust code that can then configure and invoke CMake with whatever appropriate parameters one wants.

I also noticed the switch from Azure to GitHub CI, and it didn't escape me that this coincided with the problem. However, I also thought it was particularly strange that it didn't affect the aarch64 build for OSX, but only the x86 build.

@robomics
Copy link
Contributor

Thanks for the clarifications!

I think it should be possible to deal with all/most of bioconda peculiarities using CMake toolchain files (which does not require modifying the CMakeLists.txt of the underlying projects).

You should be able to adapt the toolchain file from my previous post and then pass it down to all CMake invocations by defining the CMAKE_TOOLCHAIN_FILE env variable in the build script.

All of this should not be an issue on macOS arm64 (at least when it comes to C++17 support) because the oldest OS/SDK with arm support is v11.0.
Still, ensuring the right sysroot is being used is probably a good idea, as it will prevent ABI problems that could happen in the future when the runners are updated.

@coderabbitai coderabbitai bot mentioned this pull request Nov 14, 2024
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.

4 participants