Skip to content

Replace deprecated function on build.zig#4618

Merged
clason merged 2 commits intotree-sitter:masterfrom
nvlled:update-build-zig
Jul 16, 2025
Merged

Replace deprecated function on build.zig#4618
clason merged 2 commits intotree-sitter:masterfrom
nvlled:update-build-zig

Conversation

@nvlled
Copy link
Contributor

@nvlled nvlled commented Jul 15, 2025

The deprecated function addStaticLibrary() has been removed entirely so it no longer builds on recent dev versions of zig.

Also the build.zig weirdly uses two-space indentation, but I didn't format the whole file to avoid cluttering the diff.

The deprecated function addStaticLibrary() has been entirely
removed so it no longer builds on recent dev versions of zig.
@clason
Copy link
Contributor

clason commented Jul 15, 2025

Deprecated in which version? We target releases (14.1 currently), not HEAD.

@nvlled
Copy link
Contributor Author

nvlled commented Jul 16, 2025

Deprecated in which version? We target releases (14.1 currently), not HEAD.

It is deprecated in 0.14.1, see https://ziglang.org/documentation/0.14.1/std/#std.Build. It would be nice to update this sooner, at least I could avoid having too many personal forks just to fix the build errors.

@nvlled nvlled marked this pull request as draft July 16, 2025 02:21
@nvlled nvlled marked this pull request as ready for review July 16, 2025 04:46
@clason clason merged commit 618b9dd into tree-sitter:master Jul 16, 2025
12 checks passed
@clason clason added the ci:backport release-0.25 Backport label label Jul 16, 2025
@tree-sitter-ci-bot
Copy link

Successfully created backport PR for release-0.25:

@clason
Copy link
Contributor

clason commented Jul 16, 2025

@nvlled thank you. Can you please make the same changes to the file in crates/cli/src/templates/?

@nvlled
Copy link
Contributor Author

nvlled commented Jul 16, 2025

@clason okay

@clason
Copy link
Contributor

clason commented Jul 16, 2025

(best to wait for the zig fmt PR to be merged, though)

@clason
Copy link
Contributor

clason commented Jul 20, 2025

@nvlled Turns out that the template file is already formatted so no need to wait to make that change.

@nvlled
Copy link
Contributor Author

nvlled commented Jul 21, 2025

Hmm, the template files actually has a lot of problems, aside from using the deprecated build functions. I'll include those fixes in the pull request as well.

@clason
Copy link
Contributor

clason commented Jul 21, 2025

Why am I not surprised ;)

@nvlled
Copy link
Contributor Author

nvlled commented Jul 24, 2025

@clason The current zig templates files were the same tree-sitter-c files (they were added at the same time), so I opened a pull request for the tree-sitter-c as well. Ideally, zig-tree-sitter should be updated as well, but @amaanq is not active or is not accepting any pull request at the moment.

#4637
tree-sitter/tree-sitter-c#275

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants