Skip to content

Commit dbb9fc0

Browse files
committed
libct/*: remove linux build tag from some pkgs
Only some libcontainer packages can be built on non-linux platforms (not that it make sense, but at least go build succeeds). Let's call these "good" packages. For all other packages (i.e. ones that fail to build with GOOS other than linux), it does not make sense to have linux build tag (as they are broken already, and thus are not and can not be used on anything other than Linux). Remove linux build tag for all non-"good" packages. This was mostly done by the following script, with just a few manual fixes on top. function list_good_pkgs() { for pkg in $(find . -type d -print); do GOOS=freebsd go build $pkg 2>/dev/null \ && GOOS=solaris go build $pkg 2>/dev/null \ && echo $pkg done | sed -e 's|^./||' | tr '\n' '|' | sed -e 's/|$//' } function remove_tag() { sed -i -e '\|^// +build linux$|d' $1 go fmt $1 } SKIP="^("$(list_good_pkgs)")" for f in $(git ls-files . | grep .go$); do if echo $f | grep -qE "$SKIP"; then echo skip $f continue fi echo proc $f remove_tag $f done Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent c5b0be7 commit dbb9fc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3
-122
lines changed

libcontainer/cgroups/cgroups.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package cgroups
42

53
import (

libcontainer/cgroups/cgroups_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package cgroups
42

53
import (

libcontainer/cgroups/devices/devices_emulator.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
// SPDX-License-Identifier: Apache-2.0
42
/*
53
* Copyright (C) 2020 Aleksa Sarai <[email protected]>

libcontainer/cgroups/file_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package cgroups
42

53
import (

libcontainer/cgroups/fs/blkio.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package fs
42

53
import (

libcontainer/cgroups/fs/blkio_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package fs
42

53
import (

libcontainer/cgroups/fs/cpu.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package fs
42

53
import (

libcontainer/cgroups/fs/cpu_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package fs
42

53
import (

libcontainer/cgroups/fs/cpuacct.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package fs
42

53
import (

libcontainer/cgroups/fs/cpuacct_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build linux
2-
31
package fs
42

53
import (

0 commit comments

Comments
 (0)