Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and infrastructure fixes for FreeBSD #7924

Merged
merged 18 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Runs scripts/cpplint.py on the modified files
# Based on https://github.com/s0enke/git-hooks/
#
Expand Down
193 changes: 193 additions & 0 deletions .github/workflows/bsd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
name: Build and Test on *BSD
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
# This job takes approximately 6 to 26 minutes
FreeBSD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare ccache
uses: actions/cache@v3
with:
path: .ccache
key: freebsd-13.2-gmake-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
freebsd-13.2-gmake-${{ github.ref }}
freebsd-13.2-gmake
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Build and Test
uses: vmactions/freebsd-vm@v1
with:
release: 13.2
usesh: true
run: |
# apparently fail-on-error isn't the default here
set -e -x
echo "Fetch dependencies"
pkg install -y bash gmake git www/p5-libwww python python3 patch flex bison ccache parallel cvc5 z3
echo "Fetch JBMC dependencies"
pkg install -y openjdk8 wget maven
echo "Zero ccache stats and limit in size"
export CCACHE_BASEDIR=$PWD
export CCACHE_DIR=$PWD/.ccache
ccache -z --max-size=500M
ccache -p
echo "Build with gmake"
# don't do JBMC as to keep the overall time in check
gmake -C src minisat2-download
gmake -C src -j2 CXX="ccache clang++"
# gmake -C jbmc/src setup-submodules
# gmake -C jbmc/src -j2 CXX="ccache clang++"
gmake -C unit "CXX=ccache clang++"
# gmake -C jbmc/unit "CXX=ccache clang++"
echo "Print ccache stats"
ccache -s
echo "Checking completeness of help output"
scripts/check_help.sh clang++
echo "Run unit tests"
gmake -C unit test
# gmake -C jbmc/unit test
echo "Running expected failure tests"
gmake TAGS='[!shouldfail]' -C unit test
# gmake TAGS='[!shouldfail]' -C jbmc/unit test
echo "Run regression tests"
gmake -C regression/cbmc test
# gmake -C regression test-parallel JOBS=2
# gmake -C regression/cbmc test-paths-lifo
# env PATH=$PATH:`pwd`/src/solvers gmake -C regression/cbmc test-cprover-smt2
# # gmake -C jbmc/regression test-parallel JOBS=2

# This job takes approximately 7 to 34 minutes
OpenBSD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare ccache
uses: actions/cache@v3
with:
path: .ccache
key: openbsd-7.4-gmake-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
openbsd-7.4-gmake-${{ github.ref }}
openbsd-7.4-gmake
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Build and Test
uses: vmactions/openbsd-vm@v1
with:
release: 7.4
run: |
# apparently fail-on-error isn't the default here
set -e -x
echo "Fetch dependencies"
pkg_add -v bash gmake llvm%16 git python3 bison ccache parallel z3
ln -s $(which llvm-ar-16) /usr/local/bin/llvm-ar
echo "Fetch JBMC dependencies"
pkg_add -v jdk%1.8 wget maven
echo "Zero ccache stats and limit in size"
export CCACHE_BASEDIR=$PWD
export CCACHE_DIR=$PWD/.ccache
ccache -z --max-size=500M
ccache -p
echo "Build with gmake"
# don't do JBMC so as to keep the overall time in check
gmake -C src minisat2-download
gmake -C src -j2 CXX="ccache clang++"
# gmake -C jbmc/src setup-submodules
# gmake -C jbmc/src -j2 CXX="ccache clang++"
gmake -C unit "CXX=ccache clang++"
# gmake -C jbmc/unit "CXX=ccache clang++"
echo "Print ccache stats"
ccache -s
echo "Checking completeness of help output"
scripts/check_help.sh clang++
echo "Run unit tests"
gmake -C unit test
# gmake -C jbmc/unit test
echo "Running expected failure tests"
gmake TAGS='[!shouldfail]' -C unit test
# gmake TAGS='[!shouldfail]' -C jbmc/unit test
echo "Run regression tests"
gmake -C regression/cbmc test
# gmake -C regression test-parallel JOBS=2
# gmake -C regression/cbmc test-paths-lifo
# env PATH=$PATH:`pwd`/src/solvers gmake -C regression/cbmc test-cprover-smt2
# # gmake -C jbmc/regression test-parallel JOBS=2

# This job takes approximately 6 to 29 minutes
NetBSD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare ccache
uses: actions/cache@v3
with:
path: .ccache
key: netbsd-9.3-gmake-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
netbsd-9.3-gmake-${{ github.ref }}
netbsd-9.3-gmake
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Build and Test
uses: vmactions/netbsd-vm@v1
with:
release: 9.3
run: |
# apparently fail-on-error isn't the default here
set -e -x
echo "Fetch dependencies"
pkg_add -v bash gmake git python311 patch flex bison ccache parallel z3 gcc10
ln -s $(which python3.11) /usr/pkg/bin/python3
export PATH=/usr/pkg/gcc10/bin:$PATH
echo "Fetch JBMC dependencies"
pkg_add -v openjdk8 wget apache-maven
echo "Zero ccache stats and limit in size"
export CCACHE_BASEDIR=$PWD
export CCACHE_DIR=$PWD/.ccache
ccache -z --max-size=500M
ccache -p
echo "Build with gmake"
# don't do JBMC so as to keep the overall time in check
gmake -C src minisat2-download
gmake -C src -j2 CXX="ccache g++"
# gmake -C jbmc/src setup-submodules
# gmake -C jbmc/src -j2 CXX="ccache g++"
gmake -C unit "CXX=ccache g++"
# gmake -C jbmc/unit "CXX=ccache g++"
echo "Print ccache stats"
ccache -s
echo "Checking completeness of help output"
scripts/check_help.sh g++
echo "Run unit tests"
# TODO: unit tests are failing, requires debugging
gmake -C unit test || true
# gmake -C jbmc/unit test
echo "Running expected failure tests"
gmake TAGS='[!shouldfail]' -C unit test
# gmake TAGS='[!shouldfail]' -C jbmc/unit test
echo "Run regression tests"
# TODO: we need to model some more library functions
gmake -C regression/cbmc test || true
# gmake -C regression test-parallel JOBS=2
# gmake -C regression/cbmc test-paths-lifo
# env PATH=$PATH:`pwd`/src/solvers gmake -C regression/cbmc test-cprover-smt2
# # gmake -C jbmc/regression test-parallel JOBS=2
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-check-clang-format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Stop on errors
set -e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-check-cpplint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Stop on errors
set -e
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Print ccache stats
run: ccache -s
- name: Checking completeness of help output
run: scripts/check_help.sh
run: scripts/check_help.sh g++
- name: Run unit tests
run: |
make -C unit test IPASIR=$PWD/riss.git/riss
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
- name: Print ccache stats
run: ccache -s
- name: Checking completeness of help output
run: scripts/check_help.sh build/bin
run: scripts/check_help.sh /usr/bin/g++ build/bin
- name: Check if package building works
run: |
cd build
Expand Down
6 changes: 3 additions & 3 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The environments below have been used successfully in the
past, but are not actively tested:

- Solaris 11
- FreeBSD 11
- FreeBSD 13

# Building using CMake

Expand Down Expand Up @@ -246,11 +246,11 @@ Maven 3 manually.

1. As root, get the necessary tools:
```
pkg install bash gmake git www/p5-libwww patch flex bison
pkg install bash gmake git www/p5-libwww python python3 patch flex bison cvc5 z3
```
To compile JBMC, additionally install
```
pkg install openjdk8 wget maven3
pkg install openjdk8 wget maven
```
2. As a user, get the CBMC source via
```
Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen-root/doxygen-markdown/markdown.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
4 changes: 2 additions & 2 deletions doc/man/cbmc.1
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ Set analysis architecture, which defaults to the host architecture. Use one of:
.TP
\fB\-\-os\fR \fIos\fR
Set analysis operating system, which defaults to the host operating system. Use
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBsolaris\fR, or
\fBwindows\fR.
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBnetbsd\fR, \fBopenbsd\fR,
\fBsolaris\fR, or \fBwindows\fR.
.TP
\fB\-\-i386\-linux\fR, \fB\-\-i386\-win32\fR, \fB\-\-i386\-macos\fR, \fB\-\-ppc\-macos\fR, \fB\-\-win32\fR, \fB\-\-winx64\fR
Set analysis architecture and operating system.
Expand Down
4 changes: 2 additions & 2 deletions doc/man/goto-analyzer.1
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ Set analysis architecture, which defaults to the host architecture. Use one of:
.TP
\fB\-\-os\fR \fIos\fR
Set analysis operating system, which defaults to the host operating system. Use
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBsolaris\fR, or
\fBwindows\fR.
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBnetbsd\fR, \fBopenbsd\fR,
\fBsolaris\fR, or \fBwindows\fR.
.TP
\fB\-\-i386\-linux\fR, \fB\-\-i386\-win32\fR, \fB\-\-i386\-macos\fR, \fB\-\-ppc\-macos\fR, \fB\-\-win32\fR, \fB\-\-winx64\fR
Set analysis architecture and operating system.
Expand Down
4 changes: 2 additions & 2 deletions doc/man/janalyzer.1
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ Set analysis architecture, which defaults to the host architecture. Use one of:
.TP
\fB\-\-os\fR \fIos\fR
Set analysis operating system, which defaults to the host operating system. Use
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBsolaris\fR, or
\fBwindows\fR.
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBnetbsd\fR, \fBopenbsd\fR,
\fBsolaris\fR, or \fBwindows\fR.
.TP
\fB\-\-i386\-linux\fR, \fB\-\-i386\-win32\fR, \fB\-\-i386\-macos\fR, \fB\-\-ppc\-macos\fR, \fB\-\-win32\fR, \fB\-\-winx64\fR
Set analysis architecture and operating system.
Expand Down
4 changes: 2 additions & 2 deletions doc/man/jbmc.1
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ Set analysis architecture, which defaults to the host architecture. Use one of:
.TP
\fB\-\-os\fR \fIos\fR
Set analysis operating system, which defaults to the host operating system. Use
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBsolaris\fR, or
\fBwindows\fR.
one of: \fBfreebsd\fR, \fBlinux\fR, \fBmacos\fR, \fBnetbsd\fR, \fBopenbsd\fR,
\fBsolaris\fR, or \fBwindows\fR.
.TP
\fB\-\-i386\-linux\fR, \fB\-\-i386\-win32\fR, \fB\-\-i386\-macos\fR, \fB\-\-ppc\-macos\fR, \fB\-\-win32\fR, \fB\-\-winx64\fR
Set analysis architecture and operating system.
Expand Down
2 changes: 1 addition & 1 deletion doc/slides/cbmc-latex-beamer/do_figures
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

FIG="cbmc-flow.fig frontend.fig"

Expand Down
2 changes: 1 addition & 1 deletion integration/linux/compile_linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Fail on errors
# set -e # not for now
Expand Down
2 changes: 1 addition & 1 deletion jbmc/regression/jbmc-json-ui/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

JBMC_PATH=$1
shift
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

mvn package
java -cp target/jsonGenerator-1.0-SNAPSHOT-jar-with-dependencies.jar:. org.cprover.JsonGenerator
Expand Down
2 changes: 1 addition & 1 deletion jbmc/regression/strings-smoke-tests/performance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

'''
This script collects the running times of the tests present in the current
Expand Down
2 changes: 1 addition & 1 deletion regression/acceleration/accelerate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

cleanup()
{
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-concurrency/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if((NOT WIN32) AND (NOT APPLE))
if((NOT WIN32) AND (NOT APPLE) AND (NOT (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")))
add_test_pl_tests(
"$<TARGET_FILE:cbmc> --no-standard-checks --validate-goto-model --validate-ssa-equation"
)
Expand Down
4 changes: 2 additions & 2 deletions regression/cbmc-concurrency/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ default: tests.log
include ../../src/config.inc
include ../../src/common

ifeq ($(filter-out OSX MSVC,$(BUILD_ENV_)),)
ifeq ($(filter-out OSX MSVC FreeBSD,$(BUILD_ENV_)),)
# no POSIX threads on Windows
# for OSX we'd need sound handling of pointers in multi-threaded programs
# for OSX and FreeBSD we'd need sound handling of pointers in multi-threaded programs
no_pthread = -X pthread
endif

Expand Down
2 changes: 1 addition & 1 deletion regression/contracts-dfcc/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion regression/contracts/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion regression/extract_type_header/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion regression/goto-analyzer-simplify/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion regression/goto-harness-multi-file-project/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -x
set -e
Expand Down
2 changes: 1 addition & 1 deletion regression/goto-harness/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion regression/goto-inspect/chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
Loading
Loading