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

tree-sitter-sql: fix source hash #332824

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamesreprise
Copy link
Contributor

@jamesreprise jamesreprise commented Aug 6, 2024

Description of changes

Patched tree-sitter-sql hash, which is incorrect as it stands.

nurl https://github.com/derekstride/tree-sitter-sql b8175006d9c8120d41cf40a4ef3711bbbbc08973
$ nix flake prefetch --extra-experimental-features 'nix-command flakes' --json github:derekstride/tree-sitter-sql/b8175006d9c8120d41cf40a4ef3711bbbbc08973
fetchFromGitHub {
  owner = "derekstride";
  repo = "tree-sitter-sql";
  rev = "b8175006d9c8120d41cf40a4ef3711bbbbc08973";
  hash = "sha256-ZURUEd7TokBIVVejRoBiXMQ1XwUEgMnzOhQiV+Tdpk0=";
}

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

@jamesreprise jamesreprise changed the title Patch hash on nvim-treesitter tree-sitter-sql tree-sitter-sql: fix source hash Aug 6, 2024
@Aleksanaa
Copy link
Member

@ofborg build tree-sitter-grammars.tree-sitter-sql

@mrene
Copy link
Contributor

mrene commented Aug 11, 2024

Well that's fun, there must be some casing differences in some filenames so the hash ends up different on mac and linux :(

NixOS:

❯ nurl https://github.com/derekstride/tree-sitter-sql b8175006d9c8120d41cf40a4ef3711bbbbc08973

$ nix flake prefetch --extra-experimental-features 'nix-command flakes' --json github:derekstride/tree-sitter-sql/b8175006d9c8120d41cf40a4ef3711bbbbc08973
fetchFromGitHub {
  owner = "derekstride";
  repo = "tree-sitter-sql";
  rev = "b8175006d9c8120d41cf40a4ef3711bbbbc08973";
  hash = "sha256-idQB8Wqw7lvU192y7+UgFvcwlmY71/mu9jJ4hRc4ud4=";
}

macOS:

❯ nurl https://github.com/derekstride/tree-sitter-sql b8175006d9c8120d41cf40a4ef3711bbbbc08973

$ nix flake prefetch --extra-experimental-features 'nix-command flakes' --json github:derekstride/tree-sitter-sql/b8175006d9c8120d41cf40a4ef3711bbbbc08973
fetchFromGitHub {
  owner = "derekstride";
  repo = "tree-sitter-sql";
  rev = "b8175006d9c8120d41cf40a4ef3711bbbbc08973";
  hash = "sha256-ZURUEd7TokBIVVejRoBiXMQ1XwUEgMnzOhQiV+Tdpk0=";
}

Edit: Oh treesitter grammars are all redefined inside nvim-treesitter and don't use the same derivations as tree-sitter-grammars.

@mrene
Copy link
Contributor

mrene commented Aug 11, 2024

@ofborg build vimPlugins.nvim-treesitter.grammarPlugins.sql

@vtuan10 vtuan10 mentioned this pull request Aug 11, 2024
13 tasks
@GaetanLepage GaetanLepage requested a review from teto August 11, 2024 19:53
@GaetanLepage
Copy link
Contributor

Result of nixpkgs-review pr 332824 run on x86_64-linux 1

1 package failed to build:
  • vimPlugins.nvim-treesitter-parsers.sql
1 package built:
  • vimPluginsUpdater

@tymscar
Copy link
Contributor

tymscar commented Aug 13, 2024

Here is the current error I'm getting on mac, it looks to me as if this hash is indeed different on macOS:

error: hash mismatch in fixed-output derivation '/nix/store/yaaf6yx9d3z5ym19j2pf9zkrizhirvqr-source.drv':
         specified: sha256-idQB8Wqw7lvU192y7+UgFvcwlmY71/mu9jJ4hRc4ud4=
            got:    sha256-ZURUEd7TokBIVVejRoBiXMQ1XwUEgMnzOhQiV+Tdpk0=
error: 1 dependencies of derivation '/nix/store/gkj82kn7lv4npd2y312dxf47q6l07mb7-sql-grammar-0.0.0+rev=b817500.drv' failed to build

@MattSturgeon
Copy link
Contributor

Here is the current error I'm getting on mac, it looks to me as if this hash is indeed different on macOS:

How is the hash obtained? Is there a wrapper script that could have a platform-specific bug?

I assume the archive itself is identical on both platforms, since it is fetched from github using the same repo & revision. If so, either the hashing process or the download/copying process must have a platform-specific bug 🤔

I guess any bug here would likely be in the nix binary itself though, so I'd expect it to affect more packages. Maybe I'm barking up the wrong tree...

@teto teto removed their request for review August 14, 2024 14:55
@jamesreprise
Copy link
Contributor Author

jamesreprise commented Aug 15, 2024

Converting this to a draft as from the discussion it seems this wouldn't work if merged.

@jamesreprise jamesreprise marked this pull request as draft August 15, 2024 08:37
@jakemassoth
Copy link

perhaps something upstream got fixed as I just update my flake this morning and now I am not having this issue on macos anymore.

@tymscar
Copy link
Contributor

tymscar commented Aug 16, 2024

Can confirm, it builds fine on macOS now!

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.

7 participants