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

Document how to build from source with full debuginfo #1750

Open
lrowe opened this issue Mar 26, 2025 · 2 comments
Open

Document how to build from source with full debuginfo #1750

lrowe opened this issue Mar 26, 2025 · 2 comments

Comments

@lrowe
Copy link
Contributor

lrowe commented Mar 26, 2025

The debug build includes only partial debuginfo to save space but this makes gdb info args and info locals error with No symbol table info available.

There is probably a better way of doing this using $GN_ARGS but I am not familiar with GN and was not able to make it work so took the following approach.

  • Clone rusty_v8 and comment out three lines in .gn.
  # Minimize size of debuginfo in distributed static library.
  #line_tables_only = true
  #no_inline_line_tables = true
  #symbol_level = 1
  use_debug_fission = false. # Always want this one
  • Build librusty_v8.a with V8_FROM_SOURCE=1 cargo build -vv.

  • Build own project with RUSTY_V8_ARCHIVE=/path/to/rusty_v8/target/debug/gn_out/obj/librusty_v8.a V8_FORCE_DEBUG=1 cargo build

The static lib with full debuginfo is 3.6GB so it wouldn't make sense to change the default here, but it would be great if it could be made a one liner.

@devsnek
Copy link
Member

devsnek commented Mar 26, 2025

passing V8_FROM_SOURCE=1 GN_ARGS="line_tables_only=false no_inline_line_tables=false symbol_level=2 use_debug_fission=false" should work i think.

@lrowe
Copy link
Contributor Author

lrowe commented Mar 26, 2025

Thanks! That works but it is necessary to remove the target directory for the change to show up. You can see this by running the following which seems to show that target/debug/gn_out/args.gn is not invalidated when the env var changes.

$ V8_FROM_SOURCE=1 PRINT_GN_ARGS=1 GN_ARGS="line_tables_only=false no_inline_line_tables=false symbol_level=2" cargo build -vv
...
[v8 135.1.0] symbol_level
[v8 135.1.0]     Current value = 2
[v8 135.1.0]       From //target/debug/gn_out/args.gn:8
[v8 135.1.0]     Overridden from the default = -1
[v8 135.1.0]       From //build/config/compiler/compiler.gni:56
...
$ V8_FROM_SOURCE=1 PRINT_GN_ARGS=1 GN_ARGS="line_tables_only=false no_inline_line_tables=false symbol_level=1" cargo build -vv
...
[v8 135.1.0] symbol_level
[v8 135.1.0]     Current value = 2
[v8 135.1.0]       From //target/debug/gn_out/args.gn:8
[v8 135.1.0]     Overridden from the default = -1
[v8 135.1.0]       From //build/config/compiler/compiler.gni:56
...
$ rm -rf target
$ V8_FROM_SOURCE=1 PRINT_GN_ARGS=1 GN_ARGS="line_tables_only=false no_inline_line_tables=false symbol_level=1" cargo build -vv
[v8 135.1.0] v8_symbol_level
[v8 135.1.0]     Current value (from the default) = 1
[v8 135.1.0]       From //v8/gni/v8.gni:68

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

No branches or pull requests

2 participants