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] build error with dynamic-grammar-libs #255

Closed
afnanenayet opened this issue Dec 7, 2021 · 0 comments · Fixed by #254
Closed

[BUG] build error with dynamic-grammar-libs #255

afnanenayet opened this issue Dec 7, 2021 · 0 comments · Fixed by #254
Labels
bug Something isn't working

Comments

@afnanenayet
Copy link
Owner

Describe the bug
Build fails when compiling with dynamic grammars and not static grammars.

To Reproduce
Steps to reproduce the behavior:

cargo build --no-default-features --features dynamic-grammar-libs

Expected behavior
A clear and concise description of what you expected to happen.
diffsitter should build as normal.

Log output/screenshots
Please provide the output with the --debug flag

   Compiling libc v0.2.109
   Compiling proc-macro2 v1.0.33
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.82
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.0.1
   Compiling crossbeam-utils v0.8.5
   Compiling ppv-lite86 v0.2.15
   Compiling version_check v0.9.3
   Compiling lazy_static v1.4.0
   Compiling memchr v2.4.1
   Compiling crossbeam-epoch v0.9.5
   Compiling siphasher v0.3.7
   Compiling proc-macro-hack v0.5.19
   Compiling scopeguard v1.1.0
   Compiling proc-macro2 v0.4.30
   Compiling anyhow v1.0.51
   Compiling rayon-core v1.9.1
   Compiling regex-syntax v0.6.25
   Compiling log v0.4.14
   Compiling ucd-trie v0.1.3
   Compiling serde_derive v1.0.130
   Compiling unicode-xid v0.1.0
   Compiling serde v1.0.130
   Compiling unicode-width v0.1.9
   Compiling maplit v1.0.2
   Compiling syn v0.15.44
   Compiling unicode-segmentation v1.8.0
   Compiling ryu v1.0.6
   Compiling quick-error v1.2.3
   Compiling rustversion v1.0.6
   Compiling either v1.6.1
   Compiling vec_map v0.8.2
   Compiling ansi_term v0.12.1
   Compiling paw-raw v1.0.0
   Compiling serde_json v1.0.72
   Compiling cargo-emit v0.2.1
   Compiling strsim v0.8.0
   Compiling bitflags v1.3.2
   Compiling termcolor v1.1.2
   Compiling once_cell v1.8.0
   Compiling itoa v0.4.8
   Compiling strum v0.23.0
   Compiling memoffset v0.6.5
   Compiling rayon v1.5.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling phf_shared v0.10.0
   Compiling pest v2.1.3
   Compiling libloading v0.7.2
   Compiling textwrap v0.11.0
   Compiling humantime v1.3.0
   Compiling heck v0.3.3
   Compiling crossbeam-channel v0.5.1
   Compiling pest_meta v2.1.3
   Compiling aho-corasick v0.7.18
   Compiling atty v0.2.14
   Compiling dirs-sys v0.3.6
   Compiling terminal_size v0.1.17
   Compiling getrandom v0.2.3
   Compiling jobserver v0.1.24
   Compiling num_cpus v1.13.0
   Compiling quote v1.0.10
   Compiling quote v0.6.13
   Compiling clap v2.34.0
   Compiling dirs v3.0.2
   Compiling rand_core v0.6.3
   Compiling cc v1.0.72
   Compiling regex v1.5.4
   Compiling xdg v2.4.0
   Compiling rand_chacha v0.3.1
   Compiling crossbeam-deque v0.8.1
   Compiling env_logger v0.7.1
   Compiling console v0.15.0
   Compiling tree-sitter v0.20.1
   Compiling rand v0.8.4
   Compiling pretty_env_logger v0.4.0
   Compiling phf_generator v0.10.0
   Compiling pest_generator v2.1.3
   Compiling logging_timer_proc_macros v1.0.0
   Compiling logging_timer v1.0.0
   Compiling phf_macros v0.10.0
   Compiling thiserror-impl v1.0.30
   Compiling paw-attributes v1.0.2
   Compiling structopt-derive v0.4.18
   Compiling pest_derive v2.1.0
   Compiling strum_macros v0.23.1
   Compiling paw v1.0.0
   Compiling phf v0.10.0
   Compiling thiserror v1.0.30
   Compiling structopt v0.3.25
   Compiling diffsitter v0.6.7 (/build/diffsitter/src/diffsitter)
error[E0433]: failed to resolve: use of undeclared type `GrammarCompileInfo`
   --> build.rs:228:15
    |
228 |             ..GrammarCompileInfo::default()
    |               ^^^^^^^^^^^^^^^^^^ use of undeclared type `GrammarCompileInfo`

error[E0433]: failed to resolve: use of undeclared type `GrammarCompileInfo`
   --> build.rs:258:15
    |
258 |             ..GrammarCompileInfo::default()
    |               ^^^^^^^^^^^^^^^^^^ use of undeclared type `GrammarCompileInfo`

error[E0433]: failed to resolve: use of undeclared type `GrammarCompileInfo`
   --> build.rs:270:15
    |
270 |             ..GrammarCompileInfo::default()
    |               ^^^^^^^^^^^^^^^^^^ use of undeclared type `GrammarCompileInfo`

error[E0433]: failed to resolve: use of undeclared type `GrammarCompileInfo`
   --> build.rs:276:15
    |
276 |             ..GrammarCompileInfo::default()
    |               ^^^^^^^^^^^^^^^^^^ use of undeclared type `GrammarCompileInfo`

error[E0433]: failed to resolve: use of undeclared type `GrammarCompileInfo`
   --> build.rs:282:15
    |
282 |             ..GrammarCompileInfo::default()
    |               ^^^^^^^^^^^^^^^^^^ use of undeclared type `GrammarCompileInfo`

error[E0433]: failed to resolve: use of undeclared type `GrammarCompileInfo`
   --> build.rs:294:15
    |
294 |             ..GrammarCompileInfo::default()
    |               ^^^^^^^^^^^^^^^^^^ use of undeclared type `GrammarCompileInfo`

error[E0412]: cannot find type `GrammarCompileInfo` in this scope
   --> build.rs:222:22
    |
222 | fn grammars() -> Vec<GrammarCompileInfo<'static>> {
    |                      ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:224:9
    |
224 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:226:19
    |
226 |             path: PathBuf::from("grammars/tree-sitter-rust"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:230:9
    |
230 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:232:19
    |
232 |             path: PathBuf::from("grammars/tree-sitter-cpp"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:236:9
    |
236 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:238:19
    |
238 |             path: PathBuf::from("grammars/tree-sitter-python"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:242:9
    |
242 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:244:19
    |
244 |             path: PathBuf::from("grammars/tree-sitter-bash"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:248:9
    |
248 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:250:19
    |
250 |             path: PathBuf::from("grammars/tree-sitter-ocaml/ocaml"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:254:9
    |
254 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:256:19
    |
256 |             path: PathBuf::from("grammars/tree-sitter-go"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:260:9
    |
260 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:262:19
    |
262 |             path: PathBuf::from("grammars/tree-sitter-ruby"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:266:9
    |
266 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:268:19
    |
268 |             path: PathBuf::from("grammars/tree-sitter-java"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:272:9
    |
272 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:274:19
    |
274 |             path: PathBuf::from("grammars/tree-sitter-c-sharp"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:278:9
    |
278 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:280:19
    |
280 |             path: PathBuf::from("grammars/tree-sitter-css"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:284:9
    |
284 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:286:19
    |
286 |             path: PathBuf::from("grammars/tree-sitter-php"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:290:9
    |
290 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:292:19
    |
292 |             path: PathBuf::from("grammars/tree-sitter-json"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:296:9
    |
296 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:298:19
    |
298 |             path: PathBuf::from("grammars/tree-sitter-hcl"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:302:9
    |
302 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:304:19
    |
304 |             path: PathBuf::from("grammars/tree-sitter-typescript/typescript"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

error[E0422]: cannot find struct, variant or union type `GrammarCompileInfo` in this scope
   --> build.rs:308:9
    |
308 |         GrammarCompileInfo {
    |         ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `PathBuf`
   --> build.rs:310:19
    |
310 |             path: PathBuf::from("grammars/tree-sitter-typescript/tsx"),
    |                   ^^^^^^^ not found in this scope
    |
help: consider importing this struct
    |
22  | use std::path::PathBuf;
    |

Some errors have detailed explanations: E0412, E0422, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `diffsitter` due to 37 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
�[1m�[31m==> ERROR:�(B�[m�[1m A failure occurred in build().�(B�[m
�[1m    Aborting...�(B�[m

Platform:
MacOS, Linux

Additional context
Filing behalf of @lmartinez-mirror from this comment: #167 (comment)

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

Successfully merging a pull request may close this issue.

1 participant