-
Notifications
You must be signed in to change notification settings - Fork 0
fix kolide #1475
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
fix kolide #1475
Changes from all commits
01b6e78
61dc68a
828822c
18bd141
3c1d7b2
c04096d
a65118c
112a56f
e745a5c
2ce2be6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,11 +59,38 @@ echo "$DEPS" | while read -r pkg; do | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$installed_version" ] && [ -n "$req_version" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if printf '%s\n%s\n' "$req_version" "$installed_version" | sort -V | head -n1 | grep -qx "$req_version"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$name $installed_version already installed, skipping" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Installing $pkg..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uv tool install "$pkg" --python "$PYTHON_VERSION" --force 2>/dev/null || echo "Failed to install $pkg, skipping..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Installing $pkg..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uv tool install "$pkg" --python "$PYTHON_VERSION" --force 2>/dev/null || echo "Failed to install $pkg, skipping..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Installing $pkg..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uv tool install "$pkg" --python "$PYTHON_VERSION" --force 2>/dev/null || echo "Failed to install $pkg, skipping..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Symlink each tool's python3 for per-tool access: `python3-<tool> -m <tool>` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tool_python="${HOME}/.local/share/uv/tools/${name}/bin/python3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -f "$tool_python" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ln -sf "$tool_python" "${HOME}/.local/bin/python3-${name}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+71
to
+75
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure the target directory
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Write a dispatcher so `python3 -m <tool>` uses that tool's isolated Python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cat > "${HOME}/.local/bin/python3" << 'EOF' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prev="" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for arg in "$@"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$prev" = "-m" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| per_tool="${HOME}/.local/bin/python3-${arg}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -x "$per_tool" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec "$per_tool" "$@" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prev="$arg" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec /etc/profiles/per-user/"${USER}"/bin/python3 "$@" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+78
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The dispatcher logic has two main issues:
A more robust approach is to check for
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x "${HOME}/.local/bin/python3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "uv globals installation complete" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| function _pixelh_function --description "Run Pi headlessly with the local Qwen model" | ||
| # Prompt for input and run Pi in print mode with the local Qwen model | ||
| # Usage: pixelh | ||
|
|
||
| set -l prompt | ||
| if test (count $argv) -gt 0 | ||
| set prompt (string join " " $argv) | ||
| else | ||
| read -P "Prompt: " prompt | ||
| end | ||
|
|
||
| if test -z "$prompt" | ||
| echo "No prompt provided, aborting." >&2 | ||
| return 1 | ||
| end | ||
|
|
||
| pi --model 'lmstudio/qwen3.5-0.8b-optiq' -p "$prompt" | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| result_path="${1:-./result}" | ||
|
|
||
| if [ ! -e "$result_path" ]; then | ||
| exit 1 | ||
| fi | ||
|
|
||
| case "$result_path" in | ||
| *.iso) | ||
| if [ -f "$result_path" ]; then | ||
| printf '%s\n' "$result_path" | ||
| exit 0 | ||
| fi | ||
| ;; | ||
| esac | ||
|
|
||
| resolved_path="" | ||
| if command -v readlink >/dev/null 2>&1; then | ||
| resolved_path="$(readlink -f "$result_path" 2>/dev/null || true)" | ||
| fi | ||
| if [ -z "$resolved_path" ] && command -v realpath >/dev/null 2>&1; then | ||
| resolved_path="$(realpath "$result_path" 2>/dev/null || true)" | ||
| fi | ||
|
|
||
| case "$resolved_path" in | ||
| *.iso) | ||
| if [ -f "$resolved_path" ]; then | ||
| printf '%s\n' "$resolved_path" | ||
| exit 0 | ||
| fi | ||
| ;; | ||
| esac | ||
|
|
||
| iso_path="$(find -L "$result_path" -type f -name '*.iso' | sort | head -n 1)" | ||
| if [ -n "$iso_path" ]; then | ||
| printf '%s\n' "$iso_path" | ||
| exit 0 | ||
| fi | ||
|
|
||
| exit 1 |
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.
The
helptarget parses$(MAKEFILE_LIST)(the files on disk) usingawk. Since the new host-specific targets (e.g.,build-matic) are generated dynamically usingeval(lines 656-657), they do not exist as literal lines in the Makefile and will not be captured by thisawkcommand. Consequently, they won't appear in themake helpoutput. If you want them to be discoverable, consider using pattern rules (e.g.,build-%:) instead ofeval, or manually adding a help entry.