#12103 - CI for FreeBSD (#12179)

* Ref #12103 - adds FreeBSD CI
* Fix getApplFreebsd - length of the string includes the null terminator byte, so minus 1 for result length
* Show last commit in setup task.
* Remove .git from repository URL
* Don't include noisy details showing last commit.
* Add FreeBSD build status badge
* Fix #12182 - disable tconsole on FreeBSD
* Disable tgetaddrinfo on FreebSD as getaddrinfo doesn't support the ICMP protocol.
* Install boehm-gc-threaded
* Use libgc-threaded.so on FreeBSD rather than libgc.so.
* Simplify build failure handling. Update alt text for CI badge.
* Disable test on FreeBSD
* Simplify build config

- use GNU make to build csources
- set PATH variable using the environment key
- remove modification of config to set CC as this is already set

* Install git which seems to be missing from current freebsd images
* Revert change to how path is set
* Add a comment explaining why the length is truncated
* Fix tconsole.
This commit is contained in:
Euan 2019-11-29 20:00:54 +00:00 • committed by Andreas Rumpf
commit c5c6bae2a4
10 changed files with 44 additions and 3 deletions

31
.builds/freebsd.yml Normal file
View file

@ -0,0 +1,31 @@
image: freebsd/latest
packages:
- databases/sqlite3
- devel/boehm-gc-threaded
- devel/pcre
- devel/sdl20
- devel/sfml
- www/node
- devel/gmake
- devel/git
sources:
- https://github.com/nim-lang/Nim
environment:
CC: /usr/bin/clang
tasks:
- setup: |
cd Nim
git clone --depth 1 -q https://github.com/nim-lang/csources.git
gmake -C csources -j $(sysctl -n hw.ncpu)
bin/nim c --skipUserCfg --skipParentCfg koch
echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv
- test: |
cd Nim
if ! ./koch runCI; then
nim c -r tools/ci_testresults.nim
exit 1
fi
triggers:
- action: email
condition: failure
to: Andreas Rumpf <rumpf_a@web.de>

2
.gitignore vendored
View file

@ -84,3 +84,5 @@ megatest.nim
/outputGotten.txt /outputGotten.txt
/lib/pure/*.js /lib/pure/*.js
!/.builds/

View file

@ -2722,7 +2722,8 @@ when not weirdTarget and (defined(freebsd) or defined(dragonfly)):
result.setLen(0) # error! result.setLen(0) # error!
break break
else: else:
result.setLen(pathLength) # trim the trailing null byte, as the result is a string not a cstring
result.setLen(pathLength-1)
break break
when not weirdTarget and (defined(linux) or defined(solaris) or defined(bsd) or defined(aix)): when not weirdTarget and (defined(linux) or defined(solaris) or defined(bsd) or defined(aix)):

View file

@ -1998,6 +1998,8 @@ when defined(boehmgc):
const boehmLib = "libgc.dylib" const boehmLib = "libgc.dylib"
elif defined(openbsd): elif defined(openbsd):
const boehmLib = "libgc.so.4.0" const boehmLib = "libgc.so.4.0"
elif defined(freebsd):
const boehmLib = "libgc-threaded.so.1"
else: else:
const boehmLib = "libgc.so.1" const boehmLib = "libgc.so.1"
{.pragma: boehmGC, noconv, dynlib: boehmLib.} {.pragma: boehmGC, noconv, dynlib: boehmLib.}

View file

@ -1,4 +1,4 @@
# <img src="https://raw.githubusercontent.com/nim-lang/assets/master/Art/logo-crown.png" height="28px"/> Nim [![Build Status][badge-nim-travisci]][nim-travisci] # <img src="https://raw.githubusercontent.com/nim-lang/assets/master/Art/logo-crown.png" height="28px"/> Nim [![Build Status][badge-nim-travisci]][nim-travisci] [![builds.sr.ht freebsd status](https://builds.sr.ht/~araq/nim/freebsd.yml.svg)](https://builds.sr.ht/~araq/nim/freebsd.yml?)
This repository contains the Nim compiler, Nim's stdlib, tools and documentation. This repository contains the Nim compiler, Nim's stdlib, tools and documentation.
For more information about Nim, including downloads and documentation for For more information about Nim, including downloads and documentation for

View file

@ -229,6 +229,8 @@ proc parseSpec*(filename: string): TSpec =
of "32bit": of "32bit":
if sizeof(int) == 4: if sizeof(int) == 4:
result.err = reDisabled result.err = reDisabled
of "freebsd":
when defined(freebsd): result.err = reDisabled
else: else:
result.parseErrors.addLine "cannot interpret as a bool: ", e.value result.parseErrors.addLine "cannot interpret as a bool: ", e.value
of "cmd": of "cmd":

View file

@ -1,5 +1,6 @@
discard """ discard """
output: "Done" output: "Done"
disabled: "freebsd"
cmd: "nim $target --debuginfo --hints:on --define:useNimRtl $options $file" cmd: "nim $target --debuginfo --hints:on --define:useNimRtl $options $file"
""" """

View file

@ -3,6 +3,7 @@ discard """
Hello, console Hello, console
1 2 3 1 2 3
''' '''
disabled: "freebsd"
""" """
# This file tests the JavaScript console # This file tests the JavaScript console

View file

@ -1,6 +1,7 @@
discard """ discard """
action: compile action: compile
disabled: "windows" disabled: "windows"
disabled: "freebsd"
""" """
import sfml, os import sfml, os

View file

@ -15,7 +15,7 @@ block DGRAM_UDP:
doAssert aiList.ai_next == nil doAssert aiList.ai_next == nil
freeAddrInfo aiList freeAddrInfo aiList
when defined(posix) and not defined(haiku): when defined(posix) and not defined(haiku) and not defined(freebsd):
block RAW_ICMP: block RAW_ICMP:
# the port will be ignored # the port will be ignored