Skip to content

v0.1.65 — build-symbols hardening

Latest

Choose a tag to compare

@fiveapplesonthetable fiveapplesonthetable released this 17 May 15:10
· 83 commits to master since this release

v0.1.65 — build-symbols hardening (AOSP / Linux / Perfetto / self)

Major build-symbols fixes from running scry against AOSP, Linux
kernel, Perfetto, and scry itself end-to-end:

Soong bridge:

  • Cross-shard ninja variable expansion. javacFlags = ${m.<mod>_<variant>.javacFlags} indirection used to be
    captured as a literal string; now resolves to the actual flag
    list. Unblocks libcore's --patch-module=java.base=… and every
    AOSP module hiding flags behind a variable reference.
  • Forward Soong's javacFlags + kotlincFlags through to the
    compiler, with surgical filtering (drop -Werror /
    -source/-target/--release / -classpath / -bootclasspath /
    --system= / -d / -processorpath / -Xplugin: which we
    synthesize; keep --patch-module=, --add-modules=,
    --add-exports=, -Xmultiplatform, -Xexpect-actual-classes).
  • Path-list rewriting for --patch-module=NAME=p1:p2:… so
    libcore's :out/soong:abs/jar.jar resolves correctly when
    javac runs from any cwd. --system=none magic value passes
    through unchanged.
  • Shell-aware tokenization (shell_words::split). AOSP wraps the
    entire Error Prone configuration as one '…' shell-quoted arg;
    split_whitespace was leaking every -Xep:… flag and javac
    aborted compilation with "invalid flag". 11 modules unblocked.
  • srcjar extraction. Reads Soong's srcJars binding (AIDL
    aidl0.srcjar) + auto-discovers sibling kapt/kapt-sources.jar
    (Hilt / AutoValue / Dagger factory stubs) + extracts them via
    unzip into a per-compilation scratch dir, appending the .java
    files to the source argfile. Resolves IFooCallback, Hilt_X,
    AutoValue_X, Dagger factory references.
  • Sibling-output classpath augmentation. Auto-discovers
    busybox/R.jar (AAPT2 R class), aapt2/R.jar (alternative),
    turbine-apt/.jar, aconfig/.jar, merged_aconfig_files/*.jar
    and folds them into the rule's -classpath. Resolves R.string.x,
    com.android.wifi.flags.X, and other resource / flag references.
  • Variant fallback. New JvmRule trait + select_built_variant
    groups multi-variant rules by logical module name and keeps
    the one whose required .rsp files all exist on disk. Halves
    the kotlinc dispatch work on multi-variant modules and
    unblocks ~20 modules whose declared variant was unbuilt but
    whose apex sibling has full intermediates.

Kotlin plugin:

  • install_indexers.sh patches semanticdb-kotlinc in-place before
    sbt publishM2 to silence the FirFileSymbol stderr noise on
    Kotlin 2.x — the plugin already returned NONE for file-level
    symbols but printed first, making scry-bridge mis-classify
    every Kotlin compilation containing a top-level fun/val as
    "partial / no output".

Polyglot / general:

  • Sidecar carry-over: scry index's atomic dir swap no longer
    wipes scip_index.bin / clang_usrs.bin written independently
    by build-symbols.
  • PATH plumbing: subprocess inherits PATH with the indexer
    binary's parent dir prepended, so rust-analyzer can find
    cargo / scip-go can find go without the operator wiring it.
  • Stderr surfacing: surface the last 3 non-empty stderr lines
    of an indexer failure, not just the first banner.
  • Polyglot dispatch bails on indexer failure instead of
    silently shipping an incomplete sidecar.
  • resolve_indexer_binary: clean two-source resolution
    (SCRY_INDEXER_ env var → PATH). No hardcoded distro
    paths, no npm-prefix probing.
  • scry_tmp_dir everywhere — never writes to /tmp. Honours
    $SCRY_TMP_DIR; defaults to /mnt/agent/tmp.
  • GN over-spec: TUs whose source file doesn't exist on disk
    count as "skipped (missing source)" not "failed".

CLI:

  • scry build-symbols exposes every indexer override
    (--javac, --scip-java, --kotlinc, --semanticdb-{javac,kotlinc}-jar,
    --only-module, --max-compilations, --skip-{java,kotlin},
    --only-root, --max-targets) instead of silently passing None.

Docs:

  • BUILD_AWARE.md: indexer-binary configuration and scratch-dir
    sections.
  • DEVELOPMENT.md: "Open work" — frozen scope for the remaining
    items (coverage ceiling without a full m, partial-success
    classifier, kernel 634 parse failures, usr_for_window warm
    latency, scry-cli main.rs file split).

Verified end-to-end:

  • scry-on-scry: 6771 symbols / 74k records; cross-crate precision
    queries return correct callers across all 3 Default impls of
    resolve_indexer_binary.
  • perfetto: 235k USRs / 99M records, 0 real failures, 1349
    skipped (missing-source — GN over-spec).
  • AOSP (with srcjar fix): 1119 javac OK / 81 partial / 13
    no-output (was 1024 / 164 / 25 before).

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com