Loading pkgs/development/python-modules/tree-sitter/default.nix +8 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,11 @@ buildPythonPackage rec { fetchSubmodules = true; }; # see https://github.com/tree-sitter/py-tree-sitter/issues/330#issuecomment-2629403946 patches = lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ ./segfault-patch.diff ]; build-system = [ setuptools ]; nativeCheckInputs = [ Loading @@ -51,14 +56,11 @@ buildPythonPackage rec { "test_dot_graphs" ]; # Segfaults explosively for some reason, but dependents seem to work? doCheck = !stdenv.hostPlatform.isAarch64; meta = with lib; { meta = { description = "Python bindings to the Tree-sitter parsing library"; homepage = "https://github.com/tree-sitter/py-tree-sitter"; changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/${src.tag}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; license = lib.licenses.mit; maintainers = with lib.maintainers; [ fab ]; }; } pkgs/development/python-modules/tree-sitter/segfault-patch.diff 0 → 100644 +13 −0 Original line number Diff line number Diff line --- i/tree_sitter/core/lib/src/parser.c +++ w/tree_sitter/core/lib/src/parser.c @@ -2084,6 +2084,10 @@ void ts_parser_reset(TSParser *self) { self->parse_state = (TSParseState) {0}; } +// FIXME: see tree-sitter/py-tree-sitter#330 +#if __GNUC__ >= 14 && defined(__aarch64__) && defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__) +__attribute__((optimize(2))) +#endif TSTree *ts_parser_parse( TSParser *self, const TSTree *old_tree, Loading
pkgs/development/python-modules/tree-sitter/default.nix +8 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,11 @@ buildPythonPackage rec { fetchSubmodules = true; }; # see https://github.com/tree-sitter/py-tree-sitter/issues/330#issuecomment-2629403946 patches = lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ ./segfault-patch.diff ]; build-system = [ setuptools ]; nativeCheckInputs = [ Loading @@ -51,14 +56,11 @@ buildPythonPackage rec { "test_dot_graphs" ]; # Segfaults explosively for some reason, but dependents seem to work? doCheck = !stdenv.hostPlatform.isAarch64; meta = with lib; { meta = { description = "Python bindings to the Tree-sitter parsing library"; homepage = "https://github.com/tree-sitter/py-tree-sitter"; changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/${src.tag}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; license = lib.licenses.mit; maintainers = with lib.maintainers; [ fab ]; }; }
pkgs/development/python-modules/tree-sitter/segfault-patch.diff 0 → 100644 +13 −0 Original line number Diff line number Diff line --- i/tree_sitter/core/lib/src/parser.c +++ w/tree_sitter/core/lib/src/parser.c @@ -2084,6 +2084,10 @@ void ts_parser_reset(TSParser *self) { self->parse_state = (TSParseState) {0}; } +// FIXME: see tree-sitter/py-tree-sitter#330 +#if __GNUC__ >= 14 && defined(__aarch64__) && defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__) +__attribute__((optimize(2))) +#endif TSTree *ts_parser_parse( TSParser *self, const TSTree *old_tree,