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
| } | ||
|
|
||
| // 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.
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.
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
| } | ||
|
|
||
| // 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.
this should still be syscall.Exec
libcontainer/init_linux.go
Outdated
| "github.com/opencontainers/runc/libcontainer/utils" | ||
| "github.com/vishvananda/netlink" | ||
|
|
||
| sysunix "golang.org/x/sys/unix" |
There was a problem hiding this comment.
why do we use sysunix import name here ?
There was a problem hiding this comment.
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.
thanks for removing unused functions !
list.go
Outdated
| "os" | ||
| "path/filepath" | ||
| "syscall" | ||
| "syscall" // avoid use if possible |
There was a problem hiding this comment.
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.
May need to verify this line, i'm not sure if the cast will work
There was a problem hiding this comment.
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.
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.
It also looks like you have an unrelated commit shfmt'ing files
There was a problem hiding this comment.
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 <christy@linux.vnet.ibm.com>
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
a11a682 to
187d2d8
Compare
|
@crosbymichael PTAL. Three questions:
|
c97ea57 to
c78515c
Compare
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
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 christy@linux.vnet.ibm.com