1
0
Fork 0
mirror of https://github.com/imjasonh/slight synced 2026-07-07 00:33:20 +00:00
slight/plan.md
Jason Hall c05ad6808d debloating works, incl test-only deps
Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-01-13 13:28:14 -05:00

1.5 KiB

Next Steps

  • in addition to running 'go build' on the debloated codebase, we also need to 'go test'

    • this ensures we didn't delete dependency code that tests rely on, that main code doesn't
  • add --verbose flag to show more detailed output during analysis and debloating

    • use this during tests
    • maybe output to a file if it's very noisy
  • when debloating, add a report about what was deleted, and how much was kept

    • e.g. "original vendor size: 50MB, debloated size: 12MB, 76% reduction"
    • try to determine the change in binary size as well (if possible)
      • go compiler's tree-shaking should remove unused symbols, so it shouldn't have any effect, but worth measuring
    • try to determine the change in dependency test coverage as well (if possible)

    Known Limitations

  • Build tags: Files with build tags are completely skipped (may leave dead code)

  • Reflection: If main code uses reflect on vendored types, analysis may incorrectly mark symbols as unused

  • cgo/assembly: Not supported, tool fails if present

  • Generated code: No special handling (treated like regular code)

  • Internal packages: Handled like any other vendor code

  • Experimental: This is a demo/experimental tool, not production-ready

Open Questions / Future Work

  • Should we support go.work workspaces?
  • Could we integrate with go mod vendor to re-vendor after debloating?
  • Performance optimization for very large monorepos (parallel analysis?)
  • Support for analyzing specific build tags rather than skipping them