Skip to content

Commit 9147d7a

Browse files
golang-version-1.25.3 (#583)
* golang-version-1.25.3 Summary: - Update `golang` version to `1.25.3` on all platofrms. - Future proofing for use of stable `testing/synctest`. * - Linnter alarms supressed. * - Linter restored. - Newly forbidden fmt usage altered. * - Doc uplift. - Linter inconsistency failsafe. * - `mingw` to version `15.2.0`. * - Shim for build behaviour change. * - Shim for build behaviour change. * - Shim for build behaviour change. * - Shim for build behaviour change. * - Shim for build behaviour change. * - Shim for build behaviour change. * - Another try. * - Another try.
1 parent 7c1e4b0 commit 9147d7a

File tree

13 files changed

+99
-22
lines changed

13 files changed

+99
-22
lines changed

.github/workflows/build.yml

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
- name: Set up Go 1.x
9292
uses: actions/setup-go@v5.0.0
9393
with:
94-
go-version: '~1.23'
94+
go-version: '1.25.3'
9595
check-latest: true
9696
cache: true
9797
id: go
@@ -174,12 +174,32 @@ jobs:
174174
BUILDBRANCH: ${{github.ref}}
175175
BUILDPLATFORM: ${{runner.os}}
176176
BUILDPATCHVERSION: ${{github.run_number}}
177-
CGO_ENABLED: 1
177+
CGO_ENABLED: '1'
178178
GH_ACCESS_TOKEN: ${{env.GH_ACCESS_TOKEN}}
179179
GOPRIVATE: ${{env.GOPRIVATE}}
180180
GOOS: windows
181181
GOARCH: amd64
182+
GOMINGWID: 'x86_64-w64-mingw32'
182183
run: |
184+
# Explicitly prioritize the correct MinGW in the PATH
185+
$mingwPath = "C:\mingw64"
186+
if (-not (Test-Path -Path $mingwPath)) {
187+
# Fallback to the chocolatey path, which we know exists
188+
$mingwPath = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64"
189+
}
190+
191+
# Use Resolve-Path to get the guaranteed absolute path
192+
# Now that we've ensured $mingwPath isn't empty, Resolve-Path will succeed.
193+
$mingwPath = Resolve-Path $mingwPath
194+
$env:Path = "$mingwPath\bin;" + $env:Path
195+
196+
# Set CC and CXX with the fully resolved absolute path
197+
$env:CC = "$mingwPath\bin\x86_64-w64-mingw32-gcc"
198+
$env:CXX = "$mingwPath\bin\x86_64-w64-mingw32-g++"
199+
echo "Current PATH:"
200+
echo $env:PATH
201+
202+
183203
git config --global url.https://$env:GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/
184204
$Version = convertfrom-stringdata (get-content ./cicd/version.txt -raw)
185205
$BuildMajorVersion = $Version.'MajorVersion'
@@ -192,9 +212,59 @@ jobs:
192212
echo "BUILDMINORVERSION=$env:BUILDMINORVERSION" >> $GITHUB_ENV
193213
echo "BUILDPATCHVERSION=$env:BUILDPATCHVERSION" >> $GITHUB_ENV
194214
215+
# This creates a PowerShell function to intercept the 'go build' command
216+
# and inject the static linker flags.
217+
# The function calls the actual go.exe with the added arguments.
218+
$originalGoPath = (Get-Command go.exe).Path
219+
function go {
220+
& $originalGoPath @args -ldflags "-linkmode external -extldflags '-static -s -w'"
221+
}
222+
195223
python cicd/python/build.py --verbose --build
196224
python cicd/python/build.py --verbose --build-mcp-client
197225
226+
ls ".\build"
227+
228+
function Copy-FileIfExists {
229+
[CmdletBinding()]
230+
param (
231+
[Parameter(Mandatory = $true, HelpMessage = "The relative or absolute path of the file to be copied.")]
232+
[string]$SourcePath,
233+
234+
[Parameter(Mandatory = $true, HelpMessage = "The relative or absolute path of the destination directory or file.")]
235+
[string]$Destination
236+
)
237+
238+
if (Test-Path -Path $SourcePath -PathType Leaf) {
239+
# Check if the destination directory exists and create it if not
240+
$destinationDir = Split-Path -Path $Destination -Parent
241+
if (-not (Test-Path -Path $destinationDir)) {
242+
Write-Verbose "Creating destination directory: $destinationDir"
243+
New-Item -ItemType Directory -Path $destinationDir | Out-Null
244+
}
245+
246+
# Copy the file
247+
Write-Host "Copying '$SourcePath' to '$Destination'..."
248+
Copy-Item -Path $SourcePath -Destination $Destination -Force -Verbose
249+
Write-Host "Copy complete."
250+
}
251+
else {
252+
Write-Warning "Source file not found: $SourcePath"
253+
}
254+
}
255+
256+
$sourcePath = ".\build\stackql"
257+
$destinationPath = ".\build\stackql.exe"
258+
259+
Copy-FileIfExists -SourcePath $sourcePath -Destination $destinationPath
260+
261+
$mcpSourcePath = ".\build\stackql_mcp_client"
262+
$mcpDestinationPath = ".\build\stackql_mcp_client.exe"
263+
264+
Copy-FileIfExists -SourcePath $mcpSourcePath -Destination $mcpDestinationPath
265+
266+
ls ".\build"
267+
198268
build\stackql.exe --help
199269
200270
- name: Test
@@ -261,7 +331,7 @@ jobs:
261331
- name: Set up Go 1.x
262332
uses: actions/setup-go@v5.0.0
263333
with:
264-
go-version: '~1.24'
334+
go-version: '1.25.3'
265335
check-latest: true
266336
cache: true
267337
id: go
@@ -505,7 +575,7 @@ jobs:
505575
- name: Set up Go 1.x
506576
uses: actions/setup-go@v5.0.0
507577
with:
508-
go-version: '~1.24'
578+
go-version: '1.25.3'
509579
check-latest: true
510580
cache: true
511581
id: go
@@ -708,7 +778,7 @@ jobs:
708778
- name: Set up Go 1.x
709779
uses: actions/setup-go@v5.0.0
710780
with:
711-
go-version: '~1.23'
781+
go-version: '1.25.3'
712782
check-latest: true
713783
cache: true
714784
id: go
@@ -1134,7 +1204,7 @@ jobs:
11341204
- name: Set up Go 1.x
11351205
uses: actions/setup-go@v5.0.0
11361206
with:
1137-
go-version: '~1.23'
1207+
go-version: '1.25.3'
11381208
check-latest: true
11391209
cache: true
11401210
id: go
@@ -1281,7 +1351,7 @@ jobs:
12811351
- name: Set up Go 1.x
12821352
uses: actions/setup-go@v5.0.0
12831353
with:
1284-
go-version: '~1.23'
1354+
go-version: '1.25.3'
12851355
check-latest: true
12861356
cache: true
12871357
id: go

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ linters:
196196
- lll
197197
- revive
198198
path: mcp_client\/cmd\/.*\.go
199+
- linters:
200+
- revive
201+
path: internal\/stackql\/acid\/tsm_physio\/.*\.go
199202
- linters:
200203
- staticcheck
201204
path: ast_format_postgres\.go

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ These guidelines help contributors, human and otherwise, understand and work eff
44

55
We also encourage reading [`docs/developer_guide.md`](/docs/developer_guide.md) for further useful information. For deeper understanding of the "brains" of `stackql`, it is worthwhile to consult [the `AGENTS.md` file of `any-sdk`](https://github.com/stackql/any-sdk/blob/main/AGENTS.md) and linked documents from there.
66

7+
We have upgraded to golang `>= 1.25.3` in order to take advantage of [time simultion and other capabilites in `testing/synctest`](https://go.dev/blog/testing-time).
8+
79

810
## Project Structure & Module Organization
911

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23-bullseye AS sourceprep
1+
FROM golang:1.25.3-bookworm AS sourceprep
22

33
ENV SRC_DIR=/work/stackql/src
44

docs/developer_guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ env CGO_ENABLED=1 PLANCACHEENABLED=false go build \
6666

6767
At this time, we are not dogmatic about how to implement unit tests. Aspirationally, unit tests can be implemented in similar fashion to the none-too opinionated [official testing package documentation](https://pkg.go.dev/testing), and in particular [the overview section](https://pkg.go.dev/testing#pkg-overview).
6868

69+
We have upgraded to golang `>= 1.25.3` in order to take advantage of [time simultion and other capabilites in `testing/synctest`](https://go.dev/blog/testing-time).
70+
6971
To run all unit tests:
7072

7173
```bash

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/stackql/stackql
22

3-
go 1.23.0
3+
go 1.25.3
44

55
require (
66
github.com/DATA-DOG/go-sqlmock v1.5.1

internal/stackql/acid/tsm_physio/best_effort_orchestrator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (orc *bestEffortOrchestrator) processQuery(
121121
retVal = append(retVal, internaldto.NewNopEmptyExecutorOutput([]string{"OK"}))
122122
return retVal, true
123123
}
124-
noParentErr := fmt.Errorf(noParentMessage)
124+
noParentErr := fmt.Errorf("%s", noParentMessage)
125125
retVal = append(retVal, internaldto.NewErroneousExecutorOutput(noParentErr))
126126
return retVal, true
127127
} else if transactStatement.IsRollback() {
@@ -152,7 +152,7 @@ func (orc *bestEffortOrchestrator) processQuery(
152152
retVal = append(
153153
retVal,
154154
internaldto.NewErroneousExecutorOutput(
155-
fmt.Errorf(noParentMessage)),
155+
fmt.Errorf("%s", noParentMessage)),
156156
)
157157
return retVal, true
158158
}

internal/stackql/acid/tsm_physio/txn_orchestrator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (orc *standardOrchestrator) processQuery(
136136
retVal = append(retVal, internaldto.NewNopEmptyExecutorOutput([]string{"OK"}))
137137
return retVal, true
138138
}
139-
noParentErr := fmt.Errorf(noParentMessage)
139+
noParentErr := fmt.Errorf("%s", noParentMessage)
140140
retVal = append(retVal, internaldto.NewErroneousExecutorOutput(noParentErr))
141141
return retVal, true
142142
} else if transactStatement.IsRollback() {
@@ -155,7 +155,7 @@ func (orc *standardOrchestrator) processQuery(
155155
retVal = append(
156156
retVal,
157157
internaldto.NewErroneousExecutorOutput(
158-
fmt.Errorf(noParentMessage)),
158+
fmt.Errorf("%s", noParentMessage)),
159159
)
160160
return retVal, true
161161
}

internal/stackql/astvisit/internally_routable_typing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ func (v *standardInternallyRoutableTypingAstVisitor) getStarColumns(
110110
tbl.SetSelectItemsKey(selectItemsKey)
111111
unsuitableSchemaMsg := "standardInternallyRoutableTypingAstVisitor.getStarColumns(): schema unsuitable for select query"
112112
if err != nil {
113-
return nil, fmt.Errorf(unsuitableSchemaMsg)
113+
return nil, fmt.Errorf("%s", unsuitableSchemaMsg)
114114
}
115115
if itemObjS == nil {
116-
return nil, fmt.Errorf(unsuitableSchemaMsg)
116+
return nil, fmt.Errorf("%s", unsuitableSchemaMsg)
117117
}
118118
var cols []parserutil.ColumnHandle
119119
colNames := itemObjS.GetAllColumns(util.TrimSelectItemsKey(selectItemsKey))

internal/stackql/astvisit/query_rewriting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ func (v *standardQueryRewriteAstVisitor) getStarColumns(
175175
tbl.SetSelectItemsKey(selectItemsKey)
176176
unsuitableSchemaMsg := "standardQueryRewriteAstVisitor.getStarColumns(): schema unsuitable for select query"
177177
if err != nil {
178-
return nil, fmt.Errorf(unsuitableSchemaMsg)
178+
return nil, fmt.Errorf("%s", unsuitableSchemaMsg)
179179
}
180180
if itemObjS == nil {
181-
return nil, fmt.Errorf(unsuitableSchemaMsg)
181+
return nil, fmt.Errorf("%s", unsuitableSchemaMsg)
182182
}
183183
var cols []parserutil.ColumnHandle
184184
colNames := itemObjS.GetAllColumns(util.TrimSelectItemsKey(selectItemsKey))

0 commit comments

Comments
 (0)