Skip to content

Bring OpenBSD support#4865

Merged
mxpv merged 1 commit intocontainerd:masterfrom
yukiisbored:yuki_is_bored/openbsd-support
Jan 14, 2021
Merged

Bring OpenBSD support#4865
mxpv merged 1 commit intocontainerd:masterfrom
yukiisbored:yuki_is_bored/openbsd-support

Conversation

@yukiisbored
Copy link
Copy Markdown
Contributor

Hello, these are some small changes which are made to have docker/cli buildable and run on OpenBSD (I'm the maintainer of the sysutils/docker-cli port).

Thanks!

@k8s-ci-robot
Copy link
Copy Markdown

Hi @yukiisbored. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 19, 2020

Build succeeded.

@yukiisbored yukiisbored force-pushed the yuki_is_bored/openbsd-support branch from d15208c to 5d5693e Compare December 19, 2020 14:47
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 19, 2020

Build succeeded.

Comment thread sys/stat_openbsd.go Outdated
Signed-off-by: Muhammad Kaisar Arkhan <[email protected]>
@yukiisbored yukiisbored force-pushed the yuki_is_bored/openbsd-support branch from 5d5693e to 380b526 Compare January 4, 2021 13:44
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jan 4, 2021

Build succeeded.

@thaJeztah
Copy link
Copy Markdown
Member

@yukiisbored are the patches in this directory the only patches needed for openbsd? http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/sysutils/docker-cli/patches/ ? Will you be upstreaming those patches to the continuity repo as well? (looks like they're mostly small changes, so could probably be accepted)

@yukiisbored
Copy link
Copy Markdown
Contributor Author

yukiisbored commented Jan 4, 2021

@yukiisbored are the patches in this directory the only patches needed for openbsd? http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/sysutils/docker-cli/patches/ ? Will you be upstreaming those patches to the continuity repo as well? (looks like they're mostly small changes, so could probably be accepted)

@thaJeztah For v20.10.1, the patch set is entirely different and the continuity changes aren't needed anymore, if memories served correctly, I think those patches are from someone else's effort to make docker/cli working in OpenBSD which was merged in but Docker 19.03.13 vendored libraries was a bit outdated.

You can see the list of patches that are needed to make v20.10.1 working in my personal OpenBSD ports tree: https://git.yukiisbo.red/yuki/ports/-/tree/trunk/sysutils/docker-cli/patches

@thaJeztah
Copy link
Copy Markdown
Member

Ah, thanks! I recall I made some changes in moby/sys for openbsd (moby/sys@cb807b1), but I see you have some additional changes in your patches; feel free to open pull requests to upstream those changes if they are needed (also for the other repositories)

@yukiisbored
Copy link
Copy Markdown
Contributor Author

@thaJeztah I already made a PR for moby/sys here: moby/sys#59

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread sys/stat_openbsd.go
@@ -0,0 +1,45 @@
// +build openbsd
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just posting here because at a glance this file looked the same as the _unix.go variant, but it's the name of the properties not having the spec suffix;

--- a/sys/stat_unix.go
+++ b/sys/stat_bsd.go
@@ -1,4 +1,4 @@
-// +build linux solaris
+// +build darwin freebsd netbsd

 /*
    Copyright The containerd Authors.
@@ -23,22 +23,22 @@ import (
        "time"
 )

-// StatAtime returns the Atim
+// StatAtime returns the access time from a stat struct
 func StatAtime(st *syscall.Stat_t) syscall.Timespec {
-       return st.Atim
+       return st.Atimespec
 }

-// StatCtime returns the Ctim
+// StatCtime returns the created time from a stat struct
 func StatCtime(st *syscall.Stat_t) syscall.Timespec {
-       return st.Ctim
+       return st.Ctimespec
 }

-// StatMtime returns the Mtim
+// StatMtime returns the modified time from a stat struct
 func StatMtime(st *syscall.Stat_t) syscall.Timespec {
-       return st.Mtim
+       return st.Mtimespec
 }

-// StatATimeAsTime returns st.Atim as a time.Time
+// StatATimeAsTime returns the access time as a time.Time
 func StatATimeAsTime(st *syscall.Stat_t) time.Time {
-       return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert
+       return time.Unix(int64(st.Atimespec.Sec), int64(st.Atimespec.Nsec)) // nolint: unconvert
 }

@mxpv mxpv merged commit cb76f53 into containerd:master Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants