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

fix(rust): access CARGO_MANIFEST_DIR at runtime in build script #3352

Merged
merged 2 commits into from May 13, 2024

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented May 8, 2024

The CARGO_MANIFEST_DIR environment variable should be accessed by build.rs at run time rather than compile time. This was for example causing issues when importing tree-sitter via rules_rust in bazel, where compilation and running happen in separate environments.

Closes #3353

The `CARGO_MANIFEST_DIR` environment variable should be accessed by
`build.rs` at run time rather than compile time. This was for example
causing issues when importing `tree-sitter` via
[`rules_rust`](https://github.com/bazelbuild/rules_rust) in bazel,
where compilation and running happen in separate environments.
Copy link
Contributor

@dcreager dcreager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me, too, but I haven't touched this part of the code in awhile. @maxbrunsfeld and/or @amaanq does this look 👍 to you?

@amaanq
Copy link
Member

amaanq commented May 13, 2024

yeah this is great! thanks for the reminder @dcreager

@amaanq amaanq merged commit d35e401 into tree-sitter:master May 13, 2024
12 checks passed
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.

Rust bindings build script accesses CARGO_MANIFEST_DIR at compile time instead of run time
4 participants