-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 python to >=3.8 in k8 recipe #51054
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request includes updates to the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (2)
recipes/k8/build.sh (2)
Line range hint
38-42
: Compilation and installation process looks good, with a minor suggestionThe k8 compilation and installation process is well-structured:
- It uses the
NODE_SRC
variable set earlier, ensuring consistency.- The
CXXFLAGS
include necessary compiler options, including C++17 support.- The
LIBS
variable incorporatesLDFLAGS
, which is good for maintaining any system-specific linker flags.However, there's a minor improvement that could be made for better error handling:
Consider adding error checking after the
make
andcp
commands. This will help catch and report any issues during compilation or installation. Here's a suggested modification:-NODE_SRC="node-v${NODE_VERSION}" CXXFLAGS="${CXXFLAGS} -std=c++17 -g -O3 -Wall" LIBS="${LDFLAGS} -pthread" make +NODE_SRC="node-v${NODE_VERSION}" CXXFLAGS="${CXXFLAGS} -std=c++17 -g -O3 -Wall" LIBS="${LDFLAGS} -pthread" make || { echo "k8 compilation failed"; exit 1; } mkdir -p $PREFIX/bin -cp -f k8 $PREFIX/bin/k8 +cp -f k8 $PREFIX/bin/k8 || { echo "Failed to install k8 binary"; exit 1; }This change will cause the script to exit with an error message if either the compilation or installation step fails.
🧰 Tools
🪛 Shellcheck
[warning] 29-29: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
29-29
: Improve error handling for 'popd' commandThe static analysis tool Shellcheck has identified a potential issue with the
popd
command. While it's unlikely to fail in this context, it's good practice to handle potential errors.Consider modifying the
popd
command to handle potential failures:-popd +popd || { echo "popd failed, the directory stack might be empty"; exit 1; }This change will cause the script to exit with an error message if
popd
fails, which could happen if the directory stack is empty due to an unexpected error earlier in the script.🧰 Tools
🪛 Shellcheck
[warning] 29-29: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- recipes/k8/build.sh (2 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/k8/build.sh
[warning] 29-29: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
🔇 Additional comments (2)
recipes/k8/build.sh (2)
Line range hint
10-14
: Improved OS detection and Node.js version selectionThe changes in this segment enhance the script's robustness and compatibility:
The use of double brackets
[[
]]
for the OS check is a more modern and reliable approach in bash scripting. It prevents word splitting and provides more consistent behavior across different shells.The Node.js version update for macOS (18.20.4) aligns with the comment explaining version compatibility issues. This change addresses the compilation challenges on macOS while maintaining compatibility with the k8 tool.
These modifications improve the script's reliability and cross-platform compatibility.
30-35
: Improved build flexibility with Makefile modificationsThe changes to the Makefile enhance the build process flexibility:
Allowing
CXXFLAGS
,NODE_SRC
, andLIBS
to be set through environment variables provides greater control over the build process. This is particularly useful for cross-compilation or when specific optimizations are needed.The use of
?=
instead of=
in the Makefile allows these variables to be overridden from the command line or environment, while still providing default values.Removing the backup files (
.bak
) keeps the build directory clean, which is a good practice.These modifications make the build process more adaptable to different environments and requirements.
recipes/k8/build.sh
Outdated
@@ -25,13 +25,14 @@ patch -p0 < ${RECIPE_DIR}/nodejs-x86_64.patch | |||
|
|||
# The provided configure script is a sh/python hybrid which boils down to one line of Python | |||
python -c "import configure" --without-node-snapshot --without-etw --without-npm --without-inspector --without-dtrace | |||
make -j3 | |||
make -j2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Missing Azure build workaround patch found
- The patch file
/nodejs-x86_64.patch
does not exist, preventing the Azure build workaround from being applied. - The expected patched file
node-v/src/debug_utils.cc
is also missing, indicating the patch was not integrated.
🔗 Analysis chain
Verify the impact of the Azure build workaround patch
The patch applied here addresses a specific error occurring during the Azure build for Linux x86_64. While this workaround is likely necessary for successful builds in that environment, it's important to ensure it doesn't introduce unintended side effects.
To verify the patch's impact and necessity:
This script will help verify the existence and content of the patch file, as well as confirm if it's being applied correctly during the build process.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the patch file exists and if it's being applied correctly
# Test 1: Check if the patch file exists
if [ -f "${RECIPE_DIR}/nodejs-x86_64.patch" ]; then
echo "Patch file exists."
else
echo "Patch file not found. Please verify its location."
fi
# Test 2: Check the content of the patch file
echo "Patch file content:"
cat "${RECIPE_DIR}/nodejs-x86_64.patch"
# Test 3: Verify if the patched file exists after build
if [ -f "node-v${NODE_VERSION}/src/debug_utils.cc" ]; then
echo "Patched file exists. Checking for changes:"
grep -n "fwrite" "node-v${NODE_VERSION}/src/debug_utils.cc"
else
echo "Patched file not found. Build process might have failed or file location is incorrect."
fi
Length of output: 493
There was a problem hiding this 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)
.circleci/config.yml (2)
12-12
: Approved: Increased resource allocation for linux-aarch64 jobsThe change from
arm.medium
toarm.large
for the linux-aarch64 executor is a good improvement. This increase in resources can potentially:
- Speed up build times for ARM64 packages.
- Allow for more complex or resource-intensive builds.
- Help resolve dependency issues by providing more computational power and memory.
However, keep in mind that this change might also increase the cost of running these jobs. Ensure that the benefits outweigh the potential increase in CircleCI usage costs.
Consider monitoring the performance impact of this change to evaluate if it significantly improves build times or resolves any existing issues.
Line range hint
1-359
: Overall impact on CircleCI configurationThe change to increase the resource class for linux-aarch64 jobs is well-integrated into the existing configuration. It doesn't introduce any conflicts or inconsistencies with other parts of the file. This isolated change has the potential to improve the build process for ARM64 packages without affecting other architectures or workflows.
The modification aligns well with the PR objectives, particularly in addressing potential dependency resolution issues mentioned in the linked issue #50888. By providing more resources for linux-aarch64 builds, it may help in resolving complex dependency trees or building more resource-intensive packages.
To fully leverage this change:
- Monitor the performance of linux-aarch64 jobs to quantify the improvement in build times and success rates.
- Consider updating the documentation to reflect the increased resource allocation for linux-aarch64 jobs.
- If this change proves beneficial, evaluate if similar resource increases could benefit other architectures in the future.
e604d97
to
dbb3d8b
Compare
There was a problem hiding this 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 (2)
recipes/k8/build.sh (2)
16-23
: Optimized thread count for different architecturesThe addition of this case statement to set the
THREADS
variable is a good optimization:
- It allows for different thread counts on x86_64 (-j2) and other architectures (-j3).
- This can help in optimizing the build process for different system capabilities.
However, consider using the number of available CPU cores to set the thread count dynamically:
THREADS="-j$(nproc)"
This would allow for better scalability across different systems.
44-44
: Cleanup of backup filesThe addition of
rm -rf *.bak
is a good housekeeping step:
- It removes backup files created during the Makefile modifications.
- This helps keep the build directory clean and reduces unnecessary files.
To make this step more robust and verbose, consider the following modification:
find . -name "*.bak" -type f -delete -print || echo "No .bak files found to remove"This change will:
- Use
find
to locate .bak files, which is more precise than a glob pattern.- Print the names of removed files for better logging.
- Provide feedback if no .bak files are found.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- .circleci/config.yml (1 hunks)
- recipes/k8/build.sh (2 hunks)
- recipes/k8/meta.yaml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- .circleci/config.yml
- recipes/k8/meta.yaml
🧰 Additional context used
🪛 Shellcheck
recipes/k8/build.sh
[warning] 38-38: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
🔇 Additional comments (4)
recipes/k8/build.sh (4)
10-14
: Improved OS detection and Node.js version selectionThe changes in this segment enhance the script's robustness and compatibility:
- The use of double brackets
[[]]
for the conditional check is a bash-specific feature that provides more robust string comparison and eliminates word splitting and pathname expansion issues.- The Node.js version selection (18.20.4 for macOS, 18.19.1 for others) aligns with the PR objectives and addresses the compatibility issues mentioned in the linked issue minimap2 with tiledbvcf #50888.
These changes should help resolve the dependency conflicts between minimap2 and tiledbvcf-py on different systems.
Line range hint
32-32
: Verify patch file existence and add error handlingThe application of the patch file is crucial for the Azure build workaround. However, a previous review comment indicated that the patch file might be missing. To ensure robustness:
- Verify that the patch file
${RECIPE_DIR}/nodejs-x86_64.patch
exists.- Add error handling to the patch command:
if [ -f "${RECIPE_DIR}/nodejs-x86_64.patch" ]; then patch -p0 < "${RECIPE_DIR}/nodejs-x86_64.patch" || { echo "Patch application failed"; exit 1; } else echo "Patch file not found: ${RECIPE_DIR}/nodejs-x86_64.patch" exit 1 fiThis will prevent silent failures if the patch file is missing or cannot be applied.
🧰 Tools
🪛 Shellcheck
[warning] 26-26: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
(SC2164)
37-37
: Dynamic thread count for make commandThe modification to use
"${THREADS}"
in the make command is a good improvement:
- It utilizes the dynamically set
THREADS
variable based on the system architecture.- This change allows for more efficient use of system resources during the build process.
- The use of double quotes ensures proper expansion of the variable, which is a good practice.
This change is consistent with the earlier optimization and should lead to improved build performance across different systems.
Line range hint
1-52
: Overall assessment of changesThe modifications to this build script significantly improve its functionality and robustness:
- Enhanced OS and architecture-specific handling for Node.js versions and build processes.
- Improved error handling and cleanup procedures.
- More flexible and optimized build configurations.
These changes align well with the PR objectives, addressing the compatibility issues mentioned in the linked issue #50888. The script now better handles different environments, which should help resolve conflicts between packages like minimap2 and tiledbvcf-py.
The suggested improvements, if implemented, will further enhance the script's reliability and maintainability. Overall, these changes represent a significant step forward in resolving the reported issues and improving the build process for k8.
🧰 Tools
🪛 Shellcheck
[warning] 26-26: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
(SC2164)
@@ -25,13 +34,14 @@ patch -p0 < ${RECIPE_DIR}/nodejs-x86_64.patch | |||
|
|||
# The provided configure script is a sh/python hybrid which boils down to one line of Python | |||
python -c "import configure" --without-node-snapshot --without-etw --without-npm --without-inspector --without-dtrace | |||
make -j3 | |||
make "${THREADS}" | |||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling for popd command
To address the Shellcheck warning and improve script robustness, consider adding error handling to the popd
command:
popd || { echo "popd failed, the script may not be in the expected directory"; exit 1; }
This change will:
- Catch any failures of the
popd
command. - Provide a meaningful error message.
- Exit the script if
popd
fails, preventing any unexpected behavior due to being in the wrong directory.
This improvement aligns with best practices for bash scripting and enhances the overall reliability of the build process.
🧰 Tools
🪛 Shellcheck
[warning] 38-38: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
Good news is the build passed on |
So close, but yet so far... the build completes on |
There was a problem hiding this 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/k8/build.sh (2)
1-1
: LGTM, but consider portability.The change from
#!/usr/bin/env bash
to#!/bin/bash
is acceptable for a Conda recipe. However, for maximum portability, you might want to consider keeping the original shebang line.
12-16
: LGTM: Improved conditional and version selection.The use of double brackets
[[
is a good bash practice. The different Node.js versions for macOS and other systems align with the compatibility notes in the comments above.Consider adding a brief comment explaining why different versions are used for macOS and other systems, for better maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- recipes/k8/build.sh (2 hunks)
- recipes/k8/meta.yaml (3 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/k8/build.sh
[warning] 7-7: DEFAULT_LINUX_VERSION appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 41-41: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
🔇 Additional comments (11)
recipes/k8/meta.yaml (5)
43-43
: LGTM! Improved documentation and metadata.The addition of a period at the end of the summary and the inclusion of a
doc_url
improve the package metadata and provide better documentation for users.Also applies to: 45-45
Line range hint
1-50
: Overall, changes align well with PR objectives and improve package metadata.The modifications in this PR successfully update the Python compatibility to
>=3.8
as intended. Additionally, the changes improve platform support, enhance documentation, and refine package metadata. These updates align well with the PR objectives and contribute to the overall quality of the package.
Line range hint
48-50
: LGTM! Verify compatibility with new platforms.The addition of
linux-aarch64
andosx-arm64
toadditional-platforms
is a positive improvement in terms of platform support.Please verify that the package is indeed compatible with these ARM-based systems. You can check this by running:
#!/bin/bash # Description: Check for any platform-specific code or build instructions # Test: Search for any platform-specific code or build instructions rg --type yaml 'aarch64|arm64' recipes/k8/ rg --type make 'aarch64|arm64' $(fd -t f 'Makefile')
13-14
: LGTM! Verify the updated skip condition.The build number increment and the updated skip condition look good. The change to
skip: True # [osx and x86_64]
potentially allows builds on more platforms.Please verify that this change aligns with the package's compatibility across different platforms. Run the following script to check the package's build history:
✅ Verification successful
: The updated
skip: True # [osx and x86_64]
inrecipes/k8/meta.yaml
correctly restricts builds to OS X and x86_64 platforms while allowing successful builds on additional platforms likelinux-aarch64
andosx-arm64
. No further actions are required.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the build history of the k8 package across different platforms # Test: Search for previous build configurations rg --type yaml 'skip:.*\[.*\]' recipes/k8/Length of output: 3641
24-25
: LGTM! Verify the necessity of setuptools.The change to
python >=3.8
aligns with the PR objectives and allows compatibility with newer Python versions. The addition of setuptools is generally good practice.Please verify if setuptools is explicitly required for building or running the package. You can check this by running:
✅ Verification successful
[/run_scripts]
[/run_scripts]
LGTM! The addition of
setuptools
is necessary as it is used extensively across the codebase for package building and management.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if setuptools is used in the build process # Test: Search for setup.py or any setuptools usage in the package source rg --type python 'setuptools' $(fd -t f 'setup\.py')Length of output: 3641
Script:
#!/bin/bash # Description: Verify if 'setuptools' is explicitly required in the project # Search for 'setuptools' in setup.py, setup.cfg, pyproject.toml, and requirements files rg --type python 'import setuptools' . rg --type toml 'setuptools' pyproject.toml rg --type yaml 'setuptools' requirements*.yaml rg --type txt 'setuptools' requirements*.txt # Additionally, check for setuptools usage in any Python files rg --type python 'setuptools' .Length of output: 445
Script:
#!/bin/bash # Description: Verify if 'setuptools' is explicitly required in the project # Find Python files and search for 'setuptools' imports or usage fd -e py . | xargs rg 'import setuptools|from setuptools' # Additionally, search all files for 'setuptools' keyword in case it's used in non-Python files rg 'setuptools' .Length of output: 57483
recipes/k8/build.sh (6)
5-5
: LGTM: Proper LDFLAGS export.The addition of
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
is correct and ensures proper linking with libraries in the Conda prefix.
19-26
: LGTM, but clarification needed on thread counts.The addition of a case statement to set the THREADS variable based on architecture is a good optimization. However, the choice of
-j2
for x86_64 and-j3
for other architectures seems arbitrary.Could you provide a brief comment explaining the reasoning behind these specific thread counts? This would help with future maintenance and understanding of the build process.
40-40
: LGTM: Flexible thread count in make command.The use of
"${THREADS}"
in the make command is a good improvement. It allows for flexible thread counts based on the architecture, as defined earlier in the script.
47-47
: LGTM: Good cleanup practice.The addition of
rm -rf *.bak
is a good cleanup step. It ensures that backup files created during Makefile modifications are removed, keeping the build directory clean.
53-53
: LGTM: Proper permissions set for k8 binary.Setting the permissions of the k8 binary to 0755 with
chmod 0755 k8
is correct. This ensures that the binary has the appropriate read, write, and execute permissions for the owner, and read and execute permissions for others.
7-7
: Verify usage of DEFAULT_LINUX_VERSION variable.The
DEFAULT_LINUX_VERSION
variable appears to be unused in this script. If it's not used elsewhere in the build process or in external scripts, consider removing it to improve code clarity.To check for usage of this variable in other files:
✅ Verification successful
DEFAULT_LINUX_VERSION is unused and can be removed from
recipes/k8/build.sh
.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of DEFAULT_LINUX_VERSION in other files # Search for DEFAULT_LINUX_VERSION in all files rg --type-add 'recipe:*.{yaml,sh}' --type recipe 'DEFAULT_LINUX_VERSION'Length of output: 121
Script:
#!/bin/bash # Description: Comprehensive search for DEFAULT_LINUX_VERSION across all files # Search for DEFAULT_LINUX_VERSION in the entire repository rg 'DEFAULT_LINUX_VERSION'Length of output: 75
🧰 Tools
🪛 Shellcheck
[warning] 7-7: DEFAULT_LINUX_VERSION appears unused. Verify use (or export if used externally).
(SC2034)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will revisit this recipe sometime in the near future to address the bin/k8: cannot execute binary file
on osx
.
Describe your pull request here
Update k8/meta.yaml to allow python of 3.8 or later versions
Fixes #50888
Please read the guidelines for Bioconda recipes before opening a pull request (PR).
General instructions
@BiocondaBot please add label
command.@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:with
...
being one of:{{ pin_subpackage("myrecipe", max_pin="x") }}
{{ pin_subpackage("myrecipe", max_pin="x.x") }}
{{ pin_subpackage("myrecipe", max_pin="x.x") }}
(in such a case, please add a note that shortly mentions your evidence for that){{ pin_subpackage("myrecipe", max_pin="x.x.x") }}
(in such a case, please add a note that shortly mentions your evidence for that){{ pin_subpackage("myrecipe", max_pin=None) }}
while replacing
"myrecipe"
with eithername
if aname|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
@BiocondaBot please add label
please review & merge
label.@BiocondaBot please fetch artifacts
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>
.Summary by CodeRabbit
New Features
linux-aarch64
andosx-arm64
.Improvements
k8
package, reflecting updates and improvements.linux-aarch64
jobs to improve performance.