-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
NEW: Add cf-nvidia-tools #28794
base: main
Are you sure you want to change the base?
NEW: Add cf-nvidia-tools #28794
Conversation
Hi! This is the staged-recipes linter and your PR looks excellent! 🚀 |
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/cf-nvidia-tools/recipe.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/12794723558. Examine the logs at this URL for more detail. |
@conda-forge/cuda, please review |
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.
Thanks Daniel! 🙏
Really appreciate you putting the time into creating this testing resource. This will be very helpful when testing packages and catching any missed changes.
Had a few questions below
recipes/cf-nvidia-tools/recipe.yaml
Outdated
tests: | ||
- script: | ||
- export c_stdlib_version="2.17.0" | ||
- check-glibc ${CONDA_PREFIX}/lib/*.so.* |
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.
- check-glibc ${CONDA_PREFIX}/lib/*.so.* | |
- check-glibc "${CONDA_PREFIX}/lib/*.so.*" |
Also would it make sense to have a default search argument or would we rather be explicit like in this test
Lastly should we add a library test dependency to ensure there is one library we can check?
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.
I don't want to provide a default argument because in production, we don't want to test all of the binaries in PREFIX, just the NVIDIA redists. There is no glob that I can think of that satisfies this condition.
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.
No double quotes because we want the terminal to expand the glob expression not pass a literal glob expression.
description: > | ||
This package contains CLI tools for validating and linting NVIDIA's conda recipes on | ||
conda-forge. For a description of the tools see the README in the package feedstock. The | ||
tools are hosted directly in the feedstock; there is no external source code repository | ||
for these tools at this time. |
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.
Do we want this to be one long string or do want to have it wrapped a certain way?
FWIW find this website to be a useful resource when playing with YAML string formatting: https://yaml-multiline.info
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.
I want one long string. anaconda.org handles the wrapping of long lines.
@conda-forge/staged-recipes, please review |
To help direct your pull request to the best reviewers, please mention a topic-specifc team if your recipe matches any of the following: conda-forge/help-c-cpp, conda-forge/help-cdts, conda-forge/help-go, conda-forge/help-java, conda-forge/help-julia, conda-forge/help-nodejs, conda-forge/help-perl, conda-forge/help-python, conda-forge/help-python-c, conda-forge/help-r, conda-forge/help-ruby,or conda-forge/help-rust. Thanks! |
) | ||
if [[ "${first}" == "${second}" ]] ; then | ||
echo "true" | ||
return 0 |
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.
Is the return value of 1 or 0 ever used ? I found that when this file was used in cudnn feedstock, and when it returned 1 (incompatible), it would exit build.sh right away due to "set -e" in build.sh, without printing the message "The binary is not compatible with the recipe's glibc pinning". This does not happen here in this feedstock as it does not have "set -e" though.
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.
This is a good point! You're saying that return causes the entire script to abort instead of just moving up one level. I will refactor to use the strings only.
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.
I've stripped unused parts of the API and added a test to ensure that the script exits 1 when appropriate.
for file in "$@"; do | ||
if [[ -f "$file" && ! -L "$file" ]]; then # Ensure it's a file and not a link | ||
BINARY_GLIBC_VERSION="$(glibc-detect req "$file")" | ||
echo "binary glibc ${BINARY_GLIBC_VERSION} <= recipe glibc ${RECIPE_GLIBC_VERSION} <= system glibc ${SYSTEM_GLIBC_VERSION} $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.
Maybe I am missing something - is the 2nd half of the check i.e. "recipe glibc ${RECIPE_GLIBC_VERSION} <= system glibc ${SYSTEM_GLIBC_VERSION}" being run ? The next line, glibc-check compatible "$BINARY_GLIBC_VERSION" "$RECIPE_GLIBC_VERSION", compares binary glibc and recipe glibc only I think.
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.
I think you are correct. We don't check if the system glibc version is >= the recipe version. This was important for debugging when developing this tool, but it doesn't actually affect the correctness of the recipe.
It is perfectly valid to build a package that requires glibc 5 on a system that only has glibc 2. It's just that you won't be able to run or install the binaries you have built because the package will require __glibc >= 5.
In summary, printing the system glibc version is printed for informational purposes and may help with debugging if tests which try to load the libraries fail during the test phase.
I could add a check and echo a warning message if system glibc is < recipe glibc, but definitely not raise an error.
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.
Thanks for clarifying! Yeah I think it's better to give a warning if system glibc is < recipe glibc, or at least simply print SYSTEM_GLIBC_VERSION value on a separate line as dry information - right now it may give impression to the user that system glibc is being checked against recipe glibc version
## 1. detecting the glibc version | ||
"detect" ) | ||
glibc-detect "${@}" | ||
;; | ||
## 2. checking a pair of glibc versions for compatibility | ||
"check" ) | ||
glibc-check "${@}" | ||
;; |
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.
I don't believe these two modes are used. Are they for future extension ?
for file in "$@"; do | ||
if [[ -f "$file" && ! -L "$file" ]]; then # Ensure it's a file and not a link | ||
BINARY_GLIBC_VERSION="$(glibc-detect req "$file")" | ||
echo "binary glibc ${BINARY_GLIBC_VERSION} <= recipe glibc ${RECIPE_GLIBC_VERSION} <= system glibc ${SYSTEM_GLIBC_VERSION} $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.
Thanks for clarifying! Yeah I think it's better to give a warning if system glibc is < recipe glibc, or at least simply print SYSTEM_GLIBC_VERSION value on a separate line as dry information - right now it may give impression to the user that system glibc is being checked against recipe glibc version
Checklist
url
) rather than a repo (e.g.git_url
) is used in your recipe (see here for more details).