Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(debug): ensure reproducible builds in debug mode #1451

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

l-qing
Copy link
Contributor

@l-qing l-qing commented Nov 24, 2024

When use --debug build flag, a new dlv executable file is built into the image. However, during the build, some build flags are not specified, resulting in the binary being different each time, which ultimately causes the digest of the image to be inconsistent.

This change aims to ensure that, as long as the remote dlv code has not been updated, the digest remains consistent with each build.

When use `--debug` build flag, a new dlv executable file is built into the image.
However, during the build, some build flags are not specified, resulting in
the binary being different each time, which ultimately causes the digest of
the image to be inconsistent.

This change aims to ensure that, as long as the remote dlv code has not been
updated, the digest remains consistent with each build.
@@ -331,6 +331,8 @@ func getDelve(ctx context.Context, platform v1.Platform) (string, error) {
// install delve to tmp directory
args := []string{
"build",
"-trimpath",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

Thank you!

@imjasonh imjasonh enabled auto-merge (rebase) November 24, 2024 14:17
@imjasonh imjasonh merged commit 6dedb1e into ko-build:main Nov 24, 2024
21 checks passed
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.

2 participants