diff options
-rw-r--r-- | .builds/freebsd.yml | 31 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | lib/pure/os.nim | 3 | ||||
-rw-r--r-- | lib/system.nim | 2 | ||||
-rw-r--r-- | readme.md | 2 | ||||
-rw-r--r-- | testament/specs.nim | 2 | ||||
-rw-r--r-- | tests/dll/client.nim | 1 | ||||
-rw-r--r-- | tests/js/tconsole.nim | 1 | ||||
-rw-r--r-- | tests/niminaction/Chapter8/sfml/sfml_test.nim | 1 | ||||
-rw-r--r-- | tests/stdlib/tgetaddrinfo.nim | 2 |
10 files changed, 44 insertions, 3 deletions
diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml new file mode 100644 index 000000000..73704598f --- /dev/null +++ b/.builds/freebsd.yml @@ -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> diff --git a/.gitignore b/.gitignore index 114d0de5e..34971bc3f 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,5 @@ megatest.nim /outputGotten.txt /lib/pure/*.js + +!/.builds/ diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 39984fe42..618faf78c 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -2722,7 +2722,8 @@ when not weirdTarget and (defined(freebsd) or defined(dragonfly)): result.setLen(0) # error! break else: - result.setLen(pathLength) + # trim the trailing null byte, as the result is a string not a cstring + result.setLen(pathLength-1) break when not weirdTarget and (defined(linux) or defined(solaris) or defined(bsd) or defined(aix)): diff --git a/lib/system.nim b/lib/system.nim index b2325c599..2c5790d5e 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1998,6 +1998,8 @@ when defined(boehmgc): const boehmLib = "libgc.dylib" elif defined(openbsd): const boehmLib = "libgc.so.4.0" + elif defined(freebsd): + const boehmLib = "libgc-threaded.so.1" else: const boehmLib = "libgc.so.1" {.pragma: boehmGC, noconv, dynlib: boehmLib.} diff --git a/readme.md b/readme.md index f78da5b14..95eabf220 100644 --- a/readme.md +++ b/readme.md @@ -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. For more information about Nim, including downloads and documentation for diff --git a/testament/specs.nim b/testament/specs.nim index 53578b306..61820c328 100644 --- a/testament/specs.nim +++ b/testament/specs.nim @@ -229,6 +229,8 @@ proc parseSpec*(filename: string): TSpec = of "32bit": if sizeof(int) == 4: result.err = reDisabled + of "freebsd": + when defined(freebsd): result.err = reDisabled else: result.parseErrors.addLine "cannot interpret as a bool: ", e.value of "cmd": diff --git a/tests/dll/client.nim b/tests/dll/client.nim index 150af3a17..90ca05149 100644 --- a/tests/dll/client.nim +++ b/tests/dll/client.nim @@ -1,5 +1,6 @@ discard """ output: "Done" + disabled: "freebsd" cmd: "nim $target --debuginfo --hints:on --define:useNimRtl $options $file" """ diff --git a/tests/js/tconsole.nim b/tests/js/tconsole.nim index 88c71ea18..b2eecc656 100644 --- a/tests/js/tconsole.nim +++ b/tests/js/tconsole.nim @@ -3,6 +3,7 @@ discard """ Hello, console 1 2 3 ''' + disabled: "freebsd" """ # This file tests the JavaScript console diff --git a/tests/niminaction/Chapter8/sfml/sfml_test.nim b/tests/niminaction/Chapter8/sfml/sfml_test.nim index e71060cb4..3c158d1de 100644 --- a/tests/niminaction/Chapter8/sfml/sfml_test.nim +++ b/tests/niminaction/Chapter8/sfml/sfml_test.nim @@ -1,6 +1,7 @@ discard """ action: compile disabled: "windows" +disabled: "freebsd" """ import sfml, os diff --git a/tests/stdlib/tgetaddrinfo.nim b/tests/stdlib/tgetaddrinfo.nim index 18e0bc7c4..225546aa9 100644 --- a/tests/stdlib/tgetaddrinfo.nim +++ b/tests/stdlib/tgetaddrinfo.nim @@ -15,7 +15,7 @@ block DGRAM_UDP: doAssert aiList.ai_next == nil freeAddrInfo aiList -when defined(posix) and not defined(haiku): +when defined(posix) and not defined(haiku) and not defined(freebsd): block RAW_ICMP: # the port will be ignored |