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

Bazel: update rules_rust #18710

Merged
merged 11 commits into from
Feb 11, 2025
Merged

Bazel: update rules_rust #18710

merged 11 commits into from
Feb 11, 2025

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented Feb 7, 2025

There's a bug in rules_rust that required a workaround.

@Copilot Copilot bot review requested due to automatic review settings February 7, 2025 09:44
@redsun82 redsun82 requested a review from a team as a code owner February 7, 2025 09:44

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@redsun82 redsun82 requested a review from criemen February 7, 2025 09:44
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Feb 7, 2025
@redsun82 redsun82 requested a review from a team as a code owner February 7, 2025 13:43
@github-actions github-actions bot added the Python label Feb 7, 2025
tausbn
tausbn previously requested changes Feb 7, 2025
Copy link
Contributor

@tausbn tausbn left a comment

Choose a reason for hiding this comment

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

One comment, otherwise LGTM.

rust/ast-generator/src/main.rs Outdated Show resolved Hide resolved
@redsun82 redsun82 marked this pull request as draft February 10, 2025 14:20
@redsun82 redsun82 dismissed tausbn’s stale review February 11, 2025 08:18

Obsolete comment was removed

@redsun82 redsun82 marked this pull request as ready for review February 11, 2025 09:39
@redsun82
Copy link
Contributor Author

@criemen: ping 🙂

criemen
criemen previously approved these changes Feb 11, 2025
Copy link
Collaborator

@criemen criemen left a comment

Choose a reason for hiding this comment

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

LGTM! Annoying that we have to work around the upstream bug like this, but it works, so let's go ahead.

@@ -149,11 +149,7 @@ fn write_schema(
.iter()
.map(|node| node_src_to_schema_class(node, &super_types)),
);
// the concat dance is currently required by bazel
let template = mustache::compile_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is still not fixed :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean? The new code does not need to concat with the CARGO_MANIFEST_DIR env variable, so the new simpler code works both with cargo and with bazel.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That rules_rust sets the proper variables here in line with cargo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, yes, seems like something went astray there, as it was working before but stopped working at some point. So not something required in this instance, but there could be a problem elsewhere.

@@ -558,10 +554,7 @@ fn write_extractor(grammar: &AstSrc) -> mustache::Result<String> {
nodes: grammar.nodes.iter().map(node_to_extractor_info).collect(),
};
// the concat dance is currently required by bazel
Copy link
Contributor Author

Choose a reason for hiding this comment

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

agh, thought I had removed this comment

@redsun82 redsun82 requested a review from criemen February 11, 2025 11:07
@redsun82
Copy link
Contributor Author

@criemen mind reapproving?

@redsun82 redsun82 merged commit 4a9be40 into main Feb 11, 2025
31 checks passed
@redsun82 redsun82 deleted the redsun82/rules_rust-update branch February 11, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants