Skip to content

[DNM] testing sequential: use os.OpenFile with O_FILE_FLAG_SEQUENTIAL_SCAN on Go 1.26+#223

Closed
thaJeztah wants to merge 8 commits into
moby:mainfrom
thaJeztah:wip_sequential
Closed

[DNM] testing sequential: use os.OpenFile with O_FILE_FLAG_SEQUENTIAL_SCAN on Go 1.26+#223
thaJeztah wants to merge 8 commits into
moby:mainfrom
thaJeztah:wip_sequential

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

quick check of #216 without removing old Go versions

tonistiigi and others added 8 commits June 5, 2026 10:23
Go 1.26 adds support for passing Windows file flags via os.OpenFile,
eliminating the need to call windows.CreateFile directly. Split the
implementation into build-tagged files: go1.26+ uses os.OpenFile
with the new O_FILE_FLAG_SEQUENTIAL_SCAN open flag, while older
versions retain the manual CreateFile approach.

Also bump golang.org/x/sys to v0.37.0 (provides the new constant)
and update the minimum Go version to 1.24.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Remove 1.18.x from the test matrix and the associated
"Set PACKAGES env" step that filtered modules based on
their minimum Go version. All modules now require a Go
version covered by oldstable/stable.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This reverts commit df22785.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
go has a -C option, similar to make -C, which allows us to skip
cd'ing to a directory.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This reverts commit 229a38a.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The go directive now uses a full version, which can't be parsed by
older versions of go;

    invalid go version '1.24.0': must match format 1.23

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
While some modules support go1.18, they may not be when updating the
dependency to later versions, which can happen when using the "local"
versions.

Check if both packages support the Go version used for the test, and
skip kip testing those packages if the Go version is not supported after
updating to the latest version of the dependency.

    echo 'replace github.com/moby/sys/sequential => ../sequential' | cat atomicwriter/go.mod - > atomicwriter/go-local.mod
    # Run go mod tidy to make sure sequential dependency versions are met.
    cd atomicwriter && go mod tidy -modfile=go-local.mod && go test -modfile=go-local.mod  -v .
    go: downloading golang.org/x/sys v0.37.0
    # golang.org/x/sys/windows
    Error: C:\Users\runneradmin\go\pkg\mod\golang.org\x\sys@v0.37.0\windows\security_windows.go:1318:39: undefined: unsafe.SliceData
    Error: C:\Users\runneradmin\go\pkg\mod\golang.org\x\sys@v0.37.0\windows\security_windows.go:1321:39: undefined: unsafe.SliceData
    Error: C:\Users\runneradmin\go\pkg\mod\golang.org\x\sys@v0.37.0\windows\security_windows.go:1324:40: undefined: unsafe.SliceData
    Error: C:\Users\runneradmin\go\pkg\mod\golang.org\x\sys@v0.37.0\windows\security_windows.go:1327:40: undefined: unsafe.SliceData
    note: module requires Go 1.24
    FAIL	github.com/moby/sys/atomicwriter [build failed]
    FAIL
    make: *** [Makefile:46: test-local] Error 2
    Error: Process completed with exit code 2.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Reduce some noise in CI on Windows:

    warning: in the working copy of 'atomicwriter/go.mod', LF will be replaced by CRLF the next time Git touches it
    warning: in the working copy of 'mount/go.mod', LF will be replaced by CRLF the next time Git touches it
    warning: in the working copy of 'mountinfo/go.mod', LF will be replaced by CRLF the next time Git touches it

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah closed this Jun 5, 2026
@thaJeztah thaJeztah deleted the wip_sequential branch June 5, 2026 13:49
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