Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jan 30, 2020
1 parent 34e133b commit b879050
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 29 deletions.
40 changes: 20 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ jobs:

strategy:
matrix:
Linux_amd64:
vmImage: 'ubuntu-16.04'
CPU: amd64
Linux_i386:
vmImage: 'ubuntu-16.04'
CPU: i386
OSX_amd64:
vmImage: 'macOS-10.14'
CPU: amd64
OSX_amd64_cpp:
vmImage: 'macOS-10.14'
CPU: amd64
NIM_COMPILE_TO_CPP: true
Windows_amd64:
vmImage: 'windows-2019'
CPU: amd64
Windows_amd64_pkg:
vmImage: 'windows-2019'
CPU: amd64
NIM_TEST_PACKAGES: true
# Linux_amd64:
# vmImage: 'ubuntu-16.04'
# CPU: amd64
# Linux_i386:
# vmImage: 'ubuntu-16.04'
# CPU: i386
# OSX_amd64:
# vmImage: 'macOS-10.14'
# CPU: amd64
# OSX_amd64_cpp:
# vmImage: 'macOS-10.14'
# CPU: amd64
# NIM_COMPILE_TO_CPP: true
# Windows_amd64:
# vmImage: 'windows-2019'
# CPU: amd64
# Windows_amd64_pkg:
# vmImage: 'windows-2019'
# CPU: amd64
# NIM_TEST_PACKAGES: true

pool:
vmImage: $(vmImage)
Expand Down
3 changes: 3 additions & 0 deletions compiler/evalffi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ when defined(windows):
const libcDll = "msvcrt.dll"
elif defined(linux):
const libcDll = "libc.so(.6|.5|)"
elif defined(freebsd):
# const libcDll = "/usr/lib/libc.so"
const libcDll = "/lib/libc.so.7"
elif defined(osx):
const libcDll = "/usr/lib/libSystem.dylib"
else:
Expand Down
6 changes: 3 additions & 3 deletions koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ proc runCI(cmd: string) =
echo "runCI:", cmd
# note(@araq): Do not replace these commands with direct calls (eg boot())
# as that would weaken our testing efforts.
when defined(posix): # appveyor (on windows) didn't run this
kochExecFold("Boot", "boot")
# when defined(posix): # appveyor (on windows) didn't run this
# kochExecFold("Boot", "boot")
# boot without -d:nimHasLibFFI to make sure this still works
kochExecFold("Boot in release mode", "boot -d:release -d:danger")

Expand All @@ -497,7 +497,7 @@ proc runCI(cmd: string) =
execFold("Compile tester", "nim c -d:nimCoroutines --os:genode -d:posix --compileOnly testament/testament")

# main bottleneck here
execFold("Run tester", "nim c -r -d:nimCoroutines testament/testament --pedantic all -d:nimCoroutines")
# execFold("Run tester", "nim c -r -d:nimCoroutines testament/testament --pedantic all -d:nimCoroutines")
block: # CT FFI
when defined(posix): # windows can be handled in future PR's
execFold("nimble install -y libffi", "nimble install -y libffi")
Expand Down
2 changes: 1 addition & 1 deletion lib/system/ansi_c.nim
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type
CFilePtr* = ptr CFile ## The type representing a file handle.

# duplicated between io and ansi_c
const stdioUsesMacros = defined(osx) and not defined(emscripten)
const stdioUsesMacros = (defined(osx) or defined(freebsd)) and not defined(emscripten)
const stderrName = when stdioUsesMacros: "__stderrp" else: "stderr"
const stdoutName = when stdioUsesMacros: "__stdoutp" else: "stdout"
const stdinName = when stdioUsesMacros: "__stdinp" else: "stdin"
Expand Down
2 changes: 1 addition & 1 deletion lib/system/io.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type
# text file handling:
when not defined(nimscript) and not defined(js):
# duplicated between io and ansi_c
const stdioUsesMacros = defined(osx) and not defined(emscripten)
const stdioUsesMacros = (defined(osx) or defined(freebsd)) and not defined(emscripten)
const stderrName = when stdioUsesMacros: "__stderrp" else: "stderr"
const stdoutName = when stdioUsesMacros: "__stdoutp" else: "stdout"
const stdinName = when stdioUsesMacros: "__stdinp" else: "stdin"
Expand Down
4 changes: 2 additions & 2 deletions testament/specs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ proc parseSpec*(filename: string): TSpec =
when defined(freebsd): result.err = reDisabled
of "arm64":
when defined(arm64): result.err = reDisabled
of "not defined(nimhaslibffi)": # a bit hacky, this could be generalized somehow
when not defined(nimHasLibFFI): result.err = reDisabled
of "not defined(nimhaslibffienabled)": # a bit hacky, this could be generalized somehow
when not defined(nimHasLibFFIEnabled): result.err = reDisabled
else:
result.parseErrors.addLine "cannot interpret as a bool: ", e.value
of "cmd":
Expand Down
4 changes: 2 additions & 2 deletions tests/vm/tevalffi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ foo:102:103:104
foo:0.03:asdf:103:105
ret={s1:foobar s2:foobar age:25 pi:3.14}
'''
disabled: "not defined(nimHasLibFFI)"
disabled: "not defined(nimHasLibFFIEnabled)"
"""

# re-enable for windows once libffi can be installed in koch.nim
# With win32 (not yet win64), libffi on windows works and this test passes.

when defined(linux):
when defined(linux) or defined(freebsd):
{.passL: "-lm".} # for exp
proc c_exp(a: float64): float64 {.importc: "exp", header: "<math.h>".}

Expand Down

0 comments on commit b879050

Please sign in to comment.