Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow buildah cross compile for a darwin target
the goal here is to allow ourselves to cross compile buildah for a darwin target. we are doing this to eventually protect from regressions that could creep into buildah so we don't dig ourselves a deeper hole. the simplified and non-variable approach to the make darwin was done with intent to keep this simple until we can exploit things a little more. once this PR merges, i will create a CI test that will test for regressions on a make darwin. we should also be doing a gofmt with a darwin target so the !linux|darwin tagged files are also checked for completeness. initially the test can be optional for passing with the long-term idea that it be made a firm requirement at the buildah maintainers behest. Signed-off-by: baude <bbaude@redhat.com> Closes: #840 Approved by: rhatdan
- Loading branch information
1 parent
6f72599
commit 5cd9be6
Showing
9 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
|
||
package main | ||
|
||
import ( | ||
"github.com/urfave/cli" | ||
) | ||
|
||
var ( | ||
unshareCommand = cli.Command{ | ||
Name: "unshare", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// +build linux | ||
|
||
package buildah | ||
|
||
import ( | ||
"fmt" | ||
"golang.org/x/sys/unix" | ||
"os" | ||
) | ||
|
||
func setChildProcess() error { | ||
if err := unix.Prctl(unix.PR_SET_CHILD_SUBREAPER, uintptr(1), 0, 0, 0); err != nil { | ||
fmt.Fprintf(os.Stderr, "prctl(PR_SET_CHILD_SUBREAPER, 1): %v\n", err) | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// +build !linux | ||
|
||
package buildah | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
) | ||
|
||
func setChildProcess() error { | ||
return errors.New("function not supported on non-linux systems") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
vendor/github.com/projectatomic/libpod/pkg/chrootuser/user.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
vendor/github.com/projectatomic/libpod/pkg/chrootuser/user_linux.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.