-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move libcontainer to x/sys/unix #1442
Conversation
This fixes several tests that were failing on POWER (ppc64le) -- including some criu tests. I tested using |
On a closer look, there's not that much code outside of libcontainer that doesn't also need to be changed, so WDYT about replacing syscall everywhere else as well? |
Hm. Tests failing again. Hold off on this for now. |
libcontainer/specconv/spec_linux.go
Outdated
@@ -710,7 +711,7 @@ func setupSeccomp(config *specs.LinuxSeccomp) (*configs.Seccomp, error) { | |||
return nil, nil | |||
} | |||
|
|||
// No default action specified, no syscalls listed, assume seccomp disabled | |||
// No default action specified, no unixs listed, assume seccomp disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this (and a few later entries) should keep syscalls
. In #1445 I replaced sycalls.
with unix.
(including the trailing period), and while that can still have false positives (e.g. when the word is at the end of a comment sentence), it won't accidentally do things like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Yep. I thought I caught all the spots I needed to keep syscall
. I'll take a closer look.
1613aa1
to
852f375
Compare
Fixed those error message and comment false positives @wking. PTAL. |
On Thu, May 11, 2017 at 07:59:15AM -0700, christyp wrote:
Fixed those error message and comment false positives @wking. PTAL.
|
67d40a8
to
d3618be
Compare
libcontainer/factory_linux.go
Outdated
@@ -303,7 +304,7 @@ func (l *LinuxFactory) StartInitialization() (err error) { | |||
return err | |||
} | |||
|
|||
// If Init succeeds, syscall.Exec will not return, hence none of the defers will be called. | |||
// If Init succeeds, unix.Exec will not return, hence none of the defers will be called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should still be syscall.Exec
libcontainer/init_linux.go
Outdated
@@ -19,6 +19,8 @@ import ( | |||
"github.com/opencontainers/runc/libcontainer/user" | |||
"github.com/opencontainers/runc/libcontainer/utils" | |||
"github.com/vishvananda/netlink" | |||
|
|||
sysunix "golang.org/x/sys/unix" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we use sysunix import name here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird. I swear there was a conflict here. I'll change it to unix, thanks.
return err | ||
} | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for removing unused functions !
list.go
Outdated
@@ -7,7 +7,7 @@ import ( | |||
"io/ioutil" | |||
"os" | |||
"path/filepath" | |||
"syscall" | |||
"syscall" // avoid use if possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this comment is not required.
d3618be
to
9058649
Compare
Strange that this failed with go 1.8, but not 1.7, and not go tip. Is that failure something that anyone has seen before? |
For reference (because I'm about to rebase) the failure seen on go 1.8 is:
|
9058649
to
402f178
Compare
😆 So this time -- that same test passed with 1.8 and failed with |
402f178
to
8f12a57
Compare
On Mon, May 15, 2017 at 12:12:51PM -0700, christyp wrote:
… but this time all three go versions' tests passed. WDYT @dqminh,
@wking?
Maybe amend the commit to get a new commit date (and commit hash), and
repeat until you can trigger the failure again? It certainly seems
like a flaky-test issue to me, but I'm not a maintainer so I can't
speak to whether fixing the test is a blocker for this PR or not.
|
ad1bf68
to
a958c89
Compare
Welp, I tried several times and just can't get this to fail again. |
Does this look okay to merge? I can't get the test to fail again so it must be flaky. |
@clnperez this needs to be rebased |
eb81e24
to
9e7fc57
Compare
devType = 'b' | ||
} | ||
stat_t, ok := fileInfo.Sys().(*syscall.Stat_t) | ||
stat_t, ok := fileInfo.Sys().(*unix.Stat_t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to verify this line, i'm not sure if the cast will work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, you will have to revert this line.
panic: interface conversion: interface {} is *syscall.Stat_t, not *unix.Stat_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought i had fixed that issue. hold tight on reviews while i take a look at my rebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also looks like you have an unrelated commit shfmt'ing files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i put that in there b/c the tests failed (but also kept it separate b/c it is unrelated)
59231a1
to
40d0d47
Compare
fc52b35
to
a11a682
Compare
Since syscall is outdated and broken for some architectures, use x/sys/unix instead. There are still some dependencies on the syscall package that will remain in syscall for the forseeable future: Errno Signal SysProcAttr Additionally: - os still uses syscall, so it needs to be kept for anything returning *os.ProcessState, such as process.Wait. Signed-off-by: Christy Perez <[email protected]>
Signed-off-by: Christy Perez <[email protected]>
a11a682
to
187d2d8
Compare
@crosbymichael PTAL. Three questions:
|
c97ea57
to
c78515c
Compare
Signed-off-by: Christy Perez <[email protected]>
c78515c
to
9ed7e9b
Compare
Tests seem a little flaky. All passing now. |
Since syscall is outdated and broken for some architectures,
use x/sys/unix instead.
There are still some dependencies on the syscall package that will
remain in syscall for the forseeable future:
Errno
Signal
SysProcAttr
Additionally, os still uses syscall, so it needs to be kept for anything
returning *os.ProcessState, such as process.Wait.
Signed-off-by: Christy Perez [email protected]