Skip to content

Conversation

@battlmonstr
Copy link
Contributor

@battlmonstr battlmonstr commented Nov 4, 2024

Problem:

A git commit sha or a branch name change causes relinking of executable targets with silkworm-buildinfo library even if nothing else has changed.

During development (e.g. local Debug builds) it is more important to have fast incremental builds than having the correct git commit sha and a branch name baked into the binary.

Solution:

Add git info arguments to cable_add_buildinfo_library. Hardcode them in Debug builds to avoid relinking and save time when doing small changes and git rebase/squash/reword operations.

Test

Silkworm git commit --amend --date=now && time make output before the change:

...
[11/70] Updating silkworm-buildinfo:
       Project Version:  0.1.0-dev+commit.11e1cbbc.dirty (prerelease)
       System Name:      darwin
       System Processor: arm64
       Compiler ID:      appleclang
       Compiler Version: 15.0.0.15000309
       Build Type:       debug
       Git Info:         //11e1cbbc69056575cae00370af1883e5f6504944 (dirty)
       Git Branch:       pr/test
       Git Origin URL:   git@github.com:erigontech/silkworm.git
       Timestamp:        2024-11-04T10:57:47
[68/69] Linking CXX executable cmd/dev/snapshots
make  104.37s user 9.23s system 509% cpu 22.279 total

Silkworm git commit --amend --date=now && time make output after the change:

...
[1/47] CableBuildInfo: updating gitinfo.txt
make  0.08s user 0.07s system 84% cpu 0.176 total

Note

Our evmone refers to https://github.com/erigontech/evmone - rebase_to_v0.13 branch.

Upstream PR:
ipsilon/evmone#1067

Problem:

A git commit sha or a branch name change causes relinking of executable targets with silkworm-buildinfo library even if nothing else has changed.

During development (e.g. local Debug builds) it is more important to have fast incremental builds than having the correct git commit sha and a branch name baked into the binary.

Solution:

Add git info arguments to cable_add_buildinfo_library.
Hardcode them in Debug builds to avoid relinking and save time when doing small changes and git rebase/squash/reword operations.
@canepat canepat merged commit 90e29ac into master Nov 4, 2024
@canepat canepat deleted the pr/gitinfo branch November 4, 2024 20:24
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.

3 participants