Skip to content

Fix CLI checksum verification for sha256sum -c#2999

Merged
sugmanue merged 2 commits intosmithy-lang:mainfrom
ShreySinha02:fix/cli-checksum-verification-2477
Mar 25, 2026
Merged

Fix CLI checksum verification for sha256sum -c#2999
sugmanue merged 2 commits intosmithy-lang:mainfrom
ShreySinha02:fix/cli-checksum-verification-2477

Conversation

@ShreySinha02
Copy link
Copy Markdown
Contributor

Background

  • What do these changes do?

Add appendFileNameToChecksum.set(true) to the checksumImages
task in smithy-cli/build.gradle.kts. This generates sha256sum -c
compatible checksum files that include the filename in the standard
format: <hash> <filename> (two spaces).

  • Why are they important?

Previously, the .sha256 files contained only the raw hash
(64 bytes, no filename), causing sha256sum -c to fail with:
sha256sum: WARNING: 1 line is improperly formatted

The Gradle Checksum plugin (Checksum.java line 192) generates
the standard two-space separated format when this option is set:

content = String.format("%s  %s", hashCode, change.getFile().getName());

Testing

Built locally and verified all 5 platform checksums pass sha256sum -c:

smithy-cli-windows-x64.zip: OK
smithy-cli-linux-x86_64.zip: OK
smithy-cli-darwin-aarch64.zip: OK
smithy-cli-darwin-x86_64.zip: OK
smithy-cli-linux-aarch64.zip: OK

Links

Fixes #2477

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Add appendFileNameToChecksum.set(true) to the checksumImages task
in smithy-cli/build.gradle.kts. This generates sha256sum -c
compatible checksum files that include the filename in the format:
<hash>  <filename>

Previously, the .sha256 files contained only the raw hash (64
bytes, no filename), causing sha256sum -c to fail with:
  sha256sum: WARNING: 1 line is improperly formatted

The Gradle Checksum plugin (Checksum.java line 192) generates
the standard two-space separated format when this option is set:
  String.format("%s  %s", hashCode, change.getFile().getName())

Verified all 5 platform checksums pass sha256sum -c:
  smithy-cli-windows-x64.zip:    OK
  smithy-cli-linux-x86_64.zip:   OK
  smithy-cli-darwin-aarch64.zip: OK
  smithy-cli-darwin-x86_64.zip:  OK
  smithy-cli-linux-aarch64.zip:  OK

Fixes smithy-lang#2477
@ShreySinha02 ShreySinha02 requested a review from a team as a code owner March 13, 2026 07:06
@ShreySinha02 ShreySinha02 requested a review from joewyz March 13, 2026 07:06
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@sugmanue sugmanue 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 Shrey for your contribution.

@sugmanue sugmanue merged commit 6164548 into smithy-lang:main Mar 25, 2026
13 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.

Steps for verifying installation of Smithy CLI on linux don't work

2 participants