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

bug: Using environment variables for conditional compilation breaks use as a Rust library #172

Open
2 tasks done
tv42 opened this issue Nov 8, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@tv42
Copy link

tv42 commented Nov 8, 2024

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

Using tree-sitter-md crate directly as a Rust library is pleasant and enables binaries that don't depend on global system state like installed helper binaries. That's promising and great.

However, enabling extensions via compile-time environment variables is just not viable; cargo build && EXTENSION_TAGS=1 cargo build does not magically trigger a rebuild of dependencies with the feature enabled.

How should I use the tree-sitter-md crate if I need to parse tags?

Steps To Reproduce/Bad Parse Tree

n/a

Expected Behavior/Parse Tree

n/a

Repro

No response

@tv42 tv42 added the bug Something isn't working label Nov 8, 2024
@tv42
Copy link
Author

tv42 commented Nov 8, 2024

I think it should be possible to define Cargo features for the crate, and then get build.rs to set env variables for the C compilation based on the enabled features.

@ObserverOfTime
Copy link
Member

Building with different extensions requires the Tree-sitter CLI and Node.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants