Skip to content

Commit

Permalink
bash-engine: Don't use RLIMIT_NOFILE on FreeBSD (broken), dump json i…
Browse files Browse the repository at this point in the history
…n github actions
  • Loading branch information
SimonKagstrom committed Mar 11, 2024
1 parent 1d83bf1 commit e27cb33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/freebsd-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ run () {
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../tests || exit 64
make || exit 64
cd ..

chmod u+x .github/workflows/test-executable.sh
kcov --include-pattern=test-executable.sh coverage .github/workflows/test-executable.sh
cat coverage/test-executable.sh/coverage.json
}

run "$@"
1 change: 1 addition & 0 deletions src/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <getopt.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
#include <map>
Expand Down
3 changes: 3 additions & 0 deletions src/engines/bash-engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ class BashEngine : public ScriptEngineBase
unsigned int argc = conf.getArgc();
int xtraceFd = 782; // Typical bash users use 3,4 etc but not high fd numbers (?)
{
// This doesn't work on (recent?) FreeBSDs, so disable for now
#ifndef __FreeBSD__
// However, the range of fd numbers that this process can use is limited by the caller of this process.
// The following code specification will require discussion with many kcov users.
struct rlimit rlim;
Expand All @@ -161,6 +163,7 @@ class BashEngine : public ScriptEngineBase
return false;
}
xtraceFd = rlim.rlim_cur / 4;
#endif
}
const std::string command = conf.keyAsString("bash-command");
bool usePS4 = conf.keyAsInt("bash-use-ps4");
Expand Down

0 comments on commit e27cb33

Please sign in to comment.