update nimble build (#38)

* update nimble build

* remove arc tests

orc is default on devel
This commit is contained in:
Jacek Sieka 2022-11-21 11:07:33 +01:00 committed by GitHub
parent 9ee8b136e3
commit 5159f7e385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 21 deletions

View File

@ -158,4 +158,4 @@ jobs:
nim --version
nimble --version
nimble install -y --depsOnly
env TEST_LANG="c" nimble test
env NIMLANG="c" nimble test

4
.gitignore vendored
View File

@ -1,5 +1,7 @@
nimcache/
*.exe
gen
nimble.develop
nimble.paths
/build/
gen

View File

@ -1,27 +1,41 @@
import os, strutils
mode = ScriptMode.Verbose
# Package
packageName = "bearssl"
version = "0.1.5"
author = "Status Research & Development GmbH"
description = "BearSSL wrapper"
license = "MIT or Apache License 2.0"
mode = ScriptMode.Verbose
skipDirs = @["tests"]
# Dependencies
requires "nim >= 1.2.0",
"unittest2"
"unittest2"
### Helper functions
proc test(env, path: string) =
# Compilation language is controlled by TEST_LANG
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & env &
" -d:bearsslSplitAbi -rf --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error " & path
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
let verbose = getEnv("V", "") notin ["", "0"]
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
let cfg =
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
(if verbose: "" else: " --verbosity:0 --hints:off") &
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f"
proc build(args, path: string) =
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
proc run(args, path: string) =
build args & " -r", path
import strutils
task test, "Run tests":
for path in listFiles(thisDir() / "tests"):
if path.split(".")[^1] != "nim":
continue
test "-d:debug", path
test "-d:release", path
test "--gc:arc -d:release", path
rmFile(path[0..^5].toExe())
for path in listFiles("tests"):
if not path.endsWith ".nim": continue
for args in [
"-d:debug",
"-d:release",
"-d:bearsslSplitAbi -d:debug",
"-d:bearsslSplitAbi -d:release",
]: run args, path

View File

@ -1132,11 +1132,11 @@ type
hashCV_len* {.importc: "hash_CV_len".}: uint
hashCV_id* {.importc: "hash_CV_id".}: cint
proc sslSessionCacheLruInit*(cc: var SslSessionCacheLru; store: ptr cuchar;
proc sslSessionCacheLruInit*(cc: var SslSessionCacheLru; store: ptr byte;
storeLen: int) {.importcFunc,
importc: "br_ssl_session_cache_lru_init", header: "bearssl_ssl.h".}
proc sslSessionCacheLruForget*(cc: var SslSessionCacheLru; id: ptr cuchar) {.importcFunc,
proc sslSessionCacheLruForget*(cc: var SslSessionCacheLru; id: ptr byte) {.importcFunc,
importc: "br_ssl_session_cache_lru_forget", header: "bearssl_ssl.h".}

0
regenerate.sh Normal file → Executable file
View File