summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.builds/openbsd.yml31
-rw-r--r--compiler/evalffi.nim2
-rw-r--r--config/nim.cfg2
-rw-r--r--lib/pure/coro.nim2
-rw-r--r--lib/pure/os.nim13
-rw-r--r--readme.md2
-rw-r--r--testament/specs.nim2
-rw-r--r--tests/coroutines/tgc.nim1
-rw-r--r--tests/coroutines/twait.nim1
-rw-r--r--tests/dll/nimhcr_integration.nim3
-rw-r--r--tests/dll/nimhcr_unit.nim1
-rw-r--r--tests/exception/t9657.nim1
-rw-r--r--tests/niminaction/Chapter8/sfml/sfml_test.nim1
-rw-r--r--tests/parallel/tarray_of_channels.nim1
-rw-r--r--tests/parallel/tflowvar.nim1
-rw-r--r--tests/stdlib/tgetaddrinfo.nim2
-rw-r--r--tests/stdlib/thttpclient_ssl.nim1
-rw-r--r--tests/stdlib/tosprocterminate.nim2
-rw-r--r--tests/system/talloc2.nim1
-rw-r--r--tests/system/trealloc.nim1
20 files changed, 56 insertions, 15 deletions
diff --git a/.builds/openbsd.yml b/.builds/openbsd.yml
new file mode 100644
index 000000000..c4db2f621
--- /dev/null
+++ b/.builds/openbsd.yml
@@ -0,0 +1,31 @@
+image: openbsd/latest
+packages:
+- gmake
+- sqlite3
+- node
+- boehm-gc
+- pcre
+- sfml
+- sdl2
+- libffi
+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.ncpuonline)
+    bin/nim c 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/compiler/evalffi.nim b/compiler/evalffi.nim
index 58c505a5b..f89451f51 100644
--- a/compiler/evalffi.nim
+++ b/compiler/evalffi.nim
@@ -17,6 +17,8 @@ when defined(windows):
   const libcDll = "msvcrt.dll"
 elif defined(linux):
   const libcDll = "libc.so(.6|.5|)"
+elif defined(openbsd):
+  const libcDll = "/usr/lib/libc.so(.95.1|)"
 elif defined(bsd):
   const libcDll = "/lib/libc.so.7"
 elif defined(osx):
diff --git a/config/nim.cfg b/config/nim.cfg
index 9f152b879..eea04ec11 100644
--- a/config/nim.cfg
+++ b/config/nim.cfg
@@ -167,7 +167,7 @@ path="$lib/pure"
   @end
 @end
 
-@if macosx or freebsd:
+@if macosx or freebsd or openbsd:
   cc = clang
   tlsEmulation:on
   gcc.options.always = "-w"
diff --git a/lib/pure/coro.nim b/lib/pure/coro.nim
index 350b9f187..ead3849c6 100644
--- a/lib/pure/coro.nim
+++ b/lib/pure/coro.nim
@@ -48,7 +48,7 @@ when defined(windows):
     {.warning: "ucontext coroutine backend is not available on windows, defaulting to fibers.".}
   when defined(nimCoroutinesSetjmp):
     {.warning: "setjmp coroutine backend is not available on windows, defaulting to fibers.".}
-elif defined(haiku):
+elif defined(haiku) or defined(openbsd):
   const coroBackend = CORO_BACKEND_SETJMP
   when defined(nimCoroutinesUcontext):
     {.warning: "ucontext coroutine backend is not available on haiku, defaulting to setjmp".}
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 98143bc1a..e1e5f31b4 100644
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -2818,11 +2818,7 @@ when not weirdTarget and (defined(linux) or defined(solaris) or defined(bsd) or
       len = readlink(procPath, result, len)
     setLen(result, len)
 
-when defined(openbsd):
-  proc isExecutable(path: string): bool =
-    let p = getFilePermissions(path)
-    result = fpUserExec in p and fpGroupExec in p and fpOthersExec in p
-
+when not weirdTarget and defined(openbsd):
   proc getApplOpenBsd(): string =
     # similar to getApplHeuristic, but checks current working directory
     when declared(paramStr):
@@ -2846,15 +2842,12 @@ when defined(openbsd):
             break
 
       if len(result) > 0:
-        if isExecutable(result):
-          return expandFilename(result)
-
-        return ""
+        return expandFilename(result)
 
       # search in path
       for p in split(string(getEnv("PATH")), {PathSep}):
         var x = joinPath(p, exePath)
-        if existsFile(x) and isExecutable(x):
+        if existsFile(x):
           return expandFilename(x)
     else:
       result = ""
diff --git a/readme.md b/readme.md
index 59107af34..575d856bb 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] [![builds.sr.ht freebsd status](https://builds.sr.ht/~araq/nim/freebsd.yml.svg)](https://builds.sr.ht/~araq/nim/freebsd.yml?)
+# <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?) [![builds.sr.ht openbsd status](https://builds.sr.ht/~araq/nim/openbsd.yml.svg)](https://builds.sr.ht/~araq/nim/openbsd.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 d0770d03e..c988222f4 100644
--- a/testament/specs.nim
+++ b/testament/specs.nim
@@ -237,6 +237,8 @@ proc parseSpec*(filename: string): TSpec =
           when defined(freebsd): result.err = reDisabled
         of "arm64":
           when defined(arm64): result.err = reDisabled
+        of "openbsd":
+          when defined(openbsd): result.err = reDisabled
         else:
           result.parseErrors.addLine "cannot interpret as a bool: ", e.value
       of "cmd":
diff --git a/tests/coroutines/tgc.nim b/tests/coroutines/tgc.nim
index 46f4f8e83..86b625370 100644
--- a/tests/coroutines/tgc.nim
+++ b/tests/coroutines/tgc.nim
@@ -1,5 +1,6 @@
 discard """
   target: "c"
+  disabled: "openbsd"
 """
 
 import coro
diff --git a/tests/coroutines/twait.nim b/tests/coroutines/twait.nim
index 1769966ab..2563ad7d3 100644
--- a/tests/coroutines/twait.nim
+++ b/tests/coroutines/twait.nim
@@ -1,6 +1,7 @@
 discard """
   output: "Exit 1\nExit 2"
   disabled: "macosx"
+  disabled: "openbsd"
   target: "c"
 """
 import coro
diff --git a/tests/dll/nimhcr_integration.nim b/tests/dll/nimhcr_integration.nim
index 64f6bb708..3f73341be 100644
--- a/tests/dll/nimhcr_integration.nim
+++ b/tests/dll/nimhcr_integration.nim
@@ -1,4 +1,5 @@
 discard """
+  disabled: "openbsd"
   disabled: "macosx"
   output: '''
 main: HELLO!
@@ -151,4 +152,4 @@ update 0
 update 1
 update 2
 
-echo "done"
+echo "done"
\ No newline at end of file
diff --git a/tests/dll/nimhcr_unit.nim b/tests/dll/nimhcr_unit.nim
index f539a53c8..31f398258 100644
--- a/tests/dll/nimhcr_unit.nim
+++ b/tests/dll/nimhcr_unit.nim
@@ -1,4 +1,5 @@
 discard """
+disabled: "openbsd"
 output: '''
 fastcall_proc implementation #1 10
 11
diff --git a/tests/exception/t9657.nim b/tests/exception/t9657.nim
index 0b6e128e0..1023f9593 100644
--- a/tests/exception/t9657.nim
+++ b/tests/exception/t9657.nim
@@ -2,6 +2,7 @@ discard """
   action: run
   exitcode: 1
   target: "c"
+  disabled: "openbsd"
 """
 # todo: remove `target: "c"` workaround once #10343 is properly fixed
 close stdmsg
diff --git a/tests/niminaction/Chapter8/sfml/sfml_test.nim b/tests/niminaction/Chapter8/sfml/sfml_test.nim
index 3c158d1de..5280196c2 100644
--- a/tests/niminaction/Chapter8/sfml/sfml_test.nim
+++ b/tests/niminaction/Chapter8/sfml/sfml_test.nim
@@ -2,6 +2,7 @@ discard """
 action: compile
 disabled: "windows"
 disabled: "freebsd"
+disabled: "openbsd"
 """
 
 import sfml, os
diff --git a/tests/parallel/tarray_of_channels.nim b/tests/parallel/tarray_of_channels.nim
index 5139920ea..9479227aa 100644
--- a/tests/parallel/tarray_of_channels.nim
+++ b/tests/parallel/tarray_of_channels.nim
@@ -8,6 +8,7 @@ test
 test
 test
 '''
+disabled: "openbsd"
 """
 
 # bug #2257
diff --git a/tests/parallel/tflowvar.nim b/tests/parallel/tflowvar.nim
index fd3aa326e..9d93bc7c8 100644
--- a/tests/parallel/tflowvar.nim
+++ b/tests/parallel/tflowvar.nim
@@ -4,6 +4,7 @@ bazbearbazbear
 
 1'''
   cmd: "nim $target --threads:on $options $file"
+  disabled: "openbsd"
 """
 
 import threadpool
diff --git a/tests/stdlib/tgetaddrinfo.nim b/tests/stdlib/tgetaddrinfo.nim
index 225546aa9..1c9d020a1 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) and not defined(freebsd):
+when defined(posix) and not defined(haiku) and not defined(freebsd) and not defined(openbsd):
 
   block RAW_ICMP:
     # the port will be ignored
diff --git a/tests/stdlib/thttpclient_ssl.nim b/tests/stdlib/thttpclient_ssl.nim
index f247ae442..aa278c811 100644
--- a/tests/stdlib/thttpclient_ssl.nim
+++ b/tests/stdlib/thttpclient_ssl.nim
@@ -1,5 +1,6 @@
 discard """
   cmd: "nim $target --threads:on -d:ssl $options $file"
+  disabled: "openbsd"
 """
 
 #            Nim - Basic SSL integration tests
diff --git a/tests/stdlib/tosprocterminate.nim b/tests/stdlib/tosprocterminate.nim
index d487b5e60..c02e0a8da 100644
--- a/tests/stdlib/tosprocterminate.nim
+++ b/tests/stdlib/tosprocterminate.nim
@@ -8,6 +8,8 @@ import os, osproc, times, std / monotimes
 
 when defined(Windows):
   const ProgramWhichDoesNotEnd = "notepad"
+elif defined(openbsd):
+  const ProgramWhichDoesNotEnd = "/bin/cat"
 else:
   const ProgramWhichDoesNotEnd = "/bin/sh"
 
diff --git a/tests/system/talloc2.nim b/tests/system/talloc2.nim
index a321fe741..c498a3f4b 100644
--- a/tests/system/talloc2.nim
+++ b/tests/system/talloc2.nim
@@ -1,5 +1,6 @@
 discard """
 disabled: "windows"
+disabled: "openbsd"
 joinable: false
 disabled: 32bit
 """
diff --git a/tests/system/trealloc.nim b/tests/system/trealloc.nim
index e8d772dbd..1d3e00aff 100644
--- a/tests/system/trealloc.nim
+++ b/tests/system/trealloc.nim
@@ -1,6 +1,7 @@
 discard """
   output: '''success'''
   joinable: false
+  disabled: "openbsd"
 """
 
 # bug #4818