Skip to content

Commit 3f0aa35

Browse files
committed
fix(golang-github-task-slim-sprig): stabilize arm64 rounding
Go 1.26 may fuse the multiplication passed to math.Modf on arm64, changing the fractional result and failing TestRound. Force an explicit float64 rounding step before math.Modf, as recommended in golang/go#77657, while keeping the original test intact. Signed-off-by: Mitch Zhu <mitchzhu@microsoft.com>
1 parent 8de080a commit 3f0aa35

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

base/comps/components.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,6 @@ overlay-files = ["overlays/*.overlay.toml"]
996996
[components.golang-github-stretchr-objx]
997997
[components.golang-github-stretchr-testify]
998998
[components.golang-github-syndtr-goleveldb]
999-
[components.golang-github-task-slim-sprig]
1000999
[components.golang-github-task-slim-sprig3]
10011000
[components.golang-github-tidwall-pretty]
10021001
[components.golang-github-tklauser-numcpus]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[components.golang-github-task-slim-sprig]
2+
3+
[[components.golang-github-task-slim-sprig.overlays]]
4+
description = "Force float64 rounding before math.Modf to prevent fused arithmetic from changing round results"
5+
type = "spec-append-lines"
6+
section = "%prep"
7+
lines = [
8+
"# Go may fuse the multiply with math.Modf; force rounding to float64 precision.",
9+
"test \"$(grep -cF 'digit := pow * val' numeric.go)\" -eq 1",
10+
"sed -i 's/digit := pow \\* val/digit := float64(pow * val)/' numeric.go",
11+
]
12+
13+
[components.golang-github-task-slim-sprig.overlays.metadata]
14+
category = "azl-platform-adaptation"
15+
upstream-status = "upstreamable"
16+
bugs = [{ url = "https://github.com/golang/go/issues/77657" }]

locks/golang-github-task-slim-sprig.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
version = 1
33
import-commit = '39ae86274378b905963f46b28867fed2dfd0efe0'
44
upstream-commit = '39ae86274378b905963f46b28867fed2dfd0efe0'
5-
input-fingerprint = 'sha256:90be20219f5bd874c90d069ca376582fa5a757751dae7ac754c1b58133b293a0'
5+
input-fingerprint = 'sha256:c4d3cc6f95935dbd93e7154766cbc3feccce588b8f3db8782ed155ebc23e7f3d'
66
resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e'

specs/g/golang-github-task-slim-sprig/golang-github-task-slim-sprig.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## (rpmautospec version 0.8.3)
33
## RPMAUTOSPEC: autorelease, autochangelog
44
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
5-
release_number = 10;
5+
release_number = 11;
66
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
77
print(release_number + base_release_number - 1);
88
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
@@ -44,6 +44,9 @@ Source0: %{gosource}
4444
%prep
4545
%goprep
4646

47+
# Go may fuse the multiply with math.Modf; force rounding to float64 precision.
48+
test "$(grep -cF 'digit := pow * val' numeric.go)" -eq 1
49+
sed -i 's/digit := pow \* val/digit := float64(pow * val)/' numeric.go
4750
%generate_buildrequires
4851
%go_generate_buildrequires
4952

@@ -60,6 +63,9 @@ rm -vf network_test.go
6063

6164
%changelog
6265
## START: Generated by rpmautospec
66+
* Tue Aug 18 2026 Mitch Zhu <mitchzhu@microsoft.com> - 3.2.0-11
67+
- fix(golang-github-task-slim-sprig): stabilize arm64 rounding
68+
6369
* Thu Apr 30 2026 Daniel McIlvaney <damcilva@microsoft.com> - 3.2.0-10
6470
- feat: introduce deterministic commit resolution via Azure Linux lock file
6571

0 commit comments

Comments
 (0)