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

recipe for pgrc #50973

Merged
merged 7 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions recipes/pgrc/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/bash

mkdir -p $PREFIX/bin

mkdir build
cd build
Comment on lines +5 to +6
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Improve error handling for directory change.

While the build directory creation is correct, it's important to handle potential failures when changing directories.

Apply this change to improve error handling:

 mkdir build
-cd build
+cd build || exit 1

This ensures the script exits if it fails to change to the build directory, preventing issues in subsequent steps.

📝 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
mkdir build
cd build
mkdir build
cd build || exit 1
🧰 Tools
🪛 Shellcheck

[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

export CPATH=${BUILD_PREFIX}/include
export CXXPATH=${BUILD_PREFIX}/include
export CXXFLAGS="$CFLAGS -I$BUILD_PREFIX/include"
export LDFLAGS="$LDFLAGS -L$BUILD_PREFIX/lib"
cmake ..
make -j ${CPU_COUNT} PgRC
Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance build process with error handling and parallel jobs.

The build commands look good, but could benefit from improved error handling. The use of parallel jobs in the make command is excellent for performance.

Consider modifying the build commands as follows:

-cmake ..
-make -j ${CPU_COUNT} PgRC
+cmake .. || exit 1
+make -j${CPU_COUNT} PgRC || exit 1

These changes ensure that the script exits if either the cmake or make command fails, preventing issues with incomplete or failed builds. The space after -j has been removed as it's not necessary.

📝 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
cmake ..
make -j ${CPU_COUNT} PgRC
cmake .. || exit 1
make -j${CPU_COUNT} PgRC || exit 1


cp PgRC $PREFIX/bin
martin-g marked this conversation as resolved.
Show resolved Hide resolved
38 changes: 38 additions & 0 deletions recipes/pgrc/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% set version = "2.0" %}
{% set sha256 = "b4f7c1020dcf83428ee04663e2d68e81b08ba5853c9edffb3d5d00ac0f361b92" %}

package:
name: pgrc
version: {{ version }}

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

source:
url: https://github.com/kowallus/PgRC/archive/refs/tags/v{{ version }}.tar.gz
sha256: {{ sha256 }}

requirements:
build:
- {{ compiler('cxx') }}
- cmake >=3.5
- make

test:
commands:
- PgRC -v 2>&1 | grep -F {{ version }}
- PgRC -h

about:
home: https://github.com/kowallus/PgRC
license: GPL-3.0-or-later
license_file: LICENSE
license_family: GPL3
summary: A tool for compressing the DNA stream of FASTQ datasets

extra:
maintainers:
- kowallus
Loading