Skip to content

Commit

Permalink
fix: freebsd build support (#1659)
Browse files Browse the repository at this point in the history
- Avoid hard-coding the path for bash - this typically is installed as
  /usr/local/bin/bash

- Allow for the fact that FreeBSD's rlimit uses signed integers

Almost all of the test suite passes with three test failures that I
haven't tried to debug yet.

Signed-off-by: Doug Rabson <[email protected]>
  • Loading branch information
dfr authored Jul 29, 2023
1 parent fc47fb9 commit 20391a2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func DumpRuntimeParams(log log.Logger) {

err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err == nil {
evt = evt.Uint64("max. open files", rLimit.Cur)
evt = evt.Uint64("max. open files", uint64(rLimit.Cur)) //nolint: unconvert // required for *BSD
}

if content, err := os.ReadFile("/proc/sys/net/core/somaxconn"); err == nil {
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/fuzzAll.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand All @@ -15,4 +15,4 @@ do
parentDir=$(dirname $file)
go test $parentDir -run=$func -fuzz=$func$ -fuzztime=${fuzzTime}s -tags sync,metrics,search,scrub,containers_image_openpgp | grep -oP -x '^(?:(?!\blevel\b).)*$'
done
done
done
4 changes: 3 additions & 1 deletion test/scripts/gen_certs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -xe
#!/usr/bin/env bash

set -xe

openssl req \
-newkey rsa:2048 \
Expand Down
4 changes: 3 additions & 1 deletion test/scripts/gen_nameless_certs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -xe
#!/usr/bin/env bash

set -xe

openssl req \
-newkey rsa:2048 \
Expand Down

0 comments on commit 20391a2

Please sign in to comment.