Skip to content

sequential: use os.OpenFile with O_FILE_FLAG_SEQUENTIAL_SCAN on Go 1.26+#216

Open
tonistiigi wants to merge 2 commits intomoby:mainfrom
tonistiigi:sequential-1.26
Open

sequential: use os.OpenFile with O_FILE_FLAG_SEQUENTIAL_SCAN on Go 1.26+#216
tonistiigi wants to merge 2 commits intomoby:mainfrom
tonistiigi:sequential-1.26

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

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.

https://go-review.googlesource.com/c/go/+/699415
https://go-review.googlesource.com/c/go/+/724621

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>
The "Set PACKAGES env" step used "go list -m" to check each
module's required Go version, but Go 1.18 cannot parse the
three-component go directive format (e.g. "go 1.24.0")
introduced in Go 1.21. Switch to awk to read the version
from go.mod and sort -V for semantic version comparison.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
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