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

Include generated source files in the git repo #315

Closed
wants to merge 1 commit into from

Conversation

tclem
Copy link

@tclem tclem commented Sep 9, 2023

👋🏻 @alex-pinkus. Thanks for this amazing grammar!

This PR includes required source files in the git repo to allow the tree-sitter-swift rust crate to be consumed by other projects. I know these .c files are huge, but this is the canonical way to make distribution work. See https://github.com/tree-sitter/tree-sitter-rust/tree/master/src as an example. The other grammars in the tree-sitter org are structured this way as well.

@alex-pinkus
Copy link
Owner

Thanks for opening this!

The topic of generated files has been discussed several times in this repo already, most thoroughly in #149. Checking in generated files may be the current behavior but it's definitely not the desired direction expressed by the tree-sitter org; one of the prerequisites for 1.0 has long been to "remove generated files from version control."

Ideally, most tools should be flexible enough to generate these files when they do not already exist; this also helps with the problem of supply chain security by ensuring that the parser.c always matches the relevant source code. For tools that need generated files to be vended from git, we came up with a compromise; this repository contains a with-generated-files branch that matches any releases made on main branch, but includes the generated files. If there are use cases that don't work with either of those options, we can discuss those, but it seems better-aligned with the long-term direction of tree-sitter to actually fix those tools.

@tclem
Copy link
Author

tclem commented Sep 10, 2023

Makes sense, sorry for rehashing an old issue, I didn't read far enough in the readme 🤦🏻 . I see that the publish crate has everything it needs as well.

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

Successfully merging this pull request may close these issues.

2 participants