Skip to content

Generate JS sourcemaps with --debug#3381

Closed
verhovsky wants to merge 1 commit intotree-sitter:masterfrom
verhovsky:js-sourcemaps
Closed

Generate JS sourcemaps with --debug#3381
verhovsky wants to merge 1 commit intotree-sitter:masterfrom
verhovsky:js-sourcemaps

Conversation

@verhovsky
Copy link
Copy Markdown
Contributor

Follow up to #3380, works on #3379

mv target/scratch/tree-sitter.wasm ${WEB_DIR}/tree-sitter.wasm
if [[ $debug == 1 ]]; then
mv target/scratch/tree-sitter.wasm.map ${WEB_DIR}/tree-sitter.wasm.map
# TODO: copy the source files
Copy link
Copy Markdown
Contributor Author

@verhovsky verhovsky Jul 29, 2024

Choose a reason for hiding this comment

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

We can check which source files the source map needs using this command

jq -r '.sources[]' lib/binding_web/tree-sitter.wasm.map

With my compiler on M1 macOS, it expects these

../../lib/src/alloc.c
../../lib/src/get_changed_ranges.c
../../lib/src/length.h
../../lib/src/array.h
../../lib/src/subtree.h
../../lib/src/language.c
../../lib/src/wasm_store.c
../../lib/src/language.h
../../lib/src/lexer.c
../../lib/src/unicode.h
../../lib/src/node.c
../../lib/src/point.h
../../lib/src/subtree.c
../../lib/src/tree.c
../../lib/src/parser.c
../../lib/src/stack.c
../../lib/src/reusable_node.h
../../lib/src/clock.h
../../lib/src/atomic.h
../../lib/src/query.c
../../lib/src/tree_cursor.c
../../lib/src/reduce_action.h
../../lib/src/tree_cursor.h
../../lib/binding_web/binding.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/errno/__errno_location.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/__stdio_close.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/__stdio_seek.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/__stdio_write.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/exit/abort.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/emscripten_memcpy.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/memmove.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/memset.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/emscripten_time.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/__lockfile.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/fflush.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/__towrite.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/__overflow.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/fputc.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/putc.h
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/cache/sysroot/include/atomic_arch.h
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/internal/pthread_impl.h
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/fputs.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/fwrite.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/isprint.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswalnum.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswalpha.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswspace.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/pthread/library_pthread_stub.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/unistd/lseek.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/memcmp.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/ofl.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/emscripten_syscall_stubs.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/unistd/getpid.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/pthread/pthread_self_stub.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/snprintf.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/strlen.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/strncmp.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/memchr.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/strnlen.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/math/frexp.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/vfprintf.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/include/math.h
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/stdio/vsnprintf.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/wasi-helpers.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/wcschr.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/wcslen.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/multibyte/wcrtomb.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/multibyte/wctomb.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/emscripten_get_heap_size.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/sbrk.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/dlmalloc.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/lib/builtins/ashlti3.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/lib/builtins/lshrti3.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/lib/builtins/trunctfdf2.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/lib/builtins/fp_trunc.h
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/lib/builtins/fp_trunc_impl.inc
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/towctrans.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswdigit.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/stack_ops.S
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/stack_limits.S
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswlower.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/isblank.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswblank.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/strncat.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/emscripten_tempret.s
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswupper.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/stpncpy.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/strncpy.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/ctype/iswxdigit.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/libc/musl/src/string/strcmp.c
../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/emscripten_exception_builtins.c

I don't understand how we can ship an npm package with a file like ../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/compiler-rt/emscripten_exception_builtins.c, those ../ put the file outside the npm package's directory.

@verhovsky verhovsky marked this pull request as draft July 29, 2024 19:52
@tree-sitter tree-sitter deleted a comment Jul 30, 2024
@amaanq
Copy link
Copy Markdown
Member

amaanq commented Jan 7, 2025

Closing as stale (been almost a year)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants