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 khmer #49276

Closed
wants to merge 69 commits into from
Closed

update khmer #49276

wants to merge 69 commits into from

Conversation

lskatz
Copy link
Contributor

@lskatz lskatz commented Jul 15, 2024

khmer does not play well with python 3.12 and so I have updated the requirement. More information: dib-lab/khmer#1927


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>.

@dr-joe-wirth
Copy link
Contributor

oops. looks like i duplicated this in PR #49350. maybe this PR should be closed?

@rpetit3
Copy link
Member

rpetit3 commented Jul 17, 2024

closing in favor of the merged #49350

@rpetit3 rpetit3 closed this Jul 17, 2024
@rpetit3
Copy link
Member

rpetit3 commented Jul 17, 2024

reopening, since it looks like we'll need it

@rpetit3 rpetit3 reopened this Jul 17, 2024
@dr-joe-wirth
Copy link
Contributor

tests passed, but it didn't actually build anything.

@dr-joe-wirth
Copy link
Contributor

i have a hunch that the problem is with the patch. the highest release that the khmer github page lists is 2.1.2. i'm not sure where the 3.0+ versions are coming from other than the patch.

@aliciaaevans
Copy link
Contributor

I made PR #49494 just to update the build failure file (recipes/khmer/build_failure.linux-64.yaml) on master so it doesn't try to build it on the nightly in the current broken state, but that build_failure file can be removed on this branch once my PR is merged to master and then this branch updated from master.

@dr-joe-wirth
Copy link
Contributor

dr-joe-wirth commented Aug 6, 2024

not sure why this is failing, but it looks like a certain folder (src) isn't being found. here is the relevant output from the bioconda test.

.18:54:44 BIOCONDA INFO (OUT)   /opt/conda/conda-bld/khmer_1722279080981/_build_env/bin/x86_64-conda-linux-gnu-c++ -shared -Wl,--allow-shlib-undefined -Wl,-rpath,/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -Wl,-rpath-link,/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -L/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -Wl,--allow-shlib-undefined -Wl,-rpath,/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -Wl,-rpath-link,/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -L/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -Wl,-rpath-link,/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -L/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -fdebug-prefix-map=/opt/conda/conda-bld/khmer_1722279080981/work=/usr/local/src/conda/khmer-3.0.0a3 -fdebug-prefix-map=/opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho=/usr/local/src/conda-prefix -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/conda-bld/khmer_1722279080981/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include build/temp.linux-x86_64-cpython-38/khmer/_oxli/oxli_exception_convert.o build/temp.linux-x86_64-cpython-38/khmer/_oxli/utils.o build/temp.linux-x86_64-3.8/src/khmer/_cpy_khmer.o build/temp.linux-x86_64-3.8/src/khmer/_cpy_utils.o build/temp.linux-x86_64-3.8/src/khmer/_cpy_readparsers.o build/temp.linux-x86_64-3.8/src/oxli/read_parsers.o build/temp.linux-x86_64-3.8/src/oxli/kmer_hash.o build/temp.linux-x86_64-3.8/src/oxli/hashtable.o build/temp.linux-x86_64-3.8/src/oxli/hashgraph.o build/temp.linux-x86_64-3.8/src/oxli/labelhash.o build/temp.linux-x86_64-3.8/src/oxli/subset.o build/temp.linux-x86_64-3.8/src/oxli/read_aligner.o build/temp.linux-x86_64-3.8/src/oxli/hllcounter.o build/temp.linux-x86_64-3.8/src/oxli/traversal.o build/temp.linux-x86_64-3.8/src/oxli/kmer_filters.o build/temp.linux-x86_64-3.8/src/oxli/assembler.o build/temp.linux-x86_64-3.8/src/oxli/alphabets.o build/temp.linux-x86_64-3.8/src/oxli/storage.o build/temp.linux-x86_64-3.8/third-party/smhasher/MurmurHash3.o third-party/cqf/gqf.o -lz -lbz2 -o build/lib.linux-x86_64-cpython-38/khmer/_oxli/utils.cpython-38-x86_64-linux-gnu.so -fopenmp
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/khmer/_cpy_khmer.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/khmer/_cpy_utils.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/khmer/_cpy_readparsers.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/read_parsers.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/kmer_hash.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/hashtable.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/hashgraph.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/labelhash.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/subset.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/read_aligner.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/hllcounter.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/traversal.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/kmer_filters.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/assembler.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/alphabets.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/src/oxli/storage.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   x86_64-conda-linux-gnu-c++: error: build/temp.linux-x86_64-3.8/third-party/smhasher/MurmurHash3.o: No such file or directory
18:54:44 BIOCONDA INFO (OUT)   error: command '/opt/conda/conda-bld/khmer_1722279080981/_build_env/bin/x86_64-conda-linux-gnu-c++' failed with exit code 1
18:54:44 BIOCONDA INFO (OUT)   error: subprocess-exited-with-error

@dr-joe-wirth
Copy link
Contributor

giving up for now. khmer compiles but does not run. gzerror is an undefined symbol at runtime...prob has something to do with the fact that third-party/zlib appears to be static linked in the setup.py file, but we want it to link to conda-installed zlib instead of relying on the third-party directory as this would be more stable.

Copy link
Contributor

coderabbitai bot commented Nov 21, 2024

📝 Walkthrough

Walkthrough

The pull request introduces several changes to the khmer-2.1.1 package, primarily focusing on dependency management and build process automation. Key modifications include commenting out the definitions of ZLIBDIR and BZIP2DIR in the setup.py file, which prevents the inclusion of zlib and bzip2 libraries during the build. The setup.cfg file has been updated to correct the key for include directories from include-dirs to include_dirs, altering the paths used for dependencies. Additionally, the MANIFEST.in file has been modified to comment out lines that include third-party dependencies, effectively removing them from the package manifest. A new build.sh script has been added to automate the build process, setting up necessary environment variables and copying files to designated directories. Finally, the meta.yaml file has been updated to reflect a new version number, SHA256 checksum, and changes in build and run requirements, ensuring that the package aligns with the updated dependency management strategy.

Possibly related PRs

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

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

27-32: Improve installation verification and debugging

The current debugging approach could be more informative and the installation success isn't properly verified.

Consider these improvements:

-# install khmer
-$PYTHON -m pip install . --no-deps --no-build-isolation --no-cache-dir --use-pep517 -vvv
+# Install khmer and verify success
+if ! $PYTHON -m pip install . --no-deps --no-build-isolation --no-cache-dir --use-pep517 -vvv; then
+    echo "Error: Failed to install khmer package"
+    exit 1
+fi

-# debugging line to find where khmer was installed
-echo "here i am! ⊂◉‿◉つ "
-ls -lhR
+# Verify installation
+echo "Verifying khmer installation..."
+if ! $PYTHON -c "import khmer; print(f'Successfully installed khmer {khmer.__version__}')"; then
+    echo "Error: Failed to import installed khmer package"
+    exit 1
+fi
+
+# List only relevant directories
+echo "Installation contents:"
+ls -lh $PREFIX/{bin,lib,include}

1-32: Consider modernizing the build system approach

Based on the PR objectives and the current implementation, there are several architectural considerations:

  1. The current approach of manually copying files and managing paths could be replaced with modern build system tools like cmake or meson
  2. The bundled dependencies strategy (seqan, zlib) should be replaced with proper conda dependencies as mentioned in the PR description
  3. The build script should be integrated with conda's build system to properly handle run_exports

Consider these improvements:

  1. Move to a modern build system tool
  2. Replace bundled dependencies with conda packages
  3. Add proper version constraints in meta.yaml
  4. Implement proper ABI compatibility checks

Would you like assistance in implementing any of these architectural changes?

recipes/khmer/meta.yaml (2)

27-46: Review dependency management strategy.

The changes to dependencies look good and address the issues mentioned in the PR:

  1. Explicit bzip2 and zlib dependencies in build/host/run sections
  2. Platform-specific OpenMP support (llvm-openmp for macOS, libgomp for Linux)
  3. Updated Python package dependencies

Consider adding version constraints for critical dependencies like bzip2 and zlib to ensure ABI compatibility.


Line range hint 1-60: Summary of key points requiring attention.

  1. The Python 3.12 compatibility goal needs clarification, as it conflicts with the skip condition.
  2. The dependency management changes look good, moving from bundled to conda-managed dependencies.
  3. The version downgrade from 3.0.0a3 to 2.1.1 needs verification.
  4. Consider adding version constraints for system libraries.

After addressing these points, please ensure thorough testing of the package build and runtime behavior, particularly focusing on the zlib and bzip2 integration since these were previously causing issues.

🧰 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

Reviewing files that changed from the base of the PR and between d0834c4 and 8205a3d.

📒 Files selected for processing (5)
  • recipes/khmer/0002-do-not-install-dependencies-on-our-own.patch (1 hunks)
  • recipes/khmer/0003-remove-dependencies-from-config.patch (1 hunks)
  • recipes/khmer/0004-remove-dependencies-from-manifest.patch (1 hunks)
  • recipes/khmer/build.sh (1 hunks)
  • recipes/khmer/meta.yaml (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • recipes/khmer/0002-do-not-install-dependencies-on-our-own.patch
  • recipes/khmer/0004-remove-dependencies-from-manifest.patch
🧰 Additional context used
🪛 yamllint
recipes/khmer/meta.yaml

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

(syntax)

🔇 Additional comments (5)
recipes/khmer/0003-remove-dependencies-from-config.patch (2)

9-10: LGTM! Removing bundled dependencies in favor of system libraries.

The change to use system libraries instead of bundled ones aligns with the PR objective and should help resolve the undefined symbol issues encountered during builds.


10-10: Verify the new seqan include path.

The path to seqan has changed from third-party/seqan/core/include to include/seqan. Let's verify this path exists and contains the required headers.

recipes/khmer/meta.yaml (3)

55-60: Verify license change.

The license has been updated from "BSD License" to "BSD-3-Clause". This change requires verification against the source repository.

✅ Verification successful

License change is correct

The license in the source repository's LICENSE file explicitly states "License: BSD-3-Clause" and includes the standard BSD-3-Clause license text. This confirms that the license change in meta.yaml is accurate.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify license in source repository
# Expected: BSD-3-Clause license

# Check license file in repository
gh api repos/dib-lab/khmer/contents/LICENSE

Length of output: 7075


13-15: Verify patch contents for dependency management.

The patches appear to address the dependency management issues mentioned in the PR objectives:

  1. Not installing dependencies during build
  2. Removing dependencies from config
  3. Removing dependencies from manifest

These changes align with the goal of using conda-managed dependencies instead of bundled ones.

✅ Verification successful

Patches correctly implement dependency management changes

The patches effectively implement the intended changes to use conda-managed dependencies:

  • 0002-do-not-install-dependencies-on-own.patch: Disables bundled zlib and bzip2 compilation by commenting out directory definitions and preventing their build
  • 0003-remove-dependencies-from-config.patch: Updates include paths to use system libraries instead of bundled ones
  • 0004-remove-dependencies-from-manifest.patch: Removes bundled third-party dependencies from package manifest
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check patch contents
# Expected: Patches modify dependency handling

for patch in recipes/khmer/*.patch; do
  echo "=== $patch ==="
  cat "$patch" || echo "Patch not found: $patch"
done

Length of output: 3832


1-3: Verify version downgrade and checksum.

The version has been downgraded from 3.0.0a3 to 2.1.1. This is a significant change that requires verification.

🧰 Tools
🪛 yamllint

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

(syntax)

Comment on lines +19 to +25
# populate compiling directories
cp -v lib/* $PREFIX/include
cp -v scripts/* $PREFIX/bin

# copies over third-party/seqan/core/include/seqan
mkdir -pv $PREFIX/include/seqan
cp -vr third-party/seqan/core/include/seqan/* $PREFIX/include/seqan/
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

Fix incorrect file copying operations and add error handling

There are several issues with the file copying operations:

  1. Copying lib/* to include directory seems incorrect - library files should go to lib
  2. No verification that source files exist before copying
  3. Missing error handling for failed copies

Consider this improved implementation:

-cp -v lib/* $PREFIX/include
-cp -v scripts/* $PREFIX/bin
+# Verify source directories exist
+for dir in lib scripts third-party/seqan/core/include/seqan; do
+    if [ ! -d "$dir" ]; then
+        echo "Error: Required directory $dir not found"
+        exit 1
+    fi
+done
+
+# Copy files to correct locations
+cp -v lib/* $PREFIX/lib || { echo "Error copying library files"; exit 1; }
+cp -v scripts/* $PREFIX/bin || { echo "Error copying scripts"; exit 1; }

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +1 to +11
#!/bin/bash

set -x -e

# export variables for compiling
export INCLUDE_PATH="${BUILD_PREFIX}/include:${PWD}/third-party/seqan/core/include"
export LIBRARY_PATH="${BUILD_PREFIX}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PWD}/lib"

export LDFLAGS="-L${BUILD_PREFIX}/lib -L${PWD}/third-party/seqan/core/include"
export CCPFLAGS="-I${BUILD_PREFIX}/include -I${PWD}/third-party/seqan/core/include"
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

Review environment variable handling

The environment variable setup has several potential issues:

  1. INCLUDE_PATH and LIBRARY_PATH completely override system paths instead of appending
  2. Hardcoded paths to third-party/seqan could break if the directory structure changes
  3. Modifying LD_LIBRARY_PATH might affect runtime behavior unexpectedly

Consider these improvements:

-export INCLUDE_PATH="${BUILD_PREFIX}/include:${PWD}/third-party/seqan/core/include"
-export LIBRARY_PATH="${BUILD_PREFIX}/lib"
-export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PWD}/lib"
+export INCLUDE_PATH="${INCLUDE_PATH:+$INCLUDE_PATH:}${BUILD_PREFIX}/include:${PWD}/third-party/seqan/core/include"
+export LIBRARY_PATH="${LIBRARY_PATH:+$LIBRARY_PATH:}${BUILD_PREFIX}/lib"
# Remove LD_LIBRARY_PATH modification as it's typically not needed during build
📝 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
#!/bin/bash
set -x -e
# export variables for compiling
export INCLUDE_PATH="${BUILD_PREFIX}/include:${PWD}/third-party/seqan/core/include"
export LIBRARY_PATH="${BUILD_PREFIX}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PWD}/lib"
export LDFLAGS="-L${BUILD_PREFIX}/lib -L${PWD}/third-party/seqan/core/include"
export CCPFLAGS="-I${BUILD_PREFIX}/include -I${PWD}/third-party/seqan/core/include"
#!/bin/bash
set -x -e
# export variables for compiling
export INCLUDE_PATH="${INCLUDE_PATH:+$INCLUDE_PATH:}${BUILD_PREFIX}/include:${PWD}/third-party/seqan/core/include"
export LIBRARY_PATH="${LIBRARY_PATH:+$LIBRARY_PATH:}${BUILD_PREFIX}/lib"
# Remove LD_LIBRARY_PATH modification as it's typically not needed during build
export LDFLAGS="-L${BUILD_PREFIX}/lib -L${PWD}/third-party/seqan/core/include"
export CCPFLAGS="-I${BUILD_PREFIX}/include -I${PWD}/third-party/seqan/core/include"

Comment on lines +13 to +17
# create directories for compiling
mkdir -p $PREFIX/bin
mkdir -p $PREFIX/include
mkdir -p $PREFIX/lib
mkdir -p $PREFIX/scripts
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

Add safety check for $PREFIX environment variable

The script assumes $PREFIX is set but doesn't verify it. This could lead to unexpected behavior if the variable is unset.

Add this check at the beginning of the script:

 set -x -e

+# Verify required environment variables
+if [ -z "${PREFIX}" ]; then
+    echo "Error: PREFIX environment variable is not set"
+    exit 1
+fi

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +18 to +21
number: 0
skip: True # [py >= 312]
run_exports:
- {{ pin_subpackage('khmer', max_pin="x.x") }}
- {{ pin_subpackage(name|lower, max_pin="x.x") }}
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

Inconsistency with PR objectives regarding Python 3.12 compatibility.

The PR objectives mention addressing Python 3.12 compatibility issues, but the recipe explicitly skips Python >= 3.12. This seems contradictory.

Please clarify:

  1. If the package should support Python 3.12, remove the skip condition
  2. If Python 3.12 is not supported, update the PR objectives to reflect this limitation

@lskatz lskatz closed this Dec 3, 2024
@lskatz lskatz deleted the khmer branch December 3, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants