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

python312Packages.llama-cpp-python: fix linux build #377484

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

booxter
Copy link
Contributor

@booxter booxter commented Jan 28, 2025

Their cmake files were attempting to build with -mcpu=native+no<...>
which fails for gcc. Actually, we should never build for native anyway
(which is the raison d'etre for NIX_ENFORCE_NO_NATIVE).

Thankfully, the package provides a variable to disable native
optimizations.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@booxter booxter requested a review from GaetanLepage January 28, 2025 04:41
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 28, 2025
@nix-owners nix-owners bot requested a review from kirillrdy January 28, 2025 04:49
@booxter
Copy link
Contributor Author

booxter commented Jan 28, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 377484


aarch64-linux

✅ 8 packages built:
  • python312Packages.llama-cpp-python
  • python312Packages.llama-cpp-python.dist
  • python312Packages.llm-gguf
  • python312Packages.llm-gguf.dist
  • python313Packages.llama-cpp-python
  • python313Packages.llama-cpp-python.dist
  • python313Packages.llm-gguf
  • python313Packages.llm-gguf.dist

x86_64-darwin


aarch64-darwin

Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

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

Diff LGTM

@GaetanLepage
Copy link
Contributor

Thank you !
Can you please include a comment above the added line to give some context ?

Their cmake files were attempting to build with -mcpu=native+no<...>
which fails for gcc. Actually, we should never build for native anyway
(which is the raison d'etre for NIX_ENFORCE_NO_NATIVE).

Thankfully, the package provides a variable to disable native
optimizations.
@booxter booxter force-pushed the llama-cpp-python-linux-fix branch from e4d317b to 158aa70 Compare January 29, 2025 04:37
@booxter booxter force-pushed the llama-cpp-python-linux-fix branch from 158aa70 to 7494270 Compare January 29, 2025 04:37
@booxter
Copy link
Contributor Author

booxter commented Jan 29, 2025

@kirillrdy I took the liberty and added myself as maintainer. Let me know if there are any concerns with this.

@booxter booxter requested a review from kirillrdy January 29, 2025 04:38
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Jan 29, 2025
Copy link
Member

@kirillrdy kirillrdy left a comment

Choose a reason for hiding this comment

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

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 377484


aarch64-linux

✅ 8 packages built:
  • python312Packages.llama-cpp-python
  • python312Packages.llama-cpp-python.dist
  • python312Packages.llm-gguf
  • python312Packages.llm-gguf.dist
  • python313Packages.llama-cpp-python
  • python313Packages.llama-cpp-python.dist
  • python313Packages.llm-gguf
  • python313Packages.llm-gguf.dist

@booxter welcome !

@kirillrdy kirillrdy merged commit 8ad4c35 into NixOS:master Jan 29, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants