Skip to content

Pass the git commit into the wasm build so it stops reporting unknown - #113

Merged
samifouad merged 1 commit into
mainfrom
fix/wasm-source-commit
Sep 10, 2026
Merged

Pass the git commit into the wasm build so it stops reporting unknown#113
samifouad merged 1 commit into
mainfrom
fix/wasm-source-commit

Conversation

@samifouad

Copy link
Copy Markdown
Member

testsuite.deka.gg has been showing dsc v0.8.0@unknown. This is why.

deka_compiler_metadata() exposes SOURCE_COMMIT:

const SOURCE_COMMIT: &str = match option_env!("DEKA_SOURCE_COMMIT") { ... }

option_env! reads at compile time and falls back to the literal string "unknown" when the variable is unset. The release workflow never set it, so every published wasm has carried source_commit=unknown — visible in the release log as:

[hats build] wasm compiler version=0.8.1 source_commit=unknown

The value is already available as github.sha in the job that builds the artifact, so this passes it through.

Note on the other half

The site compounds it: HatsGrid.tsx renders @{wasmSourceCommit.slice(0, 7)} guarded only by truthiness, and "unknown" is truthy — so a placeholder gets displayed as though it were data. That is fixed separately in the testsuite repo, and it is worth fixing on both sides: this PR makes the value real, and the site guard stops a future placeholder being rendered as a commit.

Effective from the next release; already-published artifacts keep the baked-in unknown.

-claude

deka_compiler_metadata() exposes SOURCE_COMMIT, which reads DEKA_SOURCE_COMMIT
via option_env! at compile time and falls back to the literal string "unknown"
when it is unset. The release workflow never set it, so every published wasm has
reported source_commit=unknown -- visible in the release log as

  [hats build] wasm compiler version=0.8.1 source_commit=unknown

and rendered by testsuite.deka.gg as "dsc v0.8.0@unknown", where the site
assumed a truthy value was a real commit and sliced it to seven characters.

The value is available as github.sha in the job that builds the artifact.
@samifouad
samifouad merged commit 7f4cf3f into main Sep 10, 2026
4 checks passed
@samifouad
samifouad deleted the fix/wasm-source-commit branch September 10, 2026 11:09
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.

1 participant