Skip to content

Commit

Permalink
Fix publishing for calyx-lsp (#1948)
Browse files Browse the repository at this point in the history
* explicitly include tree-sitter files in Cargo.toml for calyx-lsp

* please the clippy gods
  • Loading branch information
sgpthomas committed Mar 4, 2024
1 parent 4bc3007 commit 138df88
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 37 deletions.
11 changes: 9 additions & 2 deletions calyx-lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ repository.workspace = true
homepage.workspace = true
categories.workspace = true

include = [
"build.rs",
"src/*",
"tree-sitter-calyx/grammar.js",
"tree-sitter-calyx/queries/*",
"tree-sitter-calyx/src/*",
]

[features]
diagnostics = []
log = []
Expand All @@ -35,5 +43,4 @@ version = "1"
features = ["io-util", "io-std", "macros", "rt-multi-thread", "net"]

[build-dependencies]
cc = "1.0"

cc = "1.0"
20 changes: 11 additions & 9 deletions calyx-lsp/build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
fn main() {
let language = "calyx";
let package = format!("tree-sitter-{}", language);
let source_directory = format!("{}/src", package);
let source_file = format!("{}/parser.c", source_directory);
let src_dir = std::path::Path::new("tree-sitter-calyx/src");

println!("cargo:rerun-if-changed={}", source_file);
let mut c_config = cc::Build::new();
c_config.include(src_dir);
c_config
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
let parser_path = src_dir.join("parser.c");
c_config.file(&parser_path);

cc::Build::new()
.file(source_file)
.include(source_directory)
.compile(&package);
c_config.compile("parser");
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
}
26 changes: 0 additions & 26 deletions calyx-lsp/tree-sitter-calyx/Cargo.toml

This file was deleted.

0 comments on commit 138df88

Please sign in to comment.