Skip to content

Commit

Permalink
feat: Add FreeBSD as a build target for releases (#603)
Browse files Browse the repository at this point in the history
Approved-by: Antoine Cotten <antoine@unikraft.io>
  • Loading branch information
antoineco committed Oct 2, 2023
2 parents 947ac80 + cc14362 commit 0d34b05
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .goreleaser-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ builds:
#@ targets = {
#@ "linux-amd64": {"os": "linux", "arch": "amd64"},
#@ "linux-arm64": {"os": "linux", "arch": "arm64"},
#@ "freebsd-amd64": {"os": "freebsd", "arch": "amd64"},
#@ "freebsd-arm64": {"os": "freebsd", "arch": "arm64"},
#@ "darwin-arm64": {"os": "darwin", "arch": "arm64"},
#@ "darwin-amd64": {"os": "darwin", "arch": "amd64"}
#@ }
Expand Down Expand Up @@ -166,6 +168,8 @@ archives:
#@ targets = [
#@ "linux-amd64",
#@ "linux-arm64",
#@ "freebsd-amd64",
#@ "freebsd-arm64",
#@ "darwin-arm64",
#@ "darwin-amd64"
#@ ]
Expand Down
17 changes: 17 additions & 0 deletions exec/process_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file expect in compliance with the License.
package exec

import (
"syscall"
)

func hostAttributes() *syscall.SysProcAttr {
// the Setpgid flag is used to prevent the child process from exiting when
// the parent is killed
return &syscall.SysProcAttr{
Setpgid: true,
}
}
12 changes: 12 additions & 0 deletions machine/network/register_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.
package network

// hostSupportedStrategies returns the map of known supported drivers for the
// given host.
// Currently stubbed out for FreeBSD.
func hostSupportedStrategies() map[string]*Strategy {
return map[string]*Strategy{}
}
9 changes: 9 additions & 0 deletions machine/platform/register_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.
package platform

func unixVariantStrategies() map[Platform]*Strategy {
return map[Platform]*Strategy{}
}

0 comments on commit 0d34b05

Please sign in to comment.