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

Unbound variable when creating a venv #92

Closed
hentt30 opened this issue Jul 29, 2024 · 2 comments
Closed

Unbound variable when creating a venv #92

hentt30 opened this issue Jul 29, 2024 · 2 comments

Comments

@hentt30
Copy link

hentt30 commented Jul 29, 2024

For rules_uv >= 0.18.0, the create_venv.sh script fails with the error "bash site_packages_extra_files[@]: unbound variable" when site_packages_extra_files is not set. The root cause appears to be the -u option in set -u, which interprets ${site_packages_extra_files[@]} as unset.

How to reproduce:
docker run -it --entrypoint bash bash:3.2.57 -c 'set -euo pipefail; for file in "${site_packages_extra_files[@]}"; do echo "test"; done;'

Solution:
check whether the variable site_packages_extra_files exists before executing the for loop.

@mark-thm
Copy link
Contributor

mark-thm commented Aug 5, 2024

Fixed by 531938b

@mark-thm mark-thm closed this as completed Aug 5, 2024
@hentt30
Copy link
Author

hentt30 commented Aug 7, 2024

Thanks!

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

No branches or pull requests

2 participants