tree_sitter_drop_emscripten_dep.toml

 1url = "https://github.com/tree-sitter/tree-sitter.git"
 2revision = "635c49909ce4aa7f58a9375374f91b1b434f6f9c"
 3language_extension = "rs"
 4
 5prompt = """
 6Change `compile_parser_to_wasm` to use `wasi-sdk` instead of emscripten.
 7Use `ureq` to download the SDK for the current platform and architecture.
 8Extract the archive into a sibling of `lib` inside the `tree-sitter` directory in the cache_dir.
 9Compile the parser to wasm using the `bin/clang` executable (or `bin/clang.exe` on windows)
10that's inside of the archive.
11Don't re-download the SDK if that executable already exists.
12
13Use these clang flags: -fPIC -shared -Os -Wl,--export=tree_sitter_{language_name}
14
15Here are the available wasi-sdk assets:
16- wasi-sdk-25.0-x86_64-macos.tar.gz
17- wasi-sdk-25.0-arm64-macos.tar.gz
18- wasi-sdk-25.0-x86_64-linux.tar.gz
19- wasi-sdk-25.0-arm64-linux.tar.gz
20- wasi-sdk-25.0-x86_64-linux.tar.gz
21- wasi-sdk-25.0-arm64-linux.tar.gz
22- wasi-sdk-25.0-x86_64-windows.tar.gz
23"""
24
25[diff_assertions]
26
27modify_function = """
28The patch modifies the `compile_parser_to_wasm` function, removing logic for running `emscripten`,
29and adding logic to download `wasi-sdk`.
30"""
31
32use_listed_assets = """
33The patch implements logic for selecting from the assets listed in the prompt by detecting the
34current platform and architecture.
35"""
36
37add_deps = """
38The patch adds a dependency for `ureq` to the Cargo.toml, and adds an import to the top of `loader/lib.rs`
39If the patch uses any other dependencies (such as `tar` or `flate2`), it also correctly adds them
40to the Cargo.toml and imports them.
41"""
42
43[thread_assertions]
44
45find_specified_function = """
46The agent finds the specified function `compile_parser_to_wasm` in a logical way.
47It does not begin by guessing any paths to files in the codebase, but rather searches for the function by name.
48"""
49
50no_syntax_errors = """
51As it edits the file, the agent never introduces syntax errors. It's ok if there are other compile errors,
52but it should not introduce glaring issues like mismatched curly braces.
53"""