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

Add macOS/Darwin binaries #402

Open
nikolay opened this issue Oct 6, 2023 · 5 comments
Open

Add macOS/Darwin binaries #402

nikolay opened this issue Oct 6, 2023 · 5 comments

Comments

@nikolay
Copy link

nikolay commented Oct 6, 2023

No description provided.

@arichtman-srt
Copy link

Not entirely sure what's happened but since updating my pre-commit hooks it's failing

Seems like the derivation doesn't exist anymore for aarch64-darwin, but that's not the case since I can run it fine from nixpkgs.

alejandra (Nix)..........................................................Failed
- hook id: alejandra
- exit code: 1

+ command -v nix-build
/run/current-system/sw/bin/nix-build
+ '!command' -v nix-instantiate
/Users/arichtman/.cache/pre-commit/repocvhp2286/.pre-commit-entry.sh: line 10: !command: command not found
+ echo INFO: computing current system
INFO: computing current system
++ nix-instantiate --eval --expr builtins.currentSystem
+ system='"aarch64-darwin"'
+ echo INFO: building Alejandra
INFO: building Alejandra
+ nix-build --attr '"aarch64-darwin"' --out-link result-alejandra https://github.com/kamadorueda/alejandra/tarball/3.0.0
error: attribute 'aarch64-darwin' in selection path '"aarch64-darwin"' not found

@ahgraber
Copy link

ahgraber commented Apr 30, 2024

I'm running into this issue as ; 1.3.0 worked for me; neither 2.0.0 nor 3.0.0 do.

Edit: using alejandra-system worked for me; I guess it uses the system alejandra instead of creating a separate version for pre-commit?

  - repo: https://github.com/kamadorueda/alejandra
    rev: 3.0.0
    hooks:
      - id: alejandra-system
        files: \.nix$

@cooperpellaton
Copy link

I use a (very recent) commit that still has the binaries present:

repos:
  - repo: https://github.com/kamadorueda/alejandra
    rev: e53c2c6
    hooks:
      # Requires Nix to be previously installed in the system
      - id: alejandra-nix

@kamadorueda
Copy link
Owner

I'm curious to know if the issue is that we don't provide pre-compiled MacOS/Darwin binaries that people may want to download, chmod +x and execute, or if the issue is asking about the pre-commit failures related to the missing system attribute

For the options above:

  • The pre-commit failures were fixed in version 3.1.0
  • I can't provide pre-compiled MacOS binaries at the moment as I don't own a MacOS laptop myself nor do I own MacOS Buildkite runners

Please let me know if my understanding of the issue is accurate

@cooperpellaton
Copy link

Version 3.1.0 seems to have fixed the problem. Below works:

diff --git i/.pre-commit-config.yaml w/.pre-commit-config.yaml
index 182e228..5c0adf0 100644
--- i/.pre-commit-config.yaml
+++ w/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
 repos:
   - repo: https://github.com/kamadorueda/alejandra
-    rev: d7552fef2ccf1bbf0d36b27f6fddb19073f205b7
+    rev: 3.1.0
     hooks:
       # Requires Nix to be previously installed in the system
       - id: alejandra-nix

Re: building binaries: I'm happy to lend compute to do this. If you share a script or something similar I'll run it and share the results.

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

5 participants