From b6de93e603915b57a1eccadc8bd530efd00d28f2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 10 Aug 2020 07:50:55 +0200 Subject: pkg/compiler: merge const files into a single file We now have 8 arches for Linux and .const files produce lots of noise in PRs and lots of diffs. If 3 .txt files are touched, the PR will have 24 .const files, which will be intermixed with .txt files. Frequently const values are equal across arches, and even if they don't spreading a single value across 8 files is inconvinient. Merge all 8 *_arch.const files into a single .const file. See the test for details of the new format. The old format is still parsed for now, we can't update all OSes at once. For Linux this reduces number of const files/lines from 1288/96599 to 158/11603. Fixes #1983 --- tools/syz-check/check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/syz-check/check.go b/tools/syz-check/check.go index 58f34c6fb..86048f9a4 100644 --- a/tools/syz-check/check.go +++ b/tools/syz-check/check.go @@ -317,7 +317,7 @@ func parseDescriptions(OS, arch string) ([]prog.Type, map[string]*ast.Struct, [] if top == nil { return nil, nil, nil, fmt.Errorf("failed to parse txt files:\n%s", errorBuf.Bytes()) } - consts := compiler.DeserializeConstsGlob(filepath.Join("sys", OS, "*_"+arch+".const"), eh) + consts := compiler.DeserializeConstFile(filepath.Join("sys", OS, "*.const"), eh).Arch(arch) if consts == nil { return nil, nil, nil, fmt.Errorf("failed to parse const files:\n%s", errorBuf.Bytes()) } -- cgit mrf-deployment