build: replace precompiled *.lla with local compilation - #462
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #462 +/- ##
==========================================
- Coverage 97.50% 97.39% -0.12%
==========================================
Files 19 19
Lines 4411 4411
==========================================
- Hits 4301 4296 -5
- Misses 94 98 +4
- Partials 16 17 +1 ☔ View full report in Codecov by Sentry. |
| cltest.FromDir(t, "", "./_testdata", false) | ||
| } | ||
|
|
||
| func TestSqlite(t *testing.T) { |
There was a problem hiding this comment.
为了保证测试案例覆盖,这些测试案例不应该被删除,只不过 llgo_autogen.lla 文件的功能不一样了,以前用于生产环境,现在只用来作为测试比对。
There was a problem hiding this comment.
好的。
那要不要顺便像李杰说的那样把 .lla 全都解压开来呢?压缩的确实不太好,不能 diff 是一方面;git 对压缩包这种二进制本身的处理也不太好,哪怕只变一个字节都会导致整个文件产生一个新的版本历史,因为不能利用 git 的增量存储,造成的结果就是 repo 体积会稍大。
There was a problem hiding this comment.
压缩吧,这几个被测试的库 *.ll 文件都太大了。sqlite 不需要测试了,之前是静态链接的,所以有测试,现在的代码都是标准化的。
| } | ||
| func llgenPkg(pkgPath, expFile string, procFile func(linkFile string)) { | ||
| dir := filepath.Join(llgoRoot(), pkgPath[len(llgoModPath):]) | ||
| ll := llgen.GenFrom(dir, false) |
There was a problem hiding this comment.
llgen 这个包只能用于测试,不用于 build 这个生产环境。
There was a problem hiding this comment.
其实这些 llgo 仓库的包和用户的包一样的处理逻辑就行了,不应该需要这里的额外处理规则。
There was a problem hiding this comment.
其实这些 llgo 仓库的包和用户的包一样的处理逻辑就行了,不应该需要这里的额外处理规则。
好的,我稍后来改下。
llgen 这个包只能用于测试,不用于 build 这个生产环境。
不过我有些好奇,原本那些 .lla 也是 llgen 创建的吧?还是说从今以后 llgen 的使用场景变了只用来测试?
There was a problem hiding this comment.
llgen 能够适应的范围比较窄,不支持打补丁(这是 go standard library 支持的重要基础),所以很多库测试的 ll 文件和生产的 ll 文件是有差异的(当然我们 runtime 恰好没有差异,因为用 Go 的能力比较克制)。另外它的代码逻辑也不严谨,只是匹配测试需要。
Switching from using precompiled *.lla files to compiling locally during the build process for better flexibility and maintainability. Fixes xgo-dev#411
Switching from using precompiled *.lla files to compiling locally during the build process for better flexibility and maintainability.
Fixes #411