Skip to content

pkg/archive: remove redundant github.com/moby/sys/sequential dependency - #13675

Merged
mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:rm_sequential
Jun 26, 2026
Merged

mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:rm_sequential

Conversation

@thaJeztah

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.

github.com/moby/sys/sequential v0.7.0 uses this functionality when compiled with go1.26, but provides fallbacks for older Go versions.

Given that containerd has go1.26 as a minimum requirement, we can remove github.com/moby/sys/sequential as an intermediate, and implement the code locally.

ref:

Go 1.26 adds support for passing Windows file flags via os.OpenFile,
eliminating the need to call windows.CreateFile directly.

github.com/moby/sys/sequential v0.7.0 uses this functionality when
compiled with go1.26, but provides fallbacks for older Go versions.

Given that containerd has go1.26 as a minimum requirement, we can
remove github.com/moby/sys/sequential as an intermediate, and implement
the code locally.

ref:

- moby/sys@9d2fc63
- https://go-review.googlesource.com/c/go/+/699415
- https://go-review.googlesource.com/c/go/+/724621

Signed-off-by: Sebastiaan van Stijn <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the github.com/moby/sys/sequential dependency from pkg/archive by using Go 1.26+ support for passing Windows file flags directly via os.OpenFile, while retaining the sequential-scan behavior on Windows to avoid standby-list depletion when reading large files.

Changes:

  • Drop github.com/moby/sys/sequential from go.mod, go.sum, and vendored modules.
  • Replace sequential.Open/sequential.OpenFile usage in pkg/archive/tar_windows.go with os.OpenFile(...|windows.O_FILE_FLAG_SEQUENTIAL_SCAN, ...).
  • Remove the vendored vendor/github.com/moby/sys/sequential package.

Reviewed changes

Copilot reviewed 2 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/archive/tar_windows.go Switches Windows sequential I/O to os.OpenFile + windows.O_FILE_FLAG_SEQUENTIAL_SCAN (Go 1.26+).
go.mod Removes the github.com/moby/sys/sequential requirement.
go.sum Drops checksums for the removed github.com/moby/sys/sequential module.
vendor/modules.txt Removes the vendored module entry for github.com/moby/sys/sequential.
vendor/github.com/moby/sys/sequential/* Deletes the vendored sequential package sources/license/docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thaJeztah
thaJeztah requested a review from vvoland June 26, 2026 08:20
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jun 26, 2026
@thaJeztah

Copy link
Copy Markdown
Member Author

FWIW; I noticed some warning as well on the Vagrant tests;

Run sudo BOX=$BOX RUNC_FLAVOR=$RUNC_FLAVOR vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-integration
  sudo BOX=$BOX RUNC_FLAVOR=$RUNC_FLAVOR vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-integration
  shell: /usr/bin/bash -e {0}
  env:
    GOTOOLCHAIN: local
    BOX: almalinux/8
    CGROUP_DRIVER: cgroupfs
    RUNC_FLAVOR: runc
Warning: NING] Unrecognized arguments: libvirt_ip_command
Bringing machine 'default' up with 'libvirt' provider...

@mxpv
mxpv added this pull request to the merge queue Jun 26, 2026
Merged via the queue into containerd:main with commit 10004d5 Jun 26, 2026
124 of 126 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jun 26, 2026
@thaJeztah
thaJeztah deleted the rm_sequential branch June 26, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants