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

Support FreeBSD #80

Merged
merged 2 commits into from
Apr 30, 2024
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
74 changes: 74 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
freebsd_instance:
image_family: freebsd-14-0

task:
name: FreeBSD+packcheck+ghc-9.6.3+cabal-v2
env:
LC_ALL: C.UTF-8
BUILD: cabal-v2
GHCUP_VERSION: 0.1.20.0
DOCSPEC_URL: https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz
DOCSPEC_OPTIONS: "--timeout 60 --check-properties --property-variables xs"
# GHCUP_GHC_OPTIONS: ${{ matrix.ghcup_ghc_options }}
GHCVER: 9.6.3
CABALVER: 3.10.1.0
DISABLE_DOCS: n
ENABLE_DOCSPEC: n
DISABLE_TEST: n
DISABLE_BENCH: n
DISABLE_DIST_CHECKS: y
# SDIST_OPTIONS: ${{ matrix.sdist_options }}
DISABLE_SDIST_BUILD: y

# Cabal options
CABAL_REINIT_CONFIG: y
# CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
# CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
CABAL_PROJECT: cabal.project
CABAL_CHECK_RELAX: y

# Stack options
# STACK_UPGRADE: "y"
# RESOLVER: ${{ matrix.resolver }}
# STACK_YAML: ${{ matrix.stack_yaml }}
# STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}

# packcheck location and revision
PACKCHECK: "./packcheck.sh"
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
PACKCHECK_GITHUB_COMMIT: "084ed12f33ba9ef719aabefa7662a0fa600165dd"

# Pull token from "secrets" setting of the github repo
# COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
# COVERAGE: ${{ matrix.coverage }}

# hlint
# HLINT_VERSION: 3.6.1
# HLINT_OPTIONS: "lint"
# HLINT_TARGETS: "core/src src test benchmark"

# Subdir
# SUBDIR: ${{ matrix.subdir }}

deps_install_script: |
pkg install -y gmake
pkg install -y bash

packcheck_install_script: |
if test ! -e "$PACKCHECK"
then
if test -z "$PACKCHECK_GITHUB_COMMIT"
then
die "PACKCHECK_GITHUB_COMMIT is not specified."
fi
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
chmod +x $PACKCHECK
elif test ! -x "$PACKCHECK"
then
chmod +x $PACKCHECK
fi

packcheck_run_script: |
export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
bash -c "$PACKCHECK $BUILD"
1 change: 1 addition & 0 deletions packcheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extra-source-files:
.ci/stack-8.0.yaml
.circleci/config.yml
.github/workflows/packcheck.yml
.cirrus.yml
appveyor.yml
cabal.project.coveralls
cabal.project
Expand Down
9 changes: 6 additions & 3 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ win_ungztar() {
set_os_specific_vars() {
local os=$(uname)
case "$os" in
Darwin|Linux)
Darwin|Linux|FreeBSD)
OS_HAS_TOOLS=tar
OS_UNGZTAR_CMD="run_verbose_errexit tar xmzvf"
OS_LOCAL_DIR=.local
Expand All @@ -161,7 +161,7 @@ show_machine_info() {
local os=$(uname)
case "$os" in
Linux)
echo "OS: Linux"
echo "OS: $os"
lscpu | grep "^Archi\|^CPU\|^Bogo\|^Hyper\|^Virtualiz"

echo "Memory:"
Expand All @@ -179,6 +179,8 @@ show_machine_info() {
run_verbose cat /sys/fs/cgroup/cpu/cpu.cfs_period_us || true
run_verbose cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us || true
run_verbose cat /sys/fs/cgroup/memory/memory.limit_in_bytes || true ;;
FreeBSD)
echo "OS: FreeBSD" ;;
Darwin)
echo "OS: MacOS" ;;
MINGW*)
Expand Down Expand Up @@ -910,6 +912,7 @@ ghcup_install() {
os=$(uname -s -m)
case "$os" in
"Linux x86_64") GHCUP_ARCH="x86_64-linux" ;;
"FreeBSD x86_64" | "FreeBSD amd64") GHCUP_ARCH=x86_64-portbld-freebsd ;;
"Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;;
"Darwin arm64") GHCUP_ARCH="aarch64-apple-darwin" ;;
*) echo "Unknown OS/Arch: $os"; exit 1;;
Expand Down Expand Up @@ -1964,7 +1967,7 @@ get_sys_time() {
# Do not use floating point values so that we can avoid using bc for
# computations.
#Linux | MINGW*) date +%s.%N ;;
Linux | MINGW*) date +%s ;;
Linux | FreeBSD | MINGW*) date +%s ;;
Darwin) date +%s ;;
*) die "Unknown OS [$os]" ;;
esac
Expand Down
Loading