mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
Since switching to checkconst style static analysis for constants imported from Go internal pkgs, we've seen a proliferation of duplicate files for various Go versions. This is not an ideal state of affairs, and results in needless time spent keeping Go and gVisor in sync WRT to these constants. To fix this problem, this CL restores template rendering. Instead of going back to the original implementation where we had separate .tmpl files, this CL uses Adin's unused implementation of integrating template generation into Go comments. This allows these files to be parsed as normal by other tools, and results in not needing separate nogo_facts blaze targets just for template files. For simplicity and versatility I have decided to retain the checkconst annotations. While there don't seem to be that many cases where having +checkconst annotations over rendering is an improvement (one such case is in runtime_go12\d_unsafe.go) there may be other such cases in the future. The template rendering is done via the checkconst analyzer, so there is no redundant information. This CL mainly focuses on removing duplicate files per Go version, so other uses of checkconst annotations that reference internal gvisor pkgs are kept as-is (e.g. bluepill_.*.s, entry_.*.s, etc.). PiperOrigin-RevId: 861305642