Skip to content
Merged
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local_path_override(

# see https://registry.bazel.build/ for a list of available packages

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
Expand All @@ -28,7 +28,7 @@ bazel_dep(name = "rules_kotlin", version = "2.0.0-codeql.1")
bazel_dep(name = "gazelle", version = "0.40.0")
bazel_dep(name = "rules_dotnet", version = "0.17.4")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "rules_rust", version = "0.52.2")
bazel_dep(name = "rules_rust", version = "0.57.1")
bazel_dep(name = "zstd", version = "1.5.5.bcr.1")

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
Expand Down
2 changes: 1 addition & 1 deletion python/extractor/tsg-python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ codeql_rust_binary(
name = "tsg-python",
srcs = ["src/main.rs"],
aliases = aliases(),
data = ["python.tsg"],
compile_data = ["python.tsg"],
proc_macro_deps = all_crate_deps(
proc_macro = True,
),
Expand Down
10 changes: 2 additions & 8 deletions rust/ast-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ fn write_schema(
.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.

"/src/templates/schema.mustache"
)))?;
let template = mustache::compile_str(include_str!("templates/schema.mustache"))?;
let res = template.render_to_string(&schema)?;
Ok(fix_blank_lines(&res))
}
Expand Down Expand Up @@ -558,10 +555,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

let template = mustache::compile_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/src/templates/extractor.mustache"
)))?;
let template = mustache::compile_str(include_str!("templates/extractor.mustache"))?;
let res = template.render_to_string(&extractor_info)?;
Ok(fix_blank_lines(&res))
}
Expand Down