Skip to content

build: replace precompiled *.lla with local compilation - #462

Merged
xushiwei merged 1 commit into
xgo-dev:mainfrom
aofei:build-lla
Jul 8, 2024
Merged

build: replace precompiled *.lla with local compilation#462
xushiwei merged 1 commit into
xgo-dev:mainfrom
aofei:build-lla

Conversation

@aofei

@aofei aofei commented Jul 7, 2024

Copy link
Copy Markdown
Contributor

Switching from using precompiled *.lla files to compiling locally during the build process for better flexibility and maintainability.

Fixes #411

@codecov

codecov Bot commented Jul 7, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.39%. Comparing base (4ca50f8) to head (361c9c7).
Report is 8 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Comment thread cl/compile_test.go
cltest.FromDir(t, "", "./_testdata", false)
}

func TestSqlite(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为了保证测试案例覆盖,这些测试案例不应该被删除,只不过 llgo_autogen.lla 文件的功能不一样了,以前用于生产环境,现在只用来作为测试比对。

@aofei aofei Jul 8, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的。

那要不要顺便像李杰说的那样把 .lla 全都解压开来呢?压缩的确实不太好,不能 diff 是一方面;git 对压缩包这种二进制本身的处理也不太好,哪怕只变一个字节都会导致整个文件产生一个新的版本历史,因为不能利用 git 的增量存储,造成的结果就是 repo 体积会稍大。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

压缩吧,这几个被测试的库 *.ll 文件都太大了。sqlite 不需要测试了,之前是静态链接的,所以有测试,现在的代码都是标准化的。

Comment thread internal/build/build.go Outdated
}
func llgenPkg(pkgPath, expFile string, procFile func(linkFile string)) {
dir := filepath.Join(llgoRoot(), pkgPath[len(llgoModPath):])
ll := llgen.GenFrom(dir, false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llgen 这个包只能用于测试,不用于 build 这个生产环境。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实这些 llgo 仓库的包和用户的包一样的处理逻辑就行了,不应该需要这里的额外处理规则。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实这些 llgo 仓库的包和用户的包一样的处理逻辑就行了,不应该需要这里的额外处理规则。

好的,我稍后来改下。

llgen 这个包只能用于测试,不用于 build 这个生产环境。

不过我有些好奇,原本那些 .lla 也是 llgen 创建的吧?还是说从今以后 llgen 的使用场景变了只用来测试?

@xushiwei xushiwei Jul 8, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@xushiwei
xushiwei merged commit 88962f9 into xgo-dev:main Jul 8, 2024
@aofei
aofei deleted the build-lla branch July 8, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission denied for decompress *.Ila in system path

2 participants